Просмотр исходного кода

[all] Source clean up, formatting, and tabs for indentation.

NathanSweet 6 лет назад
Родитель
Сommit
45362e60bf
100 измененных файлов с 2928 добавлено и 3069 удалено
  1. 38 38
      spine-as3/spine-as3/src/spine/animation/AnimationState.as
  2. 22 22
      spine-as3/spine-as3/src/spine/animation/DeformTimeline.as
  3. 3 3
      spine-as3/spine-as3/src/spine/animation/IkConstraintTimeline.as
  4. 1 1
      spine-as3/spine-as3/src/spine/animation/MixDirection.as
  5. 5 5
      spine-as3/spine-as3/src/spine/animation/RotateTimeline.as
  6. 1 1
      spine-as3/spine-as3/src/spine/animation/ScaleTimeline.as
  7. 1 1
      spine-as3/spine-as3/src/spine/animation/TrackEntry.as
  8. 1 1
      spine-c/spine-c-unit-tests/README.md
  9. 1 1
      spine-c/spine-c-unit-tests/main.cpp
  10. 2 2
      spine-c/spine-c/include/spine/Array.h
  11. 3 3
      spine-c/spine-c/include/spine/AttachmentLoader.h
  12. 1 1
      spine-c/spine-c/include/spine/Skin.h
  13. 1 1
      spine-c/spine-c/include/spine/VertexEffect.h
  14. 243 217
      spine-c/spine-c/src/spine/Animation.c
  15. 16 17
      spine-c/spine-c/src/spine/AnimationState.c
  16. 6 10
      spine-c/spine-c/src/spine/Atlas.c
  17. 1 2
      spine-c/spine-c/src/spine/AttachmentLoader.c
  18. 71 71
      spine-c/spine-c/src/spine/Bone.c
  19. 6 6
      spine-c/spine-c/src/spine/IkConstraint.c
  20. 22 23
      spine-c/spine-c/src/spine/Json.c
  21. 3 3
      spine-c/spine-c/src/spine/Json.h
  22. 1 2
      spine-c/spine-c/src/spine/MeshAttachment.c
  23. 3 4
      spine-c/spine-c/src/spine/PathConstraint.c
  24. 1 2
      spine-c/spine-c/src/spine/Skeleton.c
  25. 283 283
      spine-c/spine-c/src/spine/SkeletonBinary.c
  26. 5 2
      spine-c/spine-c/src/spine/SkeletonBounds.c
  27. 45 57
      spine-c/spine-c/src/spine/SkeletonJson.c
  28. 1 1
      spine-c/spine-c/src/spine/Skin.c
  29. 1 1
      spine-c/spine-c/src/spine/Slot.c
  30. 3 3
      spine-c/spine-c/src/spine/Triangulator.c
  31. 28 28
      spine-cocos2d-objc/src/spine/GLUtils.c
  32. 4 4
      spine-cocos2d-objc/src/spine/GLUtils.h
  33. 2 2
      spine-cocos2d-objc/src/spine/SkeletonAnimation.h
  34. 7 7
      spine-cocos2d-objc/src/spine/SkeletonAnimation.m
  35. 1 1
      spine-cocos2d-objc/src/spine/SkeletonRenderer.h
  36. 22 22
      spine-cocos2d-objc/src/spine/SkeletonRenderer.m
  37. 33 32
      spine-cocos2dx/src/spine/SkeletonAnimation.cpp
  38. 6 6
      spine-cocos2dx/src/spine/SkeletonAnimation.h
  39. 11 11
      spine-cocos2dx/src/spine/SkeletonBatch.cpp
  40. 20 20
      spine-cocos2dx/src/spine/SkeletonBatch.h
  41. 51 51
      spine-cocos2dx/src/spine/SkeletonRenderer.cpp
  42. 10 10
      spine-cocos2dx/src/spine/SkeletonRenderer.h
  43. 31 31
      spine-cocos2dx/src/spine/SkeletonTwoColorBatch.cpp
  44. 37 37
      spine-cocos2dx/src/spine/SkeletonTwoColorBatch.h
  45. 4 4
      spine-cocos2dx/src/spine/spine-cocos2dx.cpp
  46. 5 5
      spine-cocos2dx/src/spine/spine-cocos2dx.h
  47. 68 68
      spine-corona/spine-corona/spine.lua
  48. 1 1
      spine-cpp/spine-cpp/include/spine/Animation.h
  49. 354 391
      spine-cpp/spine-cpp/include/spine/AnimationState.h
  50. 42 44
      spine-cpp/spine-cpp/include/spine/AnimationStateData.h
  51. 2 2
      spine-cpp/spine-cpp/include/spine/Atlas.h
  52. 26 28
      spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h
  53. 33 33
      spine-cpp/spine-cpp/include/spine/AttachmentLoader.h
  54. 27 27
      spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h
  55. 9 9
      spine-cpp/spine-cpp/include/spine/AttachmentType.h
  56. 0 2
      spine-cpp/spine-cpp/include/spine/Bone.h
  57. 6 6
      spine-cpp/spine-cpp/include/spine/BoundingBoxAttachment.h
  58. 19 19
      spine-cpp/spine-cpp/include/spine/ClippingAttachment.h
  59. 1 1
      spine-cpp/spine-cpp/include/spine/ColorTimeline.h
  60. 83 83
      spine-cpp/spine-cpp/include/spine/ContainerUtil.h
  61. 37 37
      spine-cpp/spine-cpp/include/spine/CurveTimeline.h
  62. 31 31
      spine-cpp/spine-cpp/include/spine/DeformTimeline.h
  63. 25 25
      spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h
  64. 26 26
      spine-cpp/spine-cpp/include/spine/EventTimeline.h
  65. 1 1
      spine-cpp/spine-cpp/include/spine/HashMap.h
  66. 41 41
      spine-cpp/spine-cpp/include/spine/IkConstraintData.h
  67. 22 22
      spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h
  68. 94 94
      spine-cpp/spine-cpp/include/spine/MeshAttachment.h
  69. 1 1
      spine-cpp/spine-cpp/include/spine/MixBlend.h
  70. 2 1
      spine-cpp/spine-cpp/include/spine/MixDirection.h
  71. 20 20
      spine-cpp/spine-cpp/include/spine/PathAttachment.h
  72. 71 71
      spine-cpp/spine-cpp/include/spine/PathConstraint.h
  73. 54 54
      spine-cpp/spine-cpp/include/spine/PathConstraintData.h
  74. 23 23
      spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h
  75. 25 25
      spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h
  76. 13 13
      spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h
  77. 34 35
      spine-cpp/spine-cpp/include/spine/PointAttachment.h
  78. 1 1
      spine-cpp/spine-cpp/include/spine/Pool.h
  79. 88 88
      spine-cpp/spine-cpp/include/spine/RegionAttachment.h
  80. 31 31
      spine-cpp/spine-cpp/include/spine/RotateTimeline.h
  81. 13 13
      spine-cpp/spine-cpp/include/spine/ScaleTimeline.h
  82. 13 13
      spine-cpp/spine-cpp/include/spine/ShearTimeline.h
  83. 0 1
      spine-cpp/spine-cpp/include/spine/Skeleton.h
  84. 89 89
      spine-cpp/spine-cpp/include/spine/SkeletonBinary.h
  85. 64 67
      spine-cpp/spine-cpp/include/spine/SkeletonBounds.h
  86. 38 38
      spine-cpp/spine-cpp/include/spine/SkeletonClipping.h
  87. 0 1
      spine-cpp/spine-cpp/include/spine/SkeletonData.h
  88. 12 12
      spine-cpp/spine-cpp/include/spine/TextureLoader.h
  89. 3 4
      spine-cpp/spine-cpp/include/spine/Timeline.h
  90. 53 53
      spine-cpp/spine-cpp/include/spine/TransformConstraint.h
  91. 36 36
      spine-cpp/spine-cpp/include/spine/TransformConstraintData.h
  92. 21 21
      spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h
  93. 7 7
      spine-cpp/spine-cpp/include/spine/TransformMode.h
  94. 23 23
      spine-cpp/spine-cpp/include/spine/TranslateTimeline.h
  95. 25 25
      spine-cpp/spine-cpp/include/spine/TwoColorTimeline.h
  96. 48 48
      spine-cpp/spine-cpp/include/spine/VertexAttachment.h
  97. 9 16
      spine-cpp/spine-cpp/src/spine/Animation.cpp
  98. 75 128
      spine-cpp/spine-cpp/src/spine/AnimationState.cpp
  99. 24 64
      spine-cpp/spine-cpp/src/spine/Atlas.cpp
  100. 1 1
      spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp

+ 38 - 38
spine-as3/spine-as3/src/spine/animation/AnimationState.as

@@ -54,7 +54,7 @@ package spine.animation {
 		internal var queue : EventQueue;
 		internal var propertyIDs : Dictionary = new Dictionary();
 		internal var mixingTo : Vector.<TrackEntry> = new Vector.<TrackEntry>();
-		internal var animationsChanged : Boolean;			
+		internal var animationsChanged : Boolean;
 		public var timeScale : Number = 1;
 		internal var trackEntryPool : Pool;
 
@@ -131,7 +131,7 @@ package spine.animation {
 			if (from == null) return true;
 
 			var finished : Boolean = updateMixingFrom(from, delta);
-			
+
 			from.animationLast = from.nextAnimationLast;
 			from.trackLast = from.nextTrackLast;
 
@@ -142,11 +142,11 @@ package spine.animation {
 					to.mixingFrom = from.mixingFrom;
 					if (from.mixingFrom != null) from.mixingFrom.mixingTo = to;
 					to.interruptAlpha = from.interruptAlpha;
-					queue.end(from);					
+					queue.end(from);
 				}
 				return finished;
 			}
-				
+
 			from.trackTime += delta * from.timeScale;
 			to.mixTime += delta;
 			return false;
@@ -182,11 +182,11 @@ package spine.animation {
 						Timeline(timelines[ii]).apply(skeleton, animationLast, animationTime, events, mix, blend, MixDirection.In);
 				} else {
 					var timelineMode : Vector.<int> = current.timelineMode;
-					
+
 					var firstFrame : Boolean = current.timelinesRotation.length == 0;
 					if (firstFrame) current.timelinesRotation.length = timelineCount << 1;
 					var timelinesRotation : Vector.<Number> = current.timelinesRotation;
-					
+
 					for (ii = 0; ii < timelineCount; ii++) {
 						var timeline : Timeline = timelines[ii];
 						var timelineBlend : MixBlend = (timelineMode[ii] & (NOT_LAST - 1)) == SUBSEQUENT ? blend : MixBlend.setup;
@@ -234,11 +234,11 @@ package spine.animation {
 			} else {
 				var timelineMode : Vector.<int> = from.timelineMode;
 				var timelineHoldMix : Vector.<TrackEntry> = from.timelineHoldMix;
-	
+
 				var firstFrame : Boolean = from.timelinesRotation.length == 0;
 				if (firstFrame) from.timelinesRotation.length = timelineCount << 1;
 				var timelinesRotation : Vector.<Number> = from.timelinesRotation;
-														
+
 				from.totalAlpha = 0;
 				for (i = 0; i < timelineCount; i++) {
 					var timeline : Timeline = timelines[i];
@@ -264,7 +264,7 @@ package spine.animation {
 						alpha = alphaHold;
 						break;
 					default:
-						timelineBlend = MixBlend.setup;						
+						timelineBlend = MixBlend.setup;
 						var holdMix : TrackEntry = timelineHoldMix[i];
 						alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);
 						break;
@@ -272,7 +272,7 @@ package spine.animation {
 					from.totalAlpha += alpha;
 					if (timeline is RotateTimeline)
 						applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);
-					else {	
+					else {
 						if (timelineBlend == MixBlend.setup) {
 							if (timeline is AttachmentTimeline) {
 								if (attachments || ((timelineMode[i] & NOT_LAST) == NOT_LAST)) direction = MixDirection.In;
@@ -282,14 +282,14 @@ package spine.animation {
 						}
 						timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);
 					}
-				}	
-			}			
-	
+				}
+			}
+
 			if (to.mixDuration > 0) queueEvents(from, animationTime);
 			this.events.length = 0;
 			from.nextAnimationLast = animationTime;
 			from.nextTrackLast = from.trackTime;
-	
+
 			return mix;
 		}
 
@@ -315,8 +315,8 @@ package spine.animation {
 					case MixBlend.first:
 						r1 = bone.rotation;
 						r2 = bone.data.rotation;
-				}				
-			} else {			
+				}
+			} else {
 				r1 = blend == MixBlend.setup ? bone.data.rotation : bone.rotation;
 				if (time >= frames[frames.length - RotateTimeline.ENTRIES]) // Time is after last frame.
 					r2 = bone.data.rotation + frames[frames.length + RotateTimeline.PREV_ROTATION];
@@ -326,7 +326,7 @@ package spine.animation {
 					var prevRotation : Number = frames[frame + RotateTimeline.PREV_ROTATION];
 					var frameTime : Number = frames[frame];
 					var percent : Number = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));
-	
+
 					r2 = frames[frame + RotateTimeline.ROTATION] - prevRotation;
 					r2 -= (16384 - int((16384.499999999996 - r2 / 360))) * 360;
 					r2 = prevRotation + r2 * percent + bone.data.rotation;
@@ -334,12 +334,12 @@ package spine.animation {
 				}
 			}
 
-			// Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.			
+			// Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.
 			var total : Number, diff : Number = r2 - r1;
 			diff -= (16384 - int((16384.499999999996 - diff / 360))) * 360;
 			if (diff == 0) {
 				total = timelinesRotation[i];
-			} else {				
+			} else {
 				var lastTotal : Number, lastDiff : Number;
 				if (firstFrame) {
 					lastTotal = 0;
@@ -378,8 +378,8 @@ package spine.animation {
 				if (event.time < trackLastWrapped) break;
 				if (event.time > animationEnd) continue; // Discard events outside animation start/end.
 				queue.event(entry, event);
-			}			
-			
+			}
+
 			// Queue complete if completed a loop iteration or the animation.
 			var complete:Boolean;
 			if (entry.loop)
@@ -433,20 +433,20 @@ package spine.animation {
 		private function setCurrent(index : int, current : TrackEntry, interrupt : Boolean) : void {
 			var from : TrackEntry = expandToIndex(index);
 			tracks[index] = current;
-	
+
 			if (from != null) {
 				if (interrupt) queue.interrupt(from);
 				current.mixingFrom = from;
 				from.mixingTo = current;
 				current.mixTime = 0;
-	
+
 				// Store the interrupted mix percentage.
 				if (from.mixingFrom != null && from.mixDuration > 0)
 					current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);
-	
+
 				from.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.
 			}
-	
+
 			queue.start(current);
 		}
 
@@ -504,9 +504,9 @@ package spine.animation {
 					var duration : Number = last.animationEnd - last.animationStart;
 					if (duration != 0) {
 						if (last.loop)
-						    delay += duration * (1 + (int)(last.trackTime / duration));
+							delay += duration * (1 + (int)(last.trackTime / duration));
 						else
-						    delay += Math.max(duration, last.trackTime);						
+							delay += Math.max(duration, last.trackTime);
 					} else
 						delay = last.trackTime;
 				}
@@ -590,7 +590,7 @@ package spine.animation {
 		private function _animationsChanged() : void {
 			animationsChanged = false;
 
-			propertyIDs = new Dictionary();					
+			propertyIDs = new Dictionary();
 			var i : int = 0;
 			var n: int = 0;
 			var entry : TrackEntry = null;
@@ -601,7 +601,7 @@ package spine.animation {
 					entry = entry.mixingFrom;
 				do {
 					if (entry.mixingTo == null || entry.mixBlend != MixBlend.add) computeHold(entry);
-					entry = entry.mixingTo;			
+					entry = entry.mixingTo;
 				} while (entry != null);
 			}
 
@@ -614,7 +614,7 @@ package spine.animation {
 				}
 			}
 		}
-		
+
 		private function computeNotLast (entry: TrackEntry) : void {
 			var timelines : Vector.<Timeline> = entry.animation.timelines;
 			var timelinesCount : int = entry.animation.timelines.length;
@@ -636,19 +636,19 @@ package spine.animation {
 		}
 
 		private function computeHold (entry: TrackEntry) : void {
-			var to: TrackEntry = entry.mixingTo;			
+			var to: TrackEntry = entry.mixingTo;
 			var timelines : Vector.<Timeline> = entry.animation.timelines;
 			var timelinesCount : int = entry.animation.timelines.length;
 			var timelineMode : Vector.<int> = entry.timelineMode;
-			timelineMode.length = timelinesCount;			
+			timelineMode.length = timelinesCount;
 			var timelineHoldMix : Vector.<TrackEntry> = entry.timelineHoldMix;
 			timelineHoldMix.length = 0;
 			var propertyIDs: Dictionary = this.propertyIDs;
-			
+
 			var i : int = 0;
 			if (to != null && to.holdPrevious) {
 				for (i = 0; i < timelinesCount; i++) {
-					propertyIDs[timelines[i].getPropertyId().toString()] = true;			
+					propertyIDs[timelines[i].getPropertyId().toString()] = true;
 					timelineMode[i] = HOLD;
 				}
 				return;
@@ -658,7 +658,7 @@ package spine.animation {
 			for (i = 0; i < timelinesCount; i++) {
 				var timeline : Timeline = Timeline(timelines[i]);
 				var intId : int = timeline.getPropertyId();
-				var id : String = intId.toString();			
+				var id : String = intId.toString();
 				var contained: Object = propertyIDs[id];
 				propertyIDs[id] = true;
 				if (contained != null) {
@@ -666,11 +666,11 @@ package spine.animation {
 				} else if (to == null || timeline is AttachmentTimeline || timeline is DrawOrderTimeline
 					|| timeline is EventTimeline || !hasTimeline(to, intId)) {
 					timelineMode[i] = AnimationState.FIRST;
-				} else {					
+				} else {
 					for (var next : TrackEntry = to.mixingTo; next != null; next = next.mixingTo) {
 						if (hasTimeline(next, intId)) continue;
 						if (entry.mixDuration > 0) {
-							timelineMode[i] = AnimationState.HOLD_MIX;							
+							timelineMode[i] = AnimationState.HOLD_MIX;
 							timelineHoldMix[i] = entry;
 							continue outer;
 						}
@@ -678,7 +678,7 @@ package spine.animation {
 					}
 					timelineMode[i] = AnimationState.HOLD;
 				}
-			}			
+			}
 		}
 
 		private static function hasTimeline (entry: TrackEntry, id : int) : Boolean {

+ 22 - 22
spine-as3/spine-as3/src/spine/animation/DeformTimeline.as

@@ -34,7 +34,7 @@ package spine.animation {
 	import spine.Skeleton;
 	import spine.Slot;
 
-	public class DeformTimeline extends CurveTimeline {		
+	public class DeformTimeline extends CurveTimeline {
 		public var slotIndex : int;
 		public var frames : Vector.<Number>;
 		public var frameVertices : Vector.<Vector.<Number>>;
@@ -63,16 +63,16 @@ package spine.animation {
 			if (!slot.bone.active) return;
 			var slotAttachment : Attachment = slot.attachment;
 			if (!(slotAttachment is VertexAttachment) || !(VertexAttachment(slotAttachment).deformAttachment == attachment)) return;
-			
+
 			var deformArray : Vector.<Number> = slot.deform;
 			if (deformArray.length == 0) blend = MixBlend.setup;
-			
+
 			var frameVertices : Vector.<Vector.<Number>> = this.frameVertices;
 			var vertexCount : int = frameVertices[0].length;
 			var deform : Vector.<Number>;
 
 			var frames : Vector.<Number> = this.frames;
-			var i : int;			
+			var i : int;
 			if (time < frames[0]) {
 				vertexAttachment = VertexAttachment(slotAttachment);
 				switch (blend) {
@@ -99,27 +99,27 @@ package spine.animation {
 					}
 				}
 				return;
-			}						
+			}
 
 			deformArray.length = vertexCount;
 			deform = deformArray;
-			var n : int;			
+			var n : int;
 			var setup : Number, prev : Number;
 			if (time >= frames[frames.length - 1]) { // Time is after last frame.
 				var lastVertices : Vector.<Number> = frameVertices[frames.length - 1];
 				if (alpha == 1) {
 					if (blend == MixBlend.add) {
 						vertexAttachment = VertexAttachment(slotAttachment);
-						if (vertexAttachment.bones == null) {							
+						if (vertexAttachment.bones == null) {
 							setupVertices = vertexAttachment.vertices;
-							for (i = 0; i < vertexCount; i++) {								
+							for (i = 0; i < vertexCount; i++) {
 								deform[i] += lastVertices[i] - setupVertices[i];
 							}
-						} else {							
+						} else {
 							for (i = 0; i < vertexCount; i++)
 								deform[i] += lastVertices[i];
 						}
-					} else {						
+					} else {
 						for (i = 0, n = vertexCount; i < n; i++)
 							deform[i] = lastVertices[i];
 					}
@@ -146,16 +146,16 @@ package spine.animation {
 								deform[i] += (lastVertices[i] - deform[i]) * alpha;
 						case MixBlend.add:
 							vertexAttachment = VertexAttachment(slotAttachment);
-							if (vertexAttachment.bones == null) {								
+							if (vertexAttachment.bones == null) {
 								setupVertices = vertexAttachment.vertices;
-								for (i = 0; i < vertexCount; i++) {									
+								for (i = 0; i < vertexCount; i++) {
 									deform[i] += (lastVertices[i] - setupVertices[i]) * alpha;
 								}
 							} else {
 								for (i = 0; i < vertexCount; i++)
 									deform[i] += lastVertices[i] * alpha;
-							}							
-					}					
+							}
+					}
 				}
 				return;
 			}
@@ -170,20 +170,20 @@ package spine.animation {
 			if (alpha == 1) {
 				if (blend == MixBlend.add) {
 					vertexAttachment = VertexAttachment(slotAttachment);
-					if (vertexAttachment.bones == null) {						
+					if (vertexAttachment.bones == null) {
 						setupVertices = vertexAttachment.vertices;
 						for (i = 0; i < vertexCount; i++) {
 							prev = prevVertices[i];
 							deform[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i];
 						}
-					} else {						
+					} else {
 						for (i = 0; i < vertexCount; i++) {
-							prev = prevVertices[i];					
+							prev = prevVertices[i];
 							deform[i] += prev + (nextVertices[i] - prev) * percent;
 						}
 					}
-				} else {					
-					for (i = 0; i < vertexCount; i++) {						
+				} else {
+					for (i = 0; i < vertexCount; i++) {
 						prev = prevVertices[i];
 						deform[i] = prev + (nextVertices[i] - prev) * percent;
 					}
@@ -216,19 +216,19 @@ package spine.animation {
 						break;
 					case MixBlend.add:
 						vertexAttachment = VertexAttachment(slotAttachment);
-						if (vertexAttachment.bones == null) {							
+						if (vertexAttachment.bones == null) {
 							setupVertices = vertexAttachment.vertices;
 							for (i = 0; i < vertexCount; i++) {
 								prev = prevVertices[i], setup = setupVertices[i];
 								deform[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha;
 							}
-						} else {							
+						} else {
 							for (i = 0; i < vertexCount; i++) {
 								prev = prevVertices[i];
 								deform[i] += (prev + (nextVertices[i] - prev) * percent) * alpha;
 							}
 						}
-				}				
+				}
 			}
 		}
 	}

+ 3 - 3
spine-as3/spine-as3/src/spine/animation/IkConstraintTimeline.as

@@ -94,7 +94,7 @@ package spine.animation {
 						constraint.bendDirection = int(frames[frames.length + PREV_BEND_DIRECTION]);
 						constraint.compress = int(frames[frames.length + PREV_COMPRESS]) != 0;
 						constraint.stretch = int(frames[frames.length + PREV_STRETCH]) != 0;
-					}					
+					}
 				} else {
 					constraint.mix += (frames[frames.length + PREV_MIX] - constraint.mix) * alpha;
 					constraint.softness += (frames[frames.length + PREV_SOFTNESS] - constraint.softness) * alpha;
@@ -121,12 +121,12 @@ package spine.animation {
 				if (direction == MixDirection.Out) {
 					constraint.bendDirection = constraint.data.bendDirection;
 					constraint.compress = constraint.data.compress;
-					constraint.stretch = constraint.data.stretch;	
+					constraint.stretch = constraint.data.stretch;
 				} else {
 					constraint.bendDirection = int(frames[frame + PREV_BEND_DIRECTION]);
 					constraint.compress = int(frames[frame + PREV_COMPRESS]) != 0;
 					constraint.stretch = int(frames[frame + PREV_STRETCH]) != 0;
-				}				
+				}
 			} else {
 				constraint.mix += (mix + (frames[frame + MIX] - mix) * percent - constraint.mix) * alpha;
 				constraint.softness += (softness + (frames[frame + SOFTNESS] - softness) * percent - constraint.softness) * alpha;

+ 1 - 1
spine-as3/spine-as3/src/spine/animation/MixDirection.as

@@ -36,6 +36,6 @@ package spine.animation {
 		}
 
 		public static const In : MixDirection = new MixDirection(0);
-		public static const Out : MixDirection = new MixDirection(1);		
+		public static const Out : MixDirection = new MixDirection(1);
 	}
 }

+ 5 - 5
spine-as3/spine-as3/src/spine/animation/RotateTimeline.as

@@ -85,7 +85,7 @@ package spine.animation {
 						r -= (16384 - int((16384.499999999996 - r / 360))) * 360; // Wrap within -180 and 180.
 					case MixBlend.add:
 						bone.rotation += r * alpha;
-				}				
+				}
 				return;
 			}
 
@@ -96,16 +96,16 @@ package spine.animation {
 			var percent : Number = getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + PREV_TIME] - frameTime));
 
 			r = frames[frame + ROTATION] - prevRotation;
-			r = prevRotation + (r - (16384 - int((16384.499999999996 - r / 360))) * 360) * percent;			
+			r = prevRotation + (r - (16384 - int((16384.499999999996 - r / 360))) * 360) * percent;
 			switch (blend) {
-				case MixBlend.setup:					
+				case MixBlend.setup:
 					bone.rotation = bone.data.rotation + (r - (16384 - int((16384.499999999996 - r / 360))) * 360) * alpha;
 					break;
 				case MixBlend.first:
 				case MixBlend.replace:
-					r += bone.data.rotation - bone.rotation;					
+					r += bone.data.rotation - bone.rotation;
 				case MixBlend.add:
-					bone.rotation += (r - (16384 - int((16384.499999999996 - r / 360))) * 360) * alpha;	
+					bone.rotation += (r - (16384 - int((16384.499999999996 - r / 360))) * 360) * alpha;
 			}
 		}
 	}

+ 1 - 1
spine-as3/spine-as3/src/spine/animation/ScaleTimeline.as

@@ -78,7 +78,7 @@ package spine.animation {
 			if (alpha == 1) {
 				if (blend == MixBlend.add) {
 					bone.scaleX += x - bone.data.scaleX;
-					bone.scaleY += y - bone.data.scaleY;	
+					bone.scaleY += y - bone.data.scaleY;
 				} else {
 					bone.scaleX = x;
 					bone.scaleY = y;

+ 1 - 1
spine-as3/spine-as3/src/spine/animation/TrackEntry.as

@@ -77,7 +77,7 @@ package spine.animation {
 			timelineMode.length = 0;
 			timelineHoldMix.length = 0;
 			timelinesRotation.length = 0;
-		}		
+		}
 
 		public function resetRotationDirection() : void {
 			timelinesRotation.length = 0;

+ 1 - 1
spine-c/spine-c-unit-tests/README.md

@@ -25,7 +25,7 @@ Depending on the test agent build environment, you should build the output solut
 
 ### Test Runner Build Step
 This build step should not execute if the previous step did not successfully complete.
-Again, depending on the test agent build environment, you should have produced an executable.  Run this executable. 
+Again, depending on the test agent build environment, you should have produced an executable.  Run this executable.
 
 
 ## Usage

+ 1 - 1
spine-c/spine-c-unit-tests/main.cpp

@@ -62,7 +62,7 @@ int main(int argc, char* argv[])
 
 
 
-extern "C" { // probably unnecessary 
+extern "C" { // probably unnecessary
 
 	void _spAtlasPage_createTexture(spAtlasPage* self, const char* path) {
 		self->rendererObject = 0;

+ 2 - 2
spine-c/spine-c/include/spine/Array.h

@@ -81,8 +81,8 @@ extern "C" {
 	} \
 	void name##_add(name* self, itemType value) { \
 		if (self->size == self->capacity) { \
-            self->capacity = MAX(8, (int)(self->size * 1.75f)); \
-            self->items = REALLOC(self->items, itemType, self->capacity); \
+			self->capacity = MAX(8, (int)(self->size * 1.75f)); \
+			self->items = REALLOC(self->items, itemType, self->capacity); \
 		} \
 		self->items[self->size++] = value; \
 	} \

+ 3 - 3
spine-c/spine-c/include/spine/AttachmentLoader.h

@@ -45,9 +45,9 @@ typedef struct spAttachmentLoader {
 	const void* const vtable;
 #ifdef __cplusplus
 	spAttachmentLoader () :
-					error1(0),
-					error2(0),
-					vtable(0) {
+		error1(0),
+		error2(0),
+		vtable(0) {
 	}
 #endif
 } spAttachmentLoader;

+ 1 - 1
spine-c/spine-c/include/spine/Skin.h

@@ -89,7 +89,7 @@ struct _SkinHashTableEntry {
 typedef struct {
 	spSkin super;
 	_Entry* entries; /* entries list stored for getting attachment name by attachment index */
-	_SkinHashTableEntry* entriesHashTable[SKIN_ENTRIES_HASH_TABLE_SIZE];  /* hashtable for fast attachment lookup */
+	_SkinHashTableEntry* entriesHashTable[SKIN_ENTRIES_HASH_TABLE_SIZE]; /* hashtable for fast attachment lookup */
 } _spSkin;
 
 SP_API spSkin* spSkin_create (const char* name);

+ 1 - 1
spine-c/spine-c/include/spine/VertexEffect.h

@@ -43,7 +43,7 @@ struct spVertexEffect;
 typedef void (*spVertexEffectBegin)(struct spVertexEffect *self, spSkeleton *skeleton);
 
 typedef void (*spVertexEffectTransform)(struct spVertexEffect *self, float *x, float *y, float *u, float *v,
-										spColor *light, spColor *dark);
+	spColor *light, spColor *dark);
 
 typedef void (*spVertexEffectEnd)(struct spVertexEffect *self);
 

+ 243 - 217
spine-c/spine-c/src/spine/Animation.c

@@ -50,7 +50,8 @@ void spAnimation_dispose (spAnimation* self) {
 }
 
 void spAnimation_apply (const spAnimation* self, spSkeleton* skeleton, float lastTime, float time, int loop, spEvent** events,
-		int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	int i, n = self->timelinesCount;
 
 	if (loop && self->duration) {
@@ -66,15 +67,17 @@ void spAnimation_apply (const spAnimation* self, spSkeleton* skeleton, float las
 
 typedef struct _spTimelineVtable {
 	void (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
-			int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction);
+		int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction);
 	int (*getPropertyId) (const spTimeline* self);
 	void (*dispose) (spTimeline* self);
 } _spTimelineVtable;
 
 void _spTimeline_init (spTimeline* self, spTimelineType type, /**/
-					   void (*dispose) (spTimeline* self), /**/
-					   void (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction),
-					   int (*getPropertyId) (const spTimeline* self)) {
+	void (*dispose) (spTimeline* self), /**/
+	void (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
+		int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction),
+	int (*getPropertyId) (const spTimeline* self)
+) {
 	CONST_CAST(spTimelineType, self->type) = type;
 	CONST_CAST(_spTimelineVtable*, self->vtable) = NEW(_spTimelineVtable);
 	VTABLE(spTimeline, self)->dispose = dispose;
@@ -105,9 +108,11 @@ static const float CURVE_LINEAR = 0, CURVE_STEPPED = 1, CURVE_BEZIER = 2;
 static const int BEZIER_SIZE = 10 * 2 - 1;
 
 void _spCurveTimeline_init (spCurveTimeline* self, spTimelineType type, int framesCount, /**/
-		void (*dispose) (spTimeline* self), /**/
-		void (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction),
-		int (*getPropertyId)(const spTimeline* self)) {
+	void (*dispose) (spTimeline* self), /**/
+	void (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
+		int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction),
+	int (*getPropertyId)(const spTimeline* self)
+) {
 	_spTimeline_init(SUPER(self), type, dispose, apply, getPropertyId);
 	self->curves = CALLOC(float, (framesCount - 1) * BEZIER_SIZE);
 }
@@ -223,9 +228,10 @@ void _spBaseTimeline_dispose (spTimeline* timeline) {
 
 /* Many timelines have structure identical to struct spBaseTimeline and extend spCurveTimeline. **/
 struct spBaseTimeline* _spBaseTimeline_create (int framesCount, spTimelineType type, int frameSize, /**/
-		void (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
-				int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction),
-		int (*getPropertyId) (const spTimeline* self)) {
+	void (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
+		int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction),
+	int (*getPropertyId) (const spTimeline* self)
+) {
 	struct spBaseTimeline* self = NEW(struct spBaseTimeline);
 	_spCurveTimeline_init(SUPER(self), type, framesCount, _spBaseTimeline_dispose, apply, getPropertyId);
 
@@ -238,7 +244,8 @@ struct spBaseTimeline* _spBaseTimeline_create (int framesCount, spTimelineType t
 /**/
 
 void _spRotateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
-		int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	spBone *bone;
 	int frame;
 	float prevRotation, frameTime, percent, r;
@@ -248,16 +255,16 @@ void _spRotateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
 	if (!bone->active) return;
 	if (time < self->frames[0]) {
 		switch (blend) {
-			case SP_MIX_BLEND_SETUP:
-				bone->rotation = bone->data->rotation;
-				return;
-			case SP_MIX_BLEND_FIRST:
-				r = bone->data->rotation - bone->rotation;
-				r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360;
-				bone->rotation += r * alpha;
-			case SP_MIX_BLEND_REPLACE:
-			case SP_MIX_BLEND_ADD:
-				; /* to appease compiler */
+		case SP_MIX_BLEND_SETUP:
+			bone->rotation = bone->data->rotation;
+			return;
+		case SP_MIX_BLEND_FIRST:
+			r = bone->data->rotation - bone->rotation;
+			r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360;
+			bone->rotation += r * alpha;
+		case SP_MIX_BLEND_REPLACE:
+		case SP_MIX_BLEND_ADD:
+			; /* to appease compiler */
 		}
 		return;
 	}
@@ -265,15 +272,15 @@ void _spRotateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
 	if (time >= self->frames[self->framesCount - ROTATE_ENTRIES]) { /* Time is after last frame. */
 		r = self->frames[self->framesCount + ROTATE_PREV_ROTATION];
 		switch (blend) {
-			case SP_MIX_BLEND_SETUP:
-				bone->rotation = bone->data->rotation + r * alpha;
-				break;
-			case SP_MIX_BLEND_FIRST:
-			case SP_MIX_BLEND_REPLACE:
-				r += bone->data->rotation - bone->rotation;
-				r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360; /* Wrap within -180 and 180. */
-			case SP_MIX_BLEND_ADD:
-				bone->rotation += r * alpha;
+		case SP_MIX_BLEND_SETUP:
+			bone->rotation = bone->data->rotation + r * alpha;
+			break;
+		case SP_MIX_BLEND_FIRST:
+		case SP_MIX_BLEND_REPLACE:
+			r += bone->data->rotation - bone->rotation;
+			r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360; /* Wrap within -180 and 180. */
+		case SP_MIX_BLEND_ADD:
+			bone->rotation += r * alpha;
 		}
 		return;
 	}
@@ -287,14 +294,14 @@ void _spRotateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
 	r = self->frames[frame + ROTATE_ROTATION] - prevRotation;
 	r = prevRotation + (r - (16384 - (int)(16384.499999999996 - r / 360)) * 360) * percent;
 	switch (blend) {
-		case SP_MIX_BLEND_SETUP:
-			bone->rotation = bone->data->rotation + (r - (16384 - (int)(16384.499999999996 - r / 360)) * 360) * alpha;
-			break;
-		case SP_MIX_BLEND_FIRST:
-		case SP_MIX_BLEND_REPLACE:
-			r += bone->data->rotation - bone->rotation;
-		case SP_MIX_BLEND_ADD:
-			bone->rotation += (r - (16384 - (int)(16384.499999999996 - r / 360)) * 360) * alpha;
+	case SP_MIX_BLEND_SETUP:
+		bone->rotation = bone->data->rotation + (r - (16384 - (int)(16384.499999999996 - r / 360)) * 360) * alpha;
+		break;
+	case SP_MIX_BLEND_FIRST:
+	case SP_MIX_BLEND_REPLACE:
+		r += bone->data->rotation - bone->rotation;
+	case SP_MIX_BLEND_ADD:
+		bone->rotation += (r - (16384 - (int)(16384.499999999996 - r / 360)) * 360) * alpha;
 	}
 
 	UNUSED(lastTime);
@@ -323,7 +330,8 @@ static const int TRANSLATE_PREV_TIME = -3, TRANSLATE_PREV_X = -2, TRANSLATE_PREV
 static const int TRANSLATE_X = 1, TRANSLATE_Y = 2;
 
 void _spTranslateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,
-		spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	spBone *bone;
 	int frame;
 	float frameTime, percent;
@@ -337,16 +345,16 @@ void _spTranslateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleto
 	if (!bone->active) return;
 	if (time < self->frames[0]) {
 		switch (blend) {
-			case SP_MIX_BLEND_SETUP:
-				bone->x = bone->data->x;
-				bone->y = bone->data->y;
-				return;
-			case SP_MIX_BLEND_FIRST:
-				bone->x += (bone->data->x - bone->x) * alpha;
-				bone->y += (bone->data->y - bone->y) * alpha;
-			case SP_MIX_BLEND_REPLACE:
-			case SP_MIX_BLEND_ADD:
-				; /* to appease compiler */
+		case SP_MIX_BLEND_SETUP:
+			bone->x = bone->data->x;
+			bone->y = bone->data->y;
+			return;
+		case SP_MIX_BLEND_FIRST:
+			bone->x += (bone->data->x - bone->x) * alpha;
+			bone->y += (bone->data->y - bone->y) * alpha;
+		case SP_MIX_BLEND_REPLACE:
+		case SP_MIX_BLEND_ADD:
+			; /* to appease compiler */
 		}
 		return;
 	}
@@ -363,24 +371,24 @@ void _spTranslateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleto
 		y = frames[frame + TRANSLATE_PREV_Y];
 		frameTime = frames[frame];
 		percent = spCurveTimeline_getCurvePercent(SUPER(self), frame / TRANSLATE_ENTRIES - 1,
-										1 - (time - frameTime) / (frames[frame + TRANSLATE_PREV_TIME] - frameTime));
+			1 - (time - frameTime) / (frames[frame + TRANSLATE_PREV_TIME] - frameTime));
 
 		x += (frames[frame + TRANSLATE_X] - x) * percent;
 		y += (frames[frame + TRANSLATE_Y] - y) * percent;
 	}
 	switch (blend) {
-		case SP_MIX_BLEND_SETUP:
-			bone->x = bone->data->x + x * alpha;
-			bone->y = bone->data->y + y * alpha;
-			break;
-		case SP_MIX_BLEND_FIRST:
-		case SP_MIX_BLEND_REPLACE:
-			bone->x += (bone->data->x + x - bone->x) * alpha;
-			bone->y += (bone->data->y + y - bone->y) * alpha;
-			break;
-		case SP_MIX_BLEND_ADD:
-			bone->x += x * alpha;
-			bone->y += y * alpha;
+	case SP_MIX_BLEND_SETUP:
+		bone->x = bone->data->x + x * alpha;
+		bone->y = bone->data->y + y * alpha;
+		break;
+	case SP_MIX_BLEND_FIRST:
+	case SP_MIX_BLEND_REPLACE:
+		bone->x += (bone->data->x + x - bone->x) * alpha;
+		bone->y += (bone->data->y + y - bone->y) * alpha;
+		break;
+	case SP_MIX_BLEND_ADD:
+		bone->x += x * alpha;
+		bone->y += y * alpha;
 	}
 
 	UNUSED(lastTime);
@@ -407,7 +415,8 @@ void spTranslateTimeline_setFrame (spTranslateTimeline* self, int frameIndex, fl
 /**/
 
 void _spScaleTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
-		int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	spBone *bone;
 	int frame;
 	float frameTime, percent, x, y;
@@ -420,16 +429,16 @@ void _spScaleTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
 	if (!bone->active) return;
 	if (time < self->frames[0]) {
 		switch (blend) {
-			case SP_MIX_BLEND_SETUP:
-				bone->scaleX = bone->data->scaleX;
-				bone->scaleY = bone->data->scaleY;
-				return;
-			case SP_MIX_BLEND_FIRST:
-				bone->scaleX += (bone->data->scaleX - bone->scaleX) * alpha;
-				bone->scaleY += (bone->data->scaleY - bone->scaleY) * alpha;
-			case SP_MIX_BLEND_REPLACE:
-			case SP_MIX_BLEND_ADD:
-				; /* to appease compiler */
+		case SP_MIX_BLEND_SETUP:
+			bone->scaleX = bone->data->scaleX;
+			bone->scaleY = bone->data->scaleY;
+			return;
+		case SP_MIX_BLEND_FIRST:
+			bone->scaleX += (bone->data->scaleX - bone->scaleX) * alpha;
+			bone->scaleY += (bone->data->scaleY - bone->scaleY) * alpha;
+		case SP_MIX_BLEND_REPLACE:
+		case SP_MIX_BLEND_ADD:
+			; /* to appease compiler */
 		}
 		return;
 	}
@@ -446,7 +455,7 @@ void _spScaleTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
 		y = frames[frame + TRANSLATE_PREV_Y];
 		frameTime = frames[frame];
 		percent = spCurveTimeline_getCurvePercent(SUPER(self), frame / TRANSLATE_ENTRIES - 1,
-										1 - (time - frameTime) / (frames[frame + TRANSLATE_PREV_TIME] - frameTime));
+			1 - (time - frameTime) / (frames[frame + TRANSLATE_PREV_TIME] - frameTime));
 
 		x = (x + (frames[frame + TRANSLATE_X] - x) * percent) * bone->data->scaleX;
 		y = (y + (frames[frame + TRANSLATE_Y] - y) * percent) * bone->data->scaleY;
@@ -463,45 +472,45 @@ void _spScaleTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
 		float bx, by;
 		if (direction == SP_MIX_DIRECTION_OUT) {
 			switch (blend) {
-				case SP_MIX_BLEND_SETUP:
-					bx = bone->data->scaleX;
-					by = bone->data->scaleY;
-					bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bx) * alpha;
-					bone->scaleY = by + (ABS(y) * SIGNUM(by) - by) * alpha;
-					break;
-				case SP_MIX_BLEND_FIRST:
-				case SP_MIX_BLEND_REPLACE:
-					bx = bone->scaleX;
-					by = bone->scaleY;
-					bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bx) * alpha;
-					bone->scaleY = by + (ABS(y) * SIGNUM(by) - by) * alpha;
-					break;
-				case SP_MIX_BLEND_ADD:
-					bx = bone->scaleX;
-					by = bone->scaleY;
-					bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bone->data->scaleX) * alpha;
-					bone->scaleY = by + (ABS(y) * SIGNUM(by) - bone->data->scaleY) * alpha;
+			case SP_MIX_BLEND_SETUP:
+				bx = bone->data->scaleX;
+				by = bone->data->scaleY;
+				bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bx) * alpha;
+				bone->scaleY = by + (ABS(y) * SIGNUM(by) - by) * alpha;
+				break;
+			case SP_MIX_BLEND_FIRST:
+			case SP_MIX_BLEND_REPLACE:
+				bx = bone->scaleX;
+				by = bone->scaleY;
+				bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bx) * alpha;
+				bone->scaleY = by + (ABS(y) * SIGNUM(by) - by) * alpha;
+				break;
+			case SP_MIX_BLEND_ADD:
+				bx = bone->scaleX;
+				by = bone->scaleY;
+				bone->scaleX = bx + (ABS(x) * SIGNUM(bx) - bone->data->scaleX) * alpha;
+				bone->scaleY = by + (ABS(y) * SIGNUM(by) - bone->data->scaleY) * alpha;
 			}
 		} else {
 			switch (blend) {
-				case SP_MIX_BLEND_SETUP:
-					bx = ABS(bone->data->scaleX) * SIGNUM(x);
-					by = ABS(bone->data->scaleY) * SIGNUM(y);
-					bone->scaleX = bx + (x - bx) * alpha;
-					bone->scaleY = by + (y - by) * alpha;
-					break;
-				case SP_MIX_BLEND_FIRST:
-				case SP_MIX_BLEND_REPLACE:
-					bx = ABS(bone->scaleX) * SIGNUM(x);
-					by = ABS(bone->scaleY) * SIGNUM(y);
-					bone->scaleX = bx + (x - bx) * alpha;
-					bone->scaleY = by + (y - by) * alpha;
-					break;
-				case SP_MIX_BLEND_ADD:
-					bx = SIGNUM(x);
-					by = SIGNUM(y);
-					bone->scaleX = ABS(bone->scaleX) * bx + (x - ABS(bone->data->scaleX) * bx) * alpha;
-					bone->scaleY = ABS(bone->scaleY) * by + (y - ABS(bone->data->scaleY) * by) * alpha;
+			case SP_MIX_BLEND_SETUP:
+				bx = ABS(bone->data->scaleX) * SIGNUM(x);
+				by = ABS(bone->data->scaleY) * SIGNUM(y);
+				bone->scaleX = bx + (x - bx) * alpha;
+				bone->scaleY = by + (y - by) * alpha;
+				break;
+			case SP_MIX_BLEND_FIRST:
+			case SP_MIX_BLEND_REPLACE:
+				bx = ABS(bone->scaleX) * SIGNUM(x);
+				by = ABS(bone->scaleY) * SIGNUM(y);
+				bone->scaleX = bx + (x - bx) * alpha;
+				bone->scaleY = by + (y - by) * alpha;
+				break;
+			case SP_MIX_BLEND_ADD:
+				bx = SIGNUM(x);
+				by = SIGNUM(y);
+				bone->scaleX = ABS(bone->scaleX) * bx + (x - ABS(bone->data->scaleX) * bx) * alpha;
+				bone->scaleY = ABS(bone->scaleY) * by + (y - ABS(bone->data->scaleY) * by) * alpha;
 			}
 		}
 	}
@@ -526,7 +535,8 @@ void spScaleTimeline_setFrame (spScaleTimeline* self, int frameIndex, float time
 /**/
 
 void _spShearTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
-							 int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	spBone *bone;
 	int frame;
 	float frameTime, percent, x, y;
@@ -541,16 +551,16 @@ void _spShearTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
 	framesCount = self->framesCount;
 	if (time < self->frames[0]) {
 		switch (blend) {
-			case SP_MIX_BLEND_SETUP:
-				bone->shearX = bone->data->shearX;
-				bone->shearY = bone->data->shearY;
-				return;
-			case SP_MIX_BLEND_FIRST:
-				bone->shearX += (bone->data->shearX - bone->shearX) * alpha;
-				bone->shearY += (bone->data->shearY - bone->shearY) * alpha;
-			case SP_MIX_BLEND_REPLACE:
-			case SP_MIX_BLEND_ADD:
-				; /* to appease compiler */
+		case SP_MIX_BLEND_SETUP:
+			bone->shearX = bone->data->shearX;
+			bone->shearY = bone->data->shearY;
+			return;
+		case SP_MIX_BLEND_FIRST:
+			bone->shearX += (bone->data->shearX - bone->shearX) * alpha;
+			bone->shearY += (bone->data->shearY - bone->shearY) * alpha;
+		case SP_MIX_BLEND_REPLACE:
+		case SP_MIX_BLEND_ADD:
+			; /* to appease compiler */
 		}
 		return;
 	}
@@ -565,24 +575,24 @@ void _spShearTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
 		y = frames[frame + TRANSLATE_PREV_Y];
 		frameTime = frames[frame];
 		percent = spCurveTimeline_getCurvePercent(SUPER(self), frame / TRANSLATE_ENTRIES - 1,
-										1 - (time - frameTime) / (frames[frame + TRANSLATE_PREV_TIME] - frameTime));
+			1 - (time - frameTime) / (frames[frame + TRANSLATE_PREV_TIME] - frameTime));
 
 		x = x + (frames[frame + TRANSLATE_X] - x) * percent;
 		y = y + (frames[frame + TRANSLATE_Y] - y) * percent;
 	}
 	switch (blend) {
-		case SP_MIX_BLEND_SETUP:
-			bone->shearX = bone->data->shearX + x * alpha;
-			bone->shearY = bone->data->shearY + y * alpha;
-			break;
-		case SP_MIX_BLEND_FIRST:
-		case SP_MIX_BLEND_REPLACE:
-			bone->shearX += (bone->data->shearX + x - bone->shearX) * alpha;
-			bone->shearY += (bone->data->shearY + y - bone->shearY) * alpha;
-			break;
-		case SP_MIX_BLEND_ADD:
-			bone->shearX += x * alpha;
-			bone->shearY += y * alpha;
+	case SP_MIX_BLEND_SETUP:
+		bone->shearX = bone->data->shearX + x * alpha;
+		bone->shearY = bone->data->shearY + y * alpha;
+		break;
+	case SP_MIX_BLEND_FIRST:
+	case SP_MIX_BLEND_REPLACE:
+		bone->shearX += (bone->data->shearX + x - bone->shearX) * alpha;
+		bone->shearY += (bone->data->shearY + y - bone->shearY) * alpha;
+		break;
+	case SP_MIX_BLEND_ADD:
+		bone->shearX += x * alpha;
+		bone->shearY += y * alpha;
 	}
 
 	UNUSED(lastTime);
@@ -609,7 +619,8 @@ static const int COLOR_PREV_TIME = -5, COLOR_PREV_R = -4, COLOR_PREV_G = -3, COL
 static const int COLOR_R = 1, COLOR_G = 2, COLOR_B = 3, COLOR_A = 4;
 
 void _spColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
-		int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	spSlot *slot;
 	int frame;
 	float percent, frameTime;
@@ -622,17 +633,17 @@ void _spColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
 
 	if (time < self->frames[0]) {
 		switch (blend) {
-			case SP_MIX_BLEND_SETUP:
-				spColor_setFromColor(&slot->color, &slot->data->color);
-				return;
-			case SP_MIX_BLEND_FIRST:
-				color = &slot->color;
-				setup = &slot->data->color;
-				spColor_addFloats(color, (setup->r - color->r) * alpha, (setup->g - color->g) * alpha, (setup->b - color->b) * alpha,
-						  (setup->a - color->a) * alpha);
-			case SP_MIX_BLEND_REPLACE:
-			case SP_MIX_BLEND_ADD:
-				; /* to appease compiler */
+		case SP_MIX_BLEND_SETUP:
+			spColor_setFromColor(&slot->color, &slot->data->color);
+			return;
+		case SP_MIX_BLEND_FIRST:
+			color = &slot->color;
+			setup = &slot->data->color;
+			spColor_addFloats(color, (setup->r - color->r) * alpha, (setup->g - color->g) * alpha, (setup->b - color->b) * alpha,
+				(setup->a - color->a) * alpha);
+		case SP_MIX_BLEND_REPLACE:
+		case SP_MIX_BLEND_ADD:
+			; /* to appease compiler */
 		}
 		return;
 	}
@@ -664,9 +675,7 @@ void _spColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
 	if (alpha == 1) {
 		spColor_setFromFloats(&slot->color, r, g, b, a);
 	} else {
-		if (blend == SP_MIX_BLEND_SETUP) {
-			spColor_setFromColor(&slot->color, &slot->data->color);
-		}
+		if (blend == SP_MIX_BLEND_SETUP) spColor_setFromColor(&slot->color, &slot->data->color);
 		spColor_addFloats(&slot->color, (r - slot->color.r) * alpha, (g - slot->color.g) * alpha, (b - slot->color.b) * alpha, (a - slot->color.a) * alpha);
 	}
 
@@ -700,7 +709,8 @@ static const int TWOCOLOR_PREV_R2 = -3, TWOCOLOR_PREV_G2 = -2, TWOCOLOR_PREV_B2
 static const int TWOCOLOR_R = 1, TWOCOLOR_G = 2, TWOCOLOR_B = 3, TWOCOLOR_A = 4, TWOCOLOR_R2 = 5, TWOCOLOR_G2 = 6, TWOCOLOR_B2 = 7;
 
 void _spTwoColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
-							 int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	spSlot *slot;
 	int frame;
 	float percent, frameTime;
@@ -715,21 +725,21 @@ void _spTwoColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton
 
 	if (time < self->frames[0]) {
 		switch (blend) {
-			case SP_MIX_BLEND_SETUP:
-				spColor_setFromColor(&slot->color, &slot->data->color);
-				spColor_setFromColor(slot->darkColor, slot->data->darkColor);
-				return;
-			case SP_MIX_BLEND_FIRST:
-				light = &slot->color;
-				dark = slot->darkColor;
-				setupLight = &slot->data->color;
-				setupDark = slot->data->darkColor;
-				spColor_addFloats(light, (setupLight->r - light->r) * alpha, (setupLight->g - light->g) * alpha, (setupLight->b - light->b) * alpha,
-						  (setupLight->a - light->a) * alpha);
-				spColor_addFloats(dark, (setupDark->r - dark->r) * alpha, (setupDark->g - dark->g) * alpha, (setupDark->b - dark->b) * alpha, 0);
-			case SP_MIX_BLEND_REPLACE:
-			case SP_MIX_BLEND_ADD:
-					; /* to appease compiler */
+		case SP_MIX_BLEND_SETUP:
+			spColor_setFromColor(&slot->color, &slot->data->color);
+			spColor_setFromColor(slot->darkColor, slot->data->darkColor);
+			return;
+		case SP_MIX_BLEND_FIRST:
+			light = &slot->color;
+			dark = slot->darkColor;
+			setupLight = &slot->data->color;
+			setupDark = slot->data->darkColor;
+			spColor_addFloats(light, (setupLight->r - light->r) * alpha, (setupLight->g - light->g) * alpha, (setupLight->b - light->b) * alpha,
+				(setupLight->a - light->a) * alpha);
+			spColor_addFloats(dark, (setupDark->r - dark->r) * alpha, (setupDark->g - dark->g) * alpha, (setupDark->b - dark->b) * alpha, 0);
+		case SP_MIX_BLEND_REPLACE:
+		case SP_MIX_BLEND_ADD:
+			; /* to appease compiler */
 		}
 		return;
 	}
@@ -757,7 +767,7 @@ void _spTwoColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton
 
 		frameTime = self->frames[frame];
 		percent = spCurveTimeline_getCurvePercent(SUPER(self), frame / TWOCOLOR_ENTRIES - 1,
-												  1 - (time - frameTime) / (self->frames[frame + TWOCOLOR_PREV_TIME] - frameTime));
+			1 - (time - frameTime) / (self->frames[frame + TWOCOLOR_PREV_TIME] - frameTime));
 
 		r += (self->frames[frame + TWOCOLOR_R] - r) * percent;
 		g += (self->frames[frame + TWOCOLOR_G] - g) * percent;
@@ -819,7 +829,7 @@ void _spAttachmentTimeline_apply (const spTimeline* timeline, spSkeleton* skelet
 
 	if (direction == SP_MIX_DIRECTION_OUT && blend == SP_MIX_BLEND_SETUP) {
 		attachmentName = slot->data->attachmentName;
-        spSlot_setAttachment(slot, attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
+		spSlot_setAttachment(slot, attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
 		return;
 	}
 
@@ -827,7 +837,7 @@ void _spAttachmentTimeline_apply (const spTimeline* timeline, spSkeleton* skelet
 		if (blend == SP_MIX_BLEND_SETUP || blend == SP_MIX_BLEND_FIRST) {
 			attachmentName = slot->data->attachmentName;
 			spSlot_setAttachment(skeleton->slots[self->slotIndex],
-								 attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
+				attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
 		}
 		return;
 	}
@@ -839,7 +849,7 @@ void _spAttachmentTimeline_apply (const spTimeline* timeline, spSkeleton* skelet
 
 	attachmentName = self->attachmentNames[frameIndex];
 	spSlot_setAttachment(skeleton->slots[self->slotIndex],
-			attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
+		attachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);
 
 	UNUSED(lastTime);
 	UNUSED(firedEvents);
@@ -888,7 +898,8 @@ void spAttachmentTimeline_setFrame (spAttachmentTimeline* self, int frameIndex,
 /**/
 
 void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
-							  int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	int frame, i, vertexCount;
 	float percent, frameTime;
 	const float* prevVertices;
@@ -1053,42 +1064,42 @@ void _spDeformTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton,
 	} else {
 		spVertexAttachment* vertexAttachment;
 		switch (blend) {
-			case SP_MIX_BLEND_SETUP:
-				vertexAttachment = SUB_CAST(spVertexAttachment, slot->attachment);
-				if (!vertexAttachment->bones) {
-					float *setupVertices = vertexAttachment->vertices;
-					for (i = 0; i < vertexCount; i++) {
-						float prev = prevVertices[i], setup = setupVertices[i];
-						deformArray[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha;
-					}
-				} else {
-					for (i = 0; i < vertexCount; i++) {
-						float prev = prevVertices[i];
-						deformArray[i] = (prev + (nextVertices[i] - prev) * percent) * alpha;
-					}
+		case SP_MIX_BLEND_SETUP:
+			vertexAttachment = SUB_CAST(spVertexAttachment, slot->attachment);
+			if (!vertexAttachment->bones) {
+				float *setupVertices = vertexAttachment->vertices;
+				for (i = 0; i < vertexCount; i++) {
+					float prev = prevVertices[i], setup = setupVertices[i];
+					deformArray[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha;
 				}
-				break;
-			case SP_MIX_BLEND_FIRST:
-			case SP_MIX_BLEND_REPLACE:
+			} else {
 				for (i = 0; i < vertexCount; i++) {
 					float prev = prevVertices[i];
-					deformArray[i] += (prev + (nextVertices[i] - prev) * percent - deformArray[i]) * alpha;
+					deformArray[i] = (prev + (nextVertices[i] - prev) * percent) * alpha;
 				}
-				break;
-			case SP_MIX_BLEND_ADD:
-				vertexAttachment = SUB_CAST(spVertexAttachment, slot->attachment);
-				if (!vertexAttachment->bones) {
-					float *setupVertices = vertexAttachment->vertices;
-					for (i = 0; i < vertexCount; i++) {
-						float prev = prevVertices[i];
-						deformArray[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha;
-					}
-				} else {
-					for (i = 0; i < vertexCount; i++) {
-						float prev = prevVertices[i];
-						deformArray[i] += (prev + (nextVertices[i] - prev) * percent) * alpha;
-					}
+			}
+			break;
+		case SP_MIX_BLEND_FIRST:
+		case SP_MIX_BLEND_REPLACE:
+			for (i = 0; i < vertexCount; i++) {
+				float prev = prevVertices[i];
+				deformArray[i] += (prev + (nextVertices[i] - prev) * percent - deformArray[i]) * alpha;
+			}
+			break;
+		case SP_MIX_BLEND_ADD:
+			vertexAttachment = SUB_CAST(spVertexAttachment, slot->attachment);
+			if (!vertexAttachment->bones) {
+				float *setupVertices = vertexAttachment->vertices;
+				for (i = 0; i < vertexCount; i++) {
+					float prev = prevVertices[i];
+					deformArray[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha;
 				}
+			} else {
+				for (i = 0; i < vertexCount; i++) {
+					float prev = prevVertices[i];
+					deformArray[i] += (prev + (nextVertices[i] - prev) * percent) * alpha;
+				}
+			}
 		}
 	}
 
@@ -1142,7 +1153,8 @@ void spDeformTimeline_setFrame (spDeformTimeline* self, int frameIndex, float ti
 
 /** Fires events for frames > lastTime and <= time. */
 void _spEventTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,
-		int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	spEventTimeline* self = (spEventTimeline*)timeline;
 	int frame;
 	if (!firedEvents) return;
@@ -1211,7 +1223,8 @@ void spEventTimeline_setFrame (spEventTimeline* self, int frameIndex, spEvent* e
 /**/
 
 void _spDrawOrderTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,
-		spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	int i;
 	int frame;
 	const int* drawOrderToSetupIndex;
@@ -1294,7 +1307,8 @@ static const int IKCONSTRAINT_PREV_TIME = -6, IKCONSTRAINT_PREV_MIX = -5, IKCONS
 static const int IKCONSTRAINT_MIX = 1, IKCONSTRAINT_SOFTNESS = 2, IKCONSTRAINT_BEND_DIRECTION = 3, IKCONSTRAINT_COMPRESS = 4, IKCONSTRAINT_STRETCH = 5;
 
 void _spIkConstraintTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,
-		spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	int frame;
 	float frameTime, percent, mix, softness;
 	float *frames;
@@ -1333,7 +1347,7 @@ void _spIkConstraintTimeline_apply (const spTimeline* timeline, spSkeleton* skel
 		if (blend == SP_MIX_BLEND_SETUP) {
 			constraint->mix = constraint->data->mix + (frames[framesCount + IKCONSTRAINT_PREV_MIX] - constraint->data->mix) * alpha;
 			constraint->softness = constraint->data->softness
-								  + (frames[framesCount + IKCONSTRAINT_PREV_SOFTNESS] - constraint->data->softness) * alpha;
+				+ (frames[framesCount + IKCONSTRAINT_PREV_SOFTNESS] - constraint->data->softness) * alpha;
 			if (direction == SP_MIX_DIRECTION_OUT) {
 				constraint->bendDirection = constraint->data->bendDirection;
 				constraint->compress = constraint->data->compress;
@@ -1365,7 +1379,7 @@ void _spIkConstraintTimeline_apply (const spTimeline* timeline, spSkeleton* skel
 	if (blend == SP_MIX_BLEND_SETUP) {
 		constraint->mix = constraint->data->mix + (mix + (frames[frame + IKCONSTRAINT_MIX] - mix) * percent - constraint->data->mix) * alpha;
 		constraint->softness = constraint->data->softness
-							  + (softness + (frames[frame + IKCONSTRAINT_SOFTNESS] - softness) * percent - constraint->data->softness) * alpha;
+			+ (softness + (frames[frame + IKCONSTRAINT_SOFTNESS] - softness) * percent - constraint->data->softness) * alpha;
 		if (direction == SP_MIX_DIRECTION_OUT) {
 			constraint->bendDirection = constraint->data->bendDirection;
 			constraint->compress = constraint->data->compress;
@@ -1398,7 +1412,9 @@ spIkConstraintTimeline* spIkConstraintTimeline_create (int framesCount) {
 	return (spIkConstraintTimeline*)_spBaseTimeline_create(framesCount, SP_TIMELINE_IKCONSTRAINT, IKCONSTRAINT_ENTRIES, _spIkConstraintTimeline_apply, _spIkConstraintTimeline_getPropertyId);
 }
 
-void spIkConstraintTimeline_setFrame (spIkConstraintTimeline* self, int frameIndex, float time, float mix, float softness, int bendDirection, int /*boolean*/ compress, int /*boolean*/ stretch) {
+void spIkConstraintTimeline_setFrame (spIkConstraintTimeline* self, int frameIndex, float time, float mix, float softness,
+	int bendDirection, int /*boolean*/ compress, int /*boolean*/ stretch
+) {
 	frameIndex *= IKCONSTRAINT_ENTRIES;
 	self->frames[frameIndex] = time;
 	self->frames[frameIndex + IKCONSTRAINT_MIX] = mix;
@@ -1420,7 +1436,8 @@ static const int TRANSFORMCONSTRAINT_SCALE = 3;
 static const int TRANSFORMCONSTRAINT_SHEAR = 4;
 
 void _spTransformConstraintTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,
-									spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	int frame;
 	float frameTime, percent, rotate, translate, scale, shear;
 	spTransformConstraint* constraint;
@@ -1501,10 +1518,13 @@ int _spTransformConstraintTimeline_getPropertyId (const spTimeline* timeline) {
 }
 
 spTransformConstraintTimeline* spTransformConstraintTimeline_create (int framesCount) {
-	return (spTransformConstraintTimeline*)_spBaseTimeline_create(framesCount, SP_TIMELINE_TRANSFORMCONSTRAINT, TRANSFORMCONSTRAINT_ENTRIES, _spTransformConstraintTimeline_apply, _spTransformConstraintTimeline_getPropertyId);
+	return (spTransformConstraintTimeline*)_spBaseTimeline_create(framesCount, SP_TIMELINE_TRANSFORMCONSTRAINT,
+		TRANSFORMCONSTRAINT_ENTRIES, _spTransformConstraintTimeline_apply, _spTransformConstraintTimeline_getPropertyId);
 }
 
-void spTransformConstraintTimeline_setFrame (spTransformConstraintTimeline* self, int frameIndex, float time, float rotateMix, float translateMix, float scaleMix, float shearMix) {
+void spTransformConstraintTimeline_setFrame (spTransformConstraintTimeline* self, int frameIndex, float time, float rotateMix,
+	float translateMix, float scaleMix, float shearMix
+) {
 	frameIndex *= TRANSFORMCONSTRAINT_ENTRIES;
 	self->frames[frameIndex] = time;
 	self->frames[frameIndex + TRANSFORMCONSTRAINT_ROTATE] = rotateMix;
@@ -1520,7 +1540,8 @@ static const int PATHCONSTRAINTPOSITION_PREV_VALUE = -1;
 static const int PATHCONSTRAINTPOSITION_VALUE = 1;
 
 void _spPathConstraintPositionTimeline_apply(const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,
-		spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	int frame;
 	float frameTime, percent, position;
 	spPathConstraint* constraint;
@@ -1575,7 +1596,8 @@ int _spPathConstraintPositionTimeline_getPropertyId (const spTimeline* timeline)
 }
 
 spPathConstraintPositionTimeline* spPathConstraintPositionTimeline_create (int framesCount) {
-	return (spPathConstraintPositionTimeline*)_spBaseTimeline_create(framesCount, SP_TIMELINE_PATHCONSTRAINTPOSITION, PATHCONSTRAINTPOSITION_ENTRIES, _spPathConstraintPositionTimeline_apply, _spPathConstraintPositionTimeline_getPropertyId);
+	return (spPathConstraintPositionTimeline*)_spBaseTimeline_create(framesCount, SP_TIMELINE_PATHCONSTRAINTPOSITION,
+		PATHCONSTRAINTPOSITION_ENTRIES, _spPathConstraintPositionTimeline_apply, _spPathConstraintPositionTimeline_getPropertyId);
 }
 
 void spPathConstraintPositionTimeline_setFrame (spPathConstraintPositionTimeline* self, int frameIndex, float time, float value) {
@@ -1590,7 +1612,8 @@ static const int PATHCONSTRAINTSPACING_PREV_VALUE = -1;
 static const int PATHCONSTRAINTSPACING_VALUE = 1;
 
 void _spPathConstraintSpacingTimeline_apply(const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,
-		spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	int frame;
 	float frameTime, percent, spacing;
 	spPathConstraint* constraint;
@@ -1646,7 +1669,8 @@ int _spPathConstraintSpacingTimeline_getPropertyId (const spTimeline* timeline)
 }
 
 spPathConstraintSpacingTimeline* spPathConstraintSpacingTimeline_create (int framesCount) {
-	return (spPathConstraintSpacingTimeline*)_spBaseTimeline_create(framesCount, SP_TIMELINE_PATHCONSTRAINTSPACING, PATHCONSTRAINTSPACING_ENTRIES, _spPathConstraintSpacingTimeline_apply, _spPathConstraintSpacingTimeline_getPropertyId);
+	return (spPathConstraintSpacingTimeline*)_spBaseTimeline_create(framesCount, SP_TIMELINE_PATHCONSTRAINTSPACING,
+		PATHCONSTRAINTSPACING_ENTRIES, _spPathConstraintSpacingTimeline_apply, _spPathConstraintSpacingTimeline_getPropertyId);
 }
 
 void spPathConstraintSpacingTimeline_setFrame (spPathConstraintSpacingTimeline* self, int frameIndex, float time, float value) {
@@ -1664,7 +1688,8 @@ static const int PATHCONSTRAINTMIX_ROTATE = 1;
 static const int PATHCONSTRAINTMIX_TRANSLATE = 2;
 
 void _spPathConstraintMixTimeline_apply(const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,
-											spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction) {
+	spEvent** firedEvents, int* eventsCount, float alpha, spMixBlend blend, spMixDirection direction
+) {
 	int frame;
 	float frameTime, percent, rotate, translate;
 	spPathConstraint* constraint;
@@ -1728,7 +1753,8 @@ int _spPathConstraintMixTimeline_getPropertyId (const spTimeline* timeline) {
 }
 
 spPathConstraintMixTimeline* spPathConstraintMixTimeline_create (int framesCount) {
-	return (spPathConstraintMixTimeline*)_spBaseTimeline_create(framesCount, SP_TIMELINE_PATHCONSTRAINTMIX, PATHCONSTRAINTMIX_ENTRIES, _spPathConstraintMixTimeline_apply, _spPathConstraintMixTimeline_getPropertyId);
+	return (spPathConstraintMixTimeline*)_spBaseTimeline_create(framesCount, SP_TIMELINE_PATHCONSTRAINTMIX,
+		PATHCONSTRAINTMIX_ENTRIES, _spPathConstraintMixTimeline_apply, _spPathConstraintMixTimeline_getPropertyId);
 }
 
 void spPathConstraintMixTimeline_setFrame (spPathConstraintMixTimeline* self, int frameIndex, float time, float rotateMix, float translateMix) {

+ 16 - 17
spine-c/spine-c/src/spine/AnimationState.c

@@ -46,7 +46,7 @@ void spAnimationState_disposeStatics () {
 }
 
 /* Forward declaration of some "private" functions so we can keep
-   the same function order in C as we have method order in Java */
+ the same function order in C as we have method order in Java. */
 void _spAnimationState_disposeTrackEntry (spTrackEntry* entry);
 void _spAnimationState_disposeTrackEntries (spAnimationState* state, spTrackEntry* entry);
 int /*boolean*/ _spAnimationState_updateMixingFrom (spAnimationState* self, spTrackEntry* entry, float delta);
@@ -65,7 +65,6 @@ int _spAnimationState_addPropertyID(spAnimationState* self, int id);
 void _spTrackEntry_computeHold(spTrackEntry* self, spAnimationState* state);
 void _spTrackEntry_computeNotLast(spTrackEntry* self, spAnimationState* state);
 
-
 _spEventQueue* _spEventQueue_create (_spAnimationState* state) {
 	_spEventQueue *self = CALLOC(_spEventQueue, 1);
 	self->state = state;
@@ -78,7 +77,7 @@ _spEventQueue* _spEventQueue_create (_spAnimationState* state) {
 
 void _spEventQueue_free (_spEventQueue* self) {
 	FREE(self->objects);
-    FREE(self);
+	FREE(self);
 }
 
 void _spEventQueue_ensureCapacity (_spEventQueue* self, int newElements) {
@@ -250,7 +249,7 @@ void spAnimationState_dispose (spAnimationState* self) {
 	_spEventQueue_free(internal->queue);
 	FREE(internal->events);
 	FREE(internal->propertyIDs);
-    FREE(internal);
+	FREE(internal);
 }
 
 void spAnimationState_update (spAnimationState* self, float delta) {
@@ -370,9 +369,9 @@ int spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
 		/* Apply mixing from entries first. */
 		mix = current->alpha;
 		if (current->mixingFrom)
-            mix *= _spAnimationState_applyMixingFrom(self, current, skeleton, blend);
-        else if (current->trackTime >= current->trackEnd && current->next == 0)
-            mix = 0;
+			mix *= _spAnimationState_applyMixingFrom(self, current, skeleton, blend);
+		else if (current->trackTime >= current->trackEnd && current->next == 0)
+			mix = 0;
 
 		/* Apply current entry. */
 		animationLast = current->animationLast; animationTime = spTrackEntry_getAnimationTime(current);
@@ -493,7 +492,7 @@ float _spAnimationState_applyMixingFrom (spAnimationState* self, spTrackEntry* t
 			from->totalAlpha += alpha;
 			if (timeline->type == SP_TIMELINE_ROTATE)
 				_spAnimationState_applyRotateTimeline(self, timeline, skeleton, animationTime, alpha, timelineBlend,
-													  timelinesRotation, i << 1, firstFrame);
+					timelinesRotation, i << 1, firstFrame);
 			else {
 				if (timelineBlend == SP_MIX_BLEND_SETUP) {
 					if (timeline->type == SP_TIMELINE_ATTACHMENT) {
@@ -504,7 +503,7 @@ float _spAnimationState_applyMixingFrom (spAnimationState* self, spTrackEntry* t
 				}
 
 				spTimeline_apply(timeline, skeleton, animationLast, animationTime, events, &internal->eventsCount,
-								 alpha, timelineBlend, direction);
+					alpha, timelineBlend, direction);
 			}
 		}
 	}
@@ -518,7 +517,9 @@ float _spAnimationState_applyMixingFrom (spAnimationState* self, spTrackEntry* t
 	return mix;
 }
 
-void _spAnimationState_applyRotateTimeline (spAnimationState* self, spTimeline* timeline, spSkeleton* skeleton, float time, float alpha, spMixBlend blend, float* timelinesRotation, int i, int /*boolean*/ firstFrame) {
+void _spAnimationState_applyRotateTimeline (spAnimationState* self, spTimeline* timeline, spSkeleton* skeleton, float time,
+	float alpha, spMixBlend blend, float* timelinesRotation, int i, int /*boolean*/ firstFrame
+) {
 	spRotateTimeline *rotateTimeline;
 	float *frames;
 	spBone* bone;
@@ -562,8 +563,7 @@ void _spAnimationState_applyRotateTimeline (spAnimationState* self, spTimeline*
 			prevRotation = frames[frame + ROTATE_PREV_ROTATION];
 			frameTime = frames[frame];
 			percent = spCurveTimeline_getCurvePercent(SUPER(rotateTimeline), (frame >> 1) - 1,
-													  1 - (time - frameTime) /
-														  (frames[frame + ROTATE_PREV_TIME] - frameTime));
+				1 - (time - frameTime) / (frames[frame + ROTATE_PREV_TIME] - frameTime));
 
 			r2 = frames[frame + ROTATE_ROTATION] - prevRotation;
 			r2 -= (16384 - (int) (16384.499999999996 - r2 / 360)) * 360;
@@ -698,8 +698,7 @@ void _spAnimationState_setCurrent (spAnimationState* self, int index, spTrackEnt
 }
 
 /** Set the current animation. Any queued animations are cleared. */
-spTrackEntry* spAnimationState_setAnimationByName (spAnimationState* self, int trackIndex, const char* animationName,
-												   int/*bool*/loop) {
+spTrackEntry* spAnimationState_setAnimationByName (spAnimationState* self, int trackIndex, const char* animationName, int/*bool*/loop) {
 	spAnimation* animation = spSkeletonData_findAnimation(self->data->skeletonData, animationName);
 	return spAnimationState_setAnimation(self, trackIndex, animation, loop);
 }
@@ -730,13 +729,13 @@ spTrackEntry* spAnimationState_setAnimation (spAnimationState* self, int trackIn
 /** Adds an animation to be played delay seconds after the current or last queued animation, taking into account any mix
  * duration. */
 spTrackEntry* spAnimationState_addAnimationByName (spAnimationState* self, int trackIndex, const char* animationName,
-												   int/*bool*/loop, float delay) {
+	int/*bool*/loop, float delay
+) {
 	spAnimation* animation = spSkeletonData_findAnimation(self->data->skeletonData, animationName);
 	return spAnimationState_addAnimation(self, trackIndex, animation, loop, delay);
 }
 
-spTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIndex, spAnimation* animation, int/*bool*/loop,
-											 float delay) {
+spTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIndex, spAnimation* animation, int/*bool*/loop, float delay) {
 	spTrackEntry* entry;
 	_spAnimationState* internal = SUB_CAST(_spAnimationState, self);
 	spTrackEntry* last = _spAnimationState_expandToIndex(self, trackIndex);

+ 6 - 10
spine-c/spine-c/src/spine/Atlas.c

@@ -181,9 +181,8 @@ spAtlas* spAtlas_create(const char* begin, int length, const char* dir, void* re
 	self->rendererObject = rendererObject;
 
 	while (readLine(&begin, end, &str)) {
-		if (str.end - str.begin == 0) {
+		if (str.end - str.begin == 0)
 			page = 0;
-		}
 		else if (!page) {
 			char* name = mallocString(&str);
 			char* path = MALLOC(char, dirLength + needsSlash + strlen(name) + 1);
@@ -232,8 +231,7 @@ spAtlas* spAtlas_create(const char* begin, int length, const char* dir, void* re
 
 			_spAtlasPage_createTexture(page, path);
 			FREE(path);
-		}
-		else {
+		} else {
 			spAtlasRegion *region = spAtlasRegion_create();
 			if (lastRegion)
 				lastRegion->next = region;
@@ -245,13 +243,12 @@ spAtlas* spAtlas_create(const char* begin, int length, const char* dir, void* re
 			region->name = mallocString(&str);
 
 			if (!readValue(&begin, end, &str)) return abortAtlas(self);
-			if (equals(&str, "true")) {
+			if (equals(&str, "true"))
 				region->degrees = 90;
-			} else if (equals(&str, "false")) {
+			else if (equals(&str, "false"))
 				region->degrees = 0;
-			} else {
+			else
 				region->degrees = toInt(&str);
-			}
 			region->rotate = region->degrees == 90;
 
 			if (readTuple(&begin, end, tuple) != 2) return abortAtlas(self);
@@ -267,8 +264,7 @@ spAtlas* spAtlas_create(const char* begin, int length, const char* dir, void* re
 			if (region->rotate) {
 				region->u2 = (region->x + region->height) / (float)page->width;
 				region->v2 = (region->y + region->width) / (float)page->height;
-			}
-			else {
+			} else {
 				region->u2 = (region->x + region->width) / (float)page->width;
 				region->v2 = (region->y + region->height) / (float)page->height;
 			}

+ 1 - 2
spine-c/spine-c/src/spine/AttachmentLoader.c

@@ -32,8 +32,7 @@
 #include <spine/extension.h>
 
 typedef struct _spAttachmentLoaderVtable {
-	spAttachment* (*createAttachment) (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name,
-			const char* path);
+	spAttachment* (*createAttachment) (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name, const char* path);
 	void (*configureAttachment) (spAttachmentLoader* self, spAttachment*);
 	void (*disposeAttachment) (spAttachmentLoader* self, spAttachment*);
 	void (*dispose) (spAttachmentLoader* self);

+ 71 - 71
spine-c/spine-c/src/spine/Bone.c

@@ -96,78 +96,78 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota
 	CONST_CAST(float, self->worldY) = pc * x + pd * y + parent->worldY;
 
 	switch (self->data->transformMode) {
-		case SP_TRANSFORMMODE_NORMAL: {
-			float rotationY = rotation + 90 + shearY;
-			float la = COS_DEG(rotation + shearX) * scaleX;
-			float lb = COS_DEG(rotationY) * scaleY;
-			float lc = SIN_DEG(rotation + shearX) * scaleX;
-			float ld = SIN_DEG(rotationY) * scaleY;
-			CONST_CAST(float, self->a) = pa * la + pb * lc;
-			CONST_CAST(float, self->b) = pa * lb + pb * ld;
-			CONST_CAST(float, self->c) = pc * la + pd * lc;
-			CONST_CAST(float, self->d) = pc * lb + pd * ld;
-			return;
-		}
-		case SP_TRANSFORMMODE_ONLYTRANSLATION: {
-			float rotationY = rotation + 90 + shearY;
-			CONST_CAST(float, self->a) = COS_DEG(rotation + shearX) * scaleX;
-			CONST_CAST(float, self->b) = COS_DEG(rotationY) * scaleY;
-			CONST_CAST(float, self->c) = SIN_DEG(rotation + shearX) * scaleX;
-			CONST_CAST(float, self->d) = SIN_DEG(rotationY) * scaleY;
-			break;
-		}
-		case SP_TRANSFORMMODE_NOROTATIONORREFLECTION: {
-			float s = pa * pa + pc * pc;
-			float prx, rx, ry, la, lb, lc, ld;
-			if (s > 0.0001f) {
-				s = ABS(pa * pd - pb * pc) / s;
-				pb = pc * s;
-				pd = pa * s;
-				prx = ATAN2(pc, pa) * RAD_DEG;
-			} else {
-				pa = 0;
-				pc = 0;
-				prx = 90 - ATAN2(pd, pb) * RAD_DEG;
-			}
-			rx = rotation + shearX - prx;
-			ry = rotation + shearY - prx + 90;
-			la = COS_DEG(rx) * scaleX;
-			lb = COS_DEG(ry) * scaleY;
-			lc = SIN_DEG(rx) * scaleX;
-			ld = SIN_DEG(ry) * scaleY;
-			CONST_CAST(float, self->a) = pa * la - pb * lc;
-			CONST_CAST(float, self->b) = pa * lb - pb * ld;
-			CONST_CAST(float, self->c) = pc * la + pd * lc;
-			CONST_CAST(float, self->d) = pc * lb + pd * ld;
-			break;
-		}
-		case SP_TRANSFORMMODE_NOSCALE:
-		case SP_TRANSFORMMODE_NOSCALEORREFLECTION: {
-			float za, zc, s;
-			float r, zb, zd, la, lb, lc, ld;
-			cosine = COS_DEG(rotation); sine = SIN_DEG(rotation);
-			za = (pa * cosine + pb * sine) / sx;
-			zc = (pc * cosine + pd * sine) / sy;
-			s = SQRT(za * za + zc * zc);
-			if (s > 0.00001f) s = 1 / s;
-			za *= s;
-			zc *= s;
-			s = SQRT(za * za + zc * zc);
-			if (self->data->transformMode == SP_TRANSFORMMODE_NOSCALE && (pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))
-				s = -s;
-			r = PI / 2 + ATAN2(zc, za);
-			zb = COS(r) * s;
-			zd = SIN(r) * s;
-			la = COS_DEG(shearX) * scaleX;
-			lb = COS_DEG(90 + shearY) * scaleY;
-			lc = SIN_DEG(shearX) * scaleX;
-			ld = SIN_DEG(90 + shearY) * scaleY;
-			CONST_CAST(float, self->a) = za * la + zb * lc;
-			CONST_CAST(float, self->b) = za * lb + zb * ld;
-			CONST_CAST(float, self->c) = zc * la + zd * lc;
-			CONST_CAST(float, self->d) = zc * lb + zd * ld;
-			break;
+	case SP_TRANSFORMMODE_NORMAL: {
+		float rotationY = rotation + 90 + shearY;
+		float la = COS_DEG(rotation + shearX) * scaleX;
+		float lb = COS_DEG(rotationY) * scaleY;
+		float lc = SIN_DEG(rotation + shearX) * scaleX;
+		float ld = SIN_DEG(rotationY) * scaleY;
+		CONST_CAST(float, self->a) = pa * la + pb * lc;
+		CONST_CAST(float, self->b) = pa * lb + pb * ld;
+		CONST_CAST(float, self->c) = pc * la + pd * lc;
+		CONST_CAST(float, self->d) = pc * lb + pd * ld;
+		return;
+	}
+	case SP_TRANSFORMMODE_ONLYTRANSLATION: {
+		float rotationY = rotation + 90 + shearY;
+		CONST_CAST(float, self->a) = COS_DEG(rotation + shearX) * scaleX;
+		CONST_CAST(float, self->b) = COS_DEG(rotationY) * scaleY;
+		CONST_CAST(float, self->c) = SIN_DEG(rotation + shearX) * scaleX;
+		CONST_CAST(float, self->d) = SIN_DEG(rotationY) * scaleY;
+		break;
+	}
+	case SP_TRANSFORMMODE_NOROTATIONORREFLECTION: {
+		float s = pa * pa + pc * pc;
+		float prx, rx, ry, la, lb, lc, ld;
+		if (s > 0.0001f) {
+			s = ABS(pa * pd - pb * pc) / s;
+			pb = pc * s;
+			pd = pa * s;
+			prx = ATAN2(pc, pa) * RAD_DEG;
+		} else {
+			pa = 0;
+			pc = 0;
+			prx = 90 - ATAN2(pd, pb) * RAD_DEG;
 		}
+		rx = rotation + shearX - prx;
+		ry = rotation + shearY - prx + 90;
+		la = COS_DEG(rx) * scaleX;
+		lb = COS_DEG(ry) * scaleY;
+		lc = SIN_DEG(rx) * scaleX;
+		ld = SIN_DEG(ry) * scaleY;
+		CONST_CAST(float, self->a) = pa * la - pb * lc;
+		CONST_CAST(float, self->b) = pa * lb - pb * ld;
+		CONST_CAST(float, self->c) = pc * la + pd * lc;
+		CONST_CAST(float, self->d) = pc * lb + pd * ld;
+		break;
+	}
+	case SP_TRANSFORMMODE_NOSCALE:
+	case SP_TRANSFORMMODE_NOSCALEORREFLECTION: {
+		float za, zc, s;
+		float r, zb, zd, la, lb, lc, ld;
+		cosine = COS_DEG(rotation); sine = SIN_DEG(rotation);
+		za = (pa * cosine + pb * sine) / sx;
+		zc = (pc * cosine + pd * sine) / sy;
+		s = SQRT(za * za + zc * zc);
+		if (s > 0.00001f) s = 1 / s;
+		za *= s;
+		zc *= s;
+		s = SQRT(za * za + zc * zc);
+		if (self->data->transformMode == SP_TRANSFORMMODE_NOSCALE && (pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))
+			s = -s;
+		r = PI / 2 + ATAN2(zc, za);
+		zb = COS(r) * s;
+		zd = SIN(r) * s;
+		la = COS_DEG(shearX) * scaleX;
+		lb = COS_DEG(90 + shearY) * scaleY;
+		lc = SIN_DEG(shearX) * scaleX;
+		ld = SIN_DEG(90 + shearY) * scaleY;
+		CONST_CAST(float, self->a) = za * la + zb * lc;
+		CONST_CAST(float, self->b) = za * lb + zb * ld;
+		CONST_CAST(float, self->c) = zc * la + zd * lc;
+		CONST_CAST(float, self->d) = zc * lb + zd * ld;
+		break;
+	}
 	}
 
 	CONST_CAST(float, self->a) *= sx;

+ 6 - 6
spine-c/spine-c/src/spine/IkConstraint.c

@@ -59,12 +59,12 @@ void spIkConstraint_dispose(spIkConstraint *self) {
 
 void spIkConstraint_apply(spIkConstraint *self) {
 	switch (self->bonesCount) {
-		case 1:
-			spIkConstraint_apply1(self->bones[0], self->target->worldX, self->target->worldY, self->compress, self->stretch, self->data->uniform, self->mix);
-			break;
-		case 2:
-			spIkConstraint_apply2(self->bones[0], self->bones[1], self->target->worldX, self->target->worldY, self->bendDirection, self->stretch, self->softness, self->mix);
-			break;
+	case 1:
+		spIkConstraint_apply1(self->bones[0], self->target->worldX, self->target->worldY, self->compress, self->stretch, self->data->uniform, self->mix);
+		break;
+	case 2:
+		spIkConstraint_apply2(self->bones[0], self->bones[1], self->target->worldX, self->target->worldY, self->bendDirection, self->stretch, self->softness, self->mix);
+		break;
 	}
 }
 

+ 22 - 23
spine-c/spine-c/src/spine/Json.c

@@ -1,25 +1,25 @@
 /*
- Copyright (c) 2009, Dave Gamble
- Copyright (c) 2013, Esoteric Software
-
- Permission is hereby granted, dispose of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- */
+Copyright (c) 2009, Dave Gamble
+Copyright (c) 2013, Esoteric Software
+
+Permission is hereby granted, dispose of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
 
 /* Json */
 /* JSON parser in C. */
@@ -54,8 +54,7 @@ const char* Json_getError (void) {
 
 static int Json_strcasecmp (const char* s1, const char* s2) {
 	/* TODO we may be able to elide these NULL checks if we can prove
-	 * the graph and input (only callsite is Json_getItem) should not have NULLs
-	 */
+	the graph and input (only callsite is Json_getItem) should not have NULLs */
 	if (s1 && s2) {
 #if defined(_WIN32)
 		return _stricmp(s1, s2);

+ 3 - 3
spine-c/spine-c/src/spine/Json.h

@@ -1,16 +1,16 @@
 /*
  Copyright (c) 2009 Dave Gamble
- 
+
  Permission is hereby granted, dispose of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
- 
+
  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.
- 
+
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

+ 1 - 2
spine-c/spine-c/src/spine/MeshAttachment.c

@@ -187,7 +187,6 @@ void spMeshAttachment_updateUVs (spMeshAttachment* self) {
 void spMeshAttachment_setParentMesh (spMeshAttachment* self, spMeshAttachment* parentMesh) {
 	CONST_CAST(spMeshAttachment*, self->parentMesh) = parentMesh;
 	if (parentMesh) {
-
 		self->super.bones = parentMesh->super.bones;
 		self->super.bonesCount = parentMesh->super.bonesCount;
 
@@ -200,7 +199,7 @@ void spMeshAttachment_setParentMesh (spMeshAttachment* self, spMeshAttachment* p
 		self->trianglesCount = parentMesh->trianglesCount;
 
 		self->hullLength = parentMesh->hullLength;
-		
+
 		self->super.worldVerticesLength = parentMesh->super.worldVerticesLength;
 
 		self->edges = parentMesh->edges;

+ 3 - 4
spine-c/spine-c/src/spine/PathConstraint.c

@@ -214,7 +214,7 @@ static void _addAfterPosition (float p, float* temp, int i, float* out, int o) {
 
 /* Need to pass 0 as an argument, so VC++ doesn't error with C2124 */
 static int _isNan(float value, float zero) {
-	float _nan =  (float)0.0 / zero;
+	float _nan = (float)0.0 / zero;
 	return 0 == memcmp((void*)&value, (void*)&_nan, sizeof(value));
 }
 
@@ -235,11 +235,10 @@ static void _addCurvePosition (float p, float x1, float y1, float cx1, float cy1
 	out[o] = x;
 	out[o + 1] = y;
 	if (tangents) {
-		if (p < 0.001) {
+		if (p < 0.001)
 			out[o + 2] = ATAN2(cy1 - y1, cx1 - x1);
-		} else {
+		else
 			out[o + 2] = ATAN2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
-		}
 	}
 }
 

+ 1 - 2
spine-c/spine-c/src/spine/Skeleton.c

@@ -251,8 +251,7 @@ static void _sortIkConstraint (_spSkeleton* const internal, spIkConstraint* cons
 				break;
 			}
 		}
-		if (!contains)
-			_addToUpdateCacheReset(internal, child);
+		if (!contains) _addToUpdateCacheReset(internal, child);
 	}
 
 	_addToUpdateCache(internal, SP_UPDATE_IK_CONSTRAINT, constraint);

+ 283 - 283
spine-c/spine-c/src/spine/SkeletonBinary.c

@@ -35,7 +35,7 @@
 #include <spine/Array.h>
 
 typedef struct {
-	const unsigned char* cursor; 
+	const unsigned char* cursor;
 	const unsigned char* end;
 } _dataInput;
 
@@ -118,13 +118,13 @@ static int readVarint (_dataInput* input, int/*bool*/optimizePositive) {
 		b = readByte(input);
 		value |= (b & 0x7F) << 7;
 		if (b & 0x80) {
+			b = readByte(input);
+			value |= (b & 0x7F) << 14;
+			if (b & 0x80) {
 				b = readByte(input);
-				value |= (b & 0x7F) << 14;
-				if (b & 0x80) {
-					b = readByte(input);
-					value |= (b & 0x7F) << 21;
-					if (b & 0x80) value |= (readByte(input) & 0x7F) << 28;
-				}
+				value |= (b & 0x7F) << 21;
+				if (b & 0x80) value |= (readByte(input) & 0x7F) << 28;
+			}
 		}
 	}
 	if (!optimizePositive) value = (((unsigned int)value >> 1) ^ -(value & 1));
@@ -206,18 +206,18 @@ static void readColor (_dataInput* input, float *r, float *g, float *b, float *a
 
 static void readCurve (_dataInput* input, spCurveTimeline* timeline, int frameIndex) {
 	switch (readByte(input)) {
-		case CURVE_STEPPED: {
-			spCurveTimeline_setStepped(timeline, frameIndex);
-			break;
-		}
-		case CURVE_BEZIER: {
-			float cx1 = readFloat(input);
-			float cy1 = readFloat(input);
-			float cx2 = readFloat(input);
-			float cy2 = readFloat(input);
-			spCurveTimeline_setCurve(timeline, frameIndex, cx1, cy1, cx2, cy2);
-			break;
-		}
+	case CURVE_STEPPED: {
+		spCurveTimeline_setStepped(timeline, frameIndex);
+		break;
+	}
+	case CURVE_BEZIER: {
+		float cx1 = readFloat(input);
+		float cy1 = readFloat(input);
+		float cx2 = readFloat(input);
+		float cy2 = readFloat(input);
+		spCurveTimeline_setCurve(timeline, frameIndex, cx1, cy1, cx2, cy2);
+		break;
+	}
 	}
 }
 
@@ -264,56 +264,56 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
 			unsigned char timelineType = readByte(input);
 			int frameCount = readVarint(input, 1);
 			switch (timelineType) {
-				case SLOT_ATTACHMENT: {
-					spAttachmentTimeline* timeline = spAttachmentTimeline_create(frameCount);
-					timeline->slotIndex = slotIndex;
-					for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
-						float time = readFloat(input);
-						const char* attachmentName = readStringRef(input, skeletonData);
-						/* TODO Avoid copying of attachmentName inside */
-						spAttachmentTimeline_setFrame(timeline, frameIndex, time, attachmentName);
-					}
-					spTimelineArray_add(timelines, (spTimeline*)timeline);
-					duration = MAX(duration, timeline->frames[frameCount - 1]);
-					break;
-				}
-				case SLOT_COLOR: {
-					spColorTimeline* timeline = spColorTimeline_create(frameCount);
-					timeline->slotIndex = slotIndex;
-					for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
-						float time = readFloat(input);
-						float r, g, b, a;
-						readColor(input, &r, &g, &b, &a);
-						spColorTimeline_setFrame(timeline, frameIndex, time, r, g, b, a);
-						if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
-					}
-					spTimelineArray_add(timelines, (spTimeline*)timeline);
-					duration = MAX(duration, timeline->frames[(frameCount - 1) * COLOR_ENTRIES]);
-					break;
+			case SLOT_ATTACHMENT: {
+				spAttachmentTimeline* timeline = spAttachmentTimeline_create(frameCount);
+				timeline->slotIndex = slotIndex;
+				for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
+					float time = readFloat(input);
+					const char* attachmentName = readStringRef(input, skeletonData);
+					/* TODO Avoid copying of attachmentName inside */
+					spAttachmentTimeline_setFrame(timeline, frameIndex, time, attachmentName);
 				}
-				case SLOT_TWO_COLOR: {
-					spTwoColorTimeline* timeline = spTwoColorTimeline_create(frameCount);
-					timeline->slotIndex = slotIndex;
-					for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
-						float time = readFloat(input);
-						float r, g, b, a;
-						float r2, g2, b2, a2;
-						readColor(input, &r, &g, &b, &a);
-						readColor(input, &a2, &r2, &g2, &b2);
-						spTwoColorTimeline_setFrame(timeline, frameIndex, time, r, g, b, a, r2, g2, b2);
-						if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
-					}
-					spTimelineArray_add(timelines, (spTimeline*)timeline);
-					duration = MAX(duration, timeline->frames[(frameCount - 1) * TWOCOLOR_ENTRIES]);
-					break;
+				spTimelineArray_add(timelines, (spTimeline*)timeline);
+				duration = MAX(duration, timeline->frames[frameCount - 1]);
+				break;
+			}
+			case SLOT_COLOR: {
+				spColorTimeline* timeline = spColorTimeline_create(frameCount);
+				timeline->slotIndex = slotIndex;
+				for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
+					float time = readFloat(input);
+					float r, g, b, a;
+					readColor(input, &r, &g, &b, &a);
+					spColorTimeline_setFrame(timeline, frameIndex, time, r, g, b, a);
+					if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
 				}
-				default: {
-					for (iii = 0; iii < timelines->size; ++iii)
-						spTimeline_dispose(timelines->items[iii]);
-					spTimelineArray_dispose(timelines);
-					_spSkeletonBinary_setError(self, "Invalid timeline type for a slot: ", skeletonData->slots[slotIndex]->name);
-					return 0;
+				spTimelineArray_add(timelines, (spTimeline*)timeline);
+				duration = MAX(duration, timeline->frames[(frameCount - 1) * COLOR_ENTRIES]);
+				break;
+			}
+			case SLOT_TWO_COLOR: {
+				spTwoColorTimeline* timeline = spTwoColorTimeline_create(frameCount);
+				timeline->slotIndex = slotIndex;
+				for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
+					float time = readFloat(input);
+					float r, g, b, a;
+					float r2, g2, b2, a2;
+					readColor(input, &r, &g, &b, &a);
+					readColor(input, &a2, &r2, &g2, &b2);
+					spTwoColorTimeline_setFrame(timeline, frameIndex, time, r, g, b, a, r2, g2, b2);
+					if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
 				}
+				spTimelineArray_add(timelines, (spTimeline*)timeline);
+				duration = MAX(duration, timeline->frames[(frameCount - 1) * TWOCOLOR_ENTRIES]);
+				break;
+			}
+			default: {
+				for (iii = 0; iii < timelines->size; ++iii)
+					spTimeline_dispose(timelines->items[iii]);
+				spTimelineArray_dispose(timelines);
+				_spSkeletonBinary_setError(self, "Invalid timeline type for a slot: ", skeletonData->slots[slotIndex]->name);
+				return 0;
+			}
 			}
 		}
 	}
@@ -325,57 +325,57 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
 			unsigned char timelineType = readByte(input);
 			int frameCount = readVarint(input, 1);
 			switch (timelineType) {
-				case BONE_ROTATE: {
-					spRotateTimeline *timeline = spRotateTimeline_create(frameCount);
-					timeline->boneIndex = boneIndex;
-					for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
-						float time = readFloat(input);
-						float degrees = readFloat(input);
-						spRotateTimeline_setFrame(timeline, frameIndex, time, degrees);
-						if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
-					}
-					spTimelineArray_add(timelines, (spTimeline*)timeline);
-					duration = MAX(duration, timeline->frames[(frameCount - 1) * ROTATE_ENTRIES]);
-					break;
+			case BONE_ROTATE: {
+				spRotateTimeline *timeline = spRotateTimeline_create(frameCount);
+				timeline->boneIndex = boneIndex;
+				for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
+					float time = readFloat(input);
+					float degrees = readFloat(input);
+					spRotateTimeline_setFrame(timeline, frameIndex, time, degrees);
+					if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
 				}
-				case BONE_TRANSLATE:
-				case BONE_SCALE:
-				case BONE_SHEAR: {
-					float timelineScale = 1;
-					spTranslateTimeline *timeline = 0;
-					switch (timelineType) {
-						case BONE_SCALE:
-							timeline = spScaleTimeline_create(frameCount);
-							break;
-						case BONE_SHEAR:
-							timeline = spShearTimeline_create(frameCount);
-							break;
-						case BONE_TRANSLATE:
-							timeline = spTranslateTimeline_create(frameCount);
-							timelineScale = self->scale;
-							break;
-						default:
-							break;
-					}
-					timeline->boneIndex = boneIndex;
-					for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
-						float time = readFloat(input);
-						float x = readFloat(input) * timelineScale;
-						float y = readFloat(input) * timelineScale;
-						spTranslateTimeline_setFrame(timeline, frameIndex, time, x, y);
-						if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
-					}
-					spTimelineArray_add(timelines, (spTimeline*)timeline);
-					duration = MAX(duration, timeline->frames[(frameCount - 1) * TRANSLATE_ENTRIES]);
-					break;
+				spTimelineArray_add(timelines, (spTimeline*)timeline);
+				duration = MAX(duration, timeline->frames[(frameCount - 1) * ROTATE_ENTRIES]);
+				break;
+			}
+			case BONE_TRANSLATE:
+			case BONE_SCALE:
+			case BONE_SHEAR: {
+				float timelineScale = 1;
+				spTranslateTimeline *timeline = 0;
+				switch (timelineType) {
+					case BONE_SCALE:
+						timeline = spScaleTimeline_create(frameCount);
+						break;
+					case BONE_SHEAR:
+						timeline = spShearTimeline_create(frameCount);
+						break;
+					case BONE_TRANSLATE:
+						timeline = spTranslateTimeline_create(frameCount);
+						timelineScale = self->scale;
+						break;
+					default:
+						break;
 				}
-				default: {
-					for (iii = 0; iii < timelines->size; ++iii)
-						spTimeline_dispose(timelines->items[iii]);
-					spTimelineArray_dispose(timelines);
-					_spSkeletonBinary_setError(self, "Invalid timeline type for a bone: ", skeletonData->bones[boneIndex]->name);
-					return 0;
+				timeline->boneIndex = boneIndex;
+				for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
+					float time = readFloat(input);
+					float x = readFloat(input) * timelineScale;
+					float y = readFloat(input) * timelineScale;
+					spTranslateTimeline_setFrame(timeline, frameIndex, time, x, y);
+					if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
 				}
+				spTimelineArray_add(timelines, (spTimeline*)timeline);
+				duration = MAX(duration, timeline->frames[(frameCount - 1) * TRANSLATE_ENTRIES]);
+				break;
+			}
+			default: {
+				for (iii = 0; iii < timelines->size; ++iii)
+					spTimeline_dispose(timelines->items[iii]);
+				spTimelineArray_dispose(timelines);
+				_spSkeletonBinary_setError(self, "Invalid timeline type for a bone: ", skeletonData->bones[boneIndex]->name);
+				return 0;
+			}
 			}
 		}
 	}
@@ -413,7 +413,7 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
 			float scaleMix = readFloat(input);
 			float shearMix = readFloat(input);
 			spTransformConstraintTimeline_setFrame(timeline, frameIndex, time, rotateMix, translateMix,
-					scaleMix, shearMix);
+				scaleMix, shearMix);
 			if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
 		}
 		spTimelineArray_add(timelines, (spTimeline*)timeline);
@@ -428,43 +428,43 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
 			unsigned char timelineType = readByte(input);
 			int frameCount = readVarint(input, 1);
 			switch (timelineType) {
-				case PATH_POSITION:
-				case PATH_SPACING: {
-					spPathConstraintPositionTimeline* timeline = 0;
-					float timelineScale = 1;
-					if (timelineType == PATH_SPACING) {
-						timeline = (spPathConstraintPositionTimeline*)spPathConstraintSpacingTimeline_create(frameCount);
-						if (data->spacingMode == SP_SPACING_MODE_LENGTH || data->spacingMode == SP_SPACING_MODE_FIXED)
-							timelineScale = self->scale;
-					} else {
-						timeline = spPathConstraintPositionTimeline_create(frameCount);
-						if (data->positionMode == SP_POSITION_MODE_FIXED)
-							timelineScale = self->scale;
-					}
-					timeline->pathConstraintIndex = index;
-					for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
-						float time = readFloat(input);
-						float value = readFloat(input) * timelineScale;
-						spPathConstraintPositionTimeline_setFrame(timeline, frameIndex, time, value);
-						if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
-					}
-					spTimelineArray_add(timelines, (spTimeline*)timeline);
-					duration = MAX(duration, timeline->frames[(frameCount - 1) * PATHCONSTRAINTPOSITION_ENTRIES]);
-					break;
+			case PATH_POSITION:
+			case PATH_SPACING: {
+				spPathConstraintPositionTimeline* timeline = 0;
+				float timelineScale = 1;
+				if (timelineType == PATH_SPACING) {
+					timeline = (spPathConstraintPositionTimeline*)spPathConstraintSpacingTimeline_create(frameCount);
+					if (data->spacingMode == SP_SPACING_MODE_LENGTH || data->spacingMode == SP_SPACING_MODE_FIXED)
+						timelineScale = self->scale;
+				} else {
+					timeline = spPathConstraintPositionTimeline_create(frameCount);
+					if (data->positionMode == SP_POSITION_MODE_FIXED)
+						timelineScale = self->scale;
 				}
-				case PATH_MIX: {
-					spPathConstraintMixTimeline* timeline = spPathConstraintMixTimeline_create(frameCount);
-					timeline->pathConstraintIndex = index;
-					for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
-						float time = readFloat(input);
-						float rotateMix = readFloat(input);
-						float translateMix = readFloat(input);
-						spPathConstraintMixTimeline_setFrame(timeline, frameIndex, time, rotateMix, translateMix);
-						if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
-					}
-					spTimelineArray_add(timelines, (spTimeline*)timeline);
-					duration = MAX(duration, timeline->frames[(frameCount - 1) * PATHCONSTRAINTMIX_ENTRIES]);
+				timeline->pathConstraintIndex = index;
+				for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
+					float time = readFloat(input);
+					float value = readFloat(input) * timelineScale;
+					spPathConstraintPositionTimeline_setFrame(timeline, frameIndex, time, value);
+					if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
+				}
+				spTimelineArray_add(timelines, (spTimeline*)timeline);
+				duration = MAX(duration, timeline->frames[(frameCount - 1) * PATHCONSTRAINTPOSITION_ENTRIES]);
+				break;
+			}
+			case PATH_MIX: {
+				spPathConstraintMixTimeline* timeline = spPathConstraintMixTimeline_create(frameCount);
+				timeline->pathConstraintIndex = index;
+				for (frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
+					float time = readFloat(input);
+					float rotateMix = readFloat(input);
+					float translateMix = readFloat(input);
+					spPathConstraintMixTimeline_setFrame(timeline, frameIndex, time, rotateMix, translateMix);
+					if (frameIndex < frameCount - 1) readCurve(input, SUPER(timeline), frameIndex);
 				}
+				spTimelineArray_add(timelines, (spTimeline*)timeline);
+				duration = MAX(duration, timeline->frames[(frameCount - 1) * PATHCONSTRAINTMIX_ENTRIES]);
+			}
 			}
 		}
 	}
@@ -482,7 +482,7 @@ static spAnimation* _spSkeletonBinary_readAnimation (spSkeletonBinary* self, con
 				int frameCount;
 
 				spVertexAttachment* attachment = SUB_CAST(spVertexAttachment,
-						spSkin_getAttachment(skin, slotIndex, attachmentName));
+					spSkin_getAttachment(skin, slotIndex, attachmentName));
 				if (!attachment) {
 					for (i = 0; i < timelines->size; ++i)
 						spTimeline_dispose(timelines->items[i]);
@@ -684,140 +684,140 @@ spAttachment* spSkeletonBinary_readAttachment(spSkeletonBinary* self, _dataInput
 	type = (spAttachmentType)readByte(input);
 
 	switch (type) {
-		case SP_ATTACHMENT_REGION: {
-			const char* path = readStringRef(input, skeletonData);
-			spAttachment* attachment;
-			spRegionAttachment* region;
-			if (!path) MALLOC_STR(path, name);
-			else {
-				const char* tmp = 0;
-				MALLOC_STR(tmp, path);
-				path = tmp;
-			}
-			attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, path);
-			region = SUB_CAST(spRegionAttachment, attachment);
-			region->path = path;
-			region->rotation = readFloat(input);
-			region->x = readFloat(input) * self->scale;
-			region->y = readFloat(input) * self->scale;
-			region->scaleX = readFloat(input);
-			region->scaleY = readFloat(input);
-			region->width = readFloat(input) * self->scale;
-			region->height = readFloat(input) * self->scale;
-			readColor(input, &region->color.r, &region->color.g, &region->color.b, &region->color.a);
-			spRegionAttachment_updateOffset(region);
-			spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
-			return attachment;
+	case SP_ATTACHMENT_REGION: {
+		const char* path = readStringRef(input, skeletonData);
+		spAttachment* attachment;
+		spRegionAttachment* region;
+		if (!path) MALLOC_STR(path, name);
+		else {
+			const char* tmp = 0;
+			MALLOC_STR(tmp, path);
+			path = tmp;
 		}
-		case SP_ATTACHMENT_BOUNDING_BOX: {
-			int vertexCount = readVarint(input, 1);
-			spAttachment* attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, 0);
-			_readVertices(self, input, SUB_CAST(spVertexAttachment, attachment), vertexCount);
-			if (nonessential) readInt(input); /* Skip color. */
-			spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
-			return attachment;
+		attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, path);
+		region = SUB_CAST(spRegionAttachment, attachment);
+		region->path = path;
+		region->rotation = readFloat(input);
+		region->x = readFloat(input) * self->scale;
+		region->y = readFloat(input) * self->scale;
+		region->scaleX = readFloat(input);
+		region->scaleY = readFloat(input);
+		region->width = readFloat(input) * self->scale;
+		region->height = readFloat(input) * self->scale;
+		readColor(input, &region->color.r, &region->color.g, &region->color.b, &region->color.a);
+		spRegionAttachment_updateOffset(region);
+		spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
+		return attachment;
+	}
+	case SP_ATTACHMENT_BOUNDING_BOX: {
+		int vertexCount = readVarint(input, 1);
+		spAttachment* attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, 0);
+		_readVertices(self, input, SUB_CAST(spVertexAttachment, attachment), vertexCount);
+		if (nonessential) readInt(input); /* Skip color. */
+		spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
+		return attachment;
+	}
+	case SP_ATTACHMENT_MESH: {
+		int vertexCount;
+		spAttachment* attachment;
+		spMeshAttachment* mesh;
+		const char* path = readStringRef(input, skeletonData);
+		if (!path) MALLOC_STR(path, name);
+		else {
+			const char* tmp = 0;
+			MALLOC_STR(tmp, path);
+			path = tmp;
 		}
-		case SP_ATTACHMENT_MESH: {
-			int vertexCount;
-			spAttachment* attachment;
-			spMeshAttachment* mesh;
-			const char* path = readStringRef(input, skeletonData);
-			if (!path) MALLOC_STR(path, name);
-			else {
-				const char* tmp = 0;
-				MALLOC_STR(tmp, path);
-				path = tmp;
-			}
-			attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, path);
-			mesh = SUB_CAST(spMeshAttachment, attachment);
-			mesh->path = path;
-			readColor(input, &mesh->color.r, &mesh->color.g, &mesh->color.b, &mesh->color.a);
-			vertexCount = readVarint(input, 1);
-			mesh->regionUVs = _readFloatArray(input, vertexCount << 1, 1);
-			mesh->triangles = (unsigned short*)_readShortArray(input, &mesh->trianglesCount);
-			_readVertices(self, input, SUPER(mesh), vertexCount);
-			spMeshAttachment_updateUVs(mesh);
-			mesh->hullLength = readVarint(input, 1) << 1;
-			if (nonessential) {
-				mesh->edges = (int*)_readShortArray(input, &mesh->edgesCount);
-				mesh->width = readFloat(input) * self->scale;
-				mesh->height = readFloat(input) * self->scale;
-			} else {
-				mesh->edges = 0;
-				mesh->width = 0;
-				mesh->height = 0;
-			}
-			spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
-			return attachment;
+		attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, path);
+		mesh = SUB_CAST(spMeshAttachment, attachment);
+		mesh->path = path;
+		readColor(input, &mesh->color.r, &mesh->color.g, &mesh->color.b, &mesh->color.a);
+		vertexCount = readVarint(input, 1);
+		mesh->regionUVs = _readFloatArray(input, vertexCount << 1, 1);
+		mesh->triangles = (unsigned short*)_readShortArray(input, &mesh->trianglesCount);
+		_readVertices(self, input, SUPER(mesh), vertexCount);
+		spMeshAttachment_updateUVs(mesh);
+		mesh->hullLength = readVarint(input, 1) << 1;
+		if (nonessential) {
+			mesh->edges = (int*)_readShortArray(input, &mesh->edgesCount);
+			mesh->width = readFloat(input) * self->scale;
+			mesh->height = readFloat(input) * self->scale;
+		} else {
+			mesh->edges = 0;
+			mesh->width = 0;
+			mesh->height = 0;
 		}
-		case SP_ATTACHMENT_LINKED_MESH: {
-			const char* skinName;
-			const char* parent;
-			spAttachment* attachment;
-			spMeshAttachment* mesh;
-			int inheritDeform;
-			const char* path = readStringRef(input, skeletonData);
-			if (!path) MALLOC_STR(path, name);
-			else {
-				const char* tmp = 0;
-				MALLOC_STR(tmp, path);
-				path = tmp;
-			}
-			attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, path);
-			mesh = SUB_CAST(spMeshAttachment, attachment);
-			mesh->path = path;
-			readColor(input, &mesh->color.r, &mesh->color.g, &mesh->color.b, &mesh->color.a);
-			skinName = readStringRef(input, skeletonData);
-			parent = readStringRef(input, skeletonData);
-			inheritDeform = readBoolean(input);
-			if (nonessential) {
-				mesh->width = readFloat(input) * self->scale;
-				mesh->height = readFloat(input) * self->scale;
-			}
-			_spSkeletonBinary_addLinkedMesh(self, mesh, skinName, slotIndex, parent, inheritDeform);
-			return attachment;
+		spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
+		return attachment;
+	}
+	case SP_ATTACHMENT_LINKED_MESH: {
+		const char* skinName;
+		const char* parent;
+		spAttachment* attachment;
+		spMeshAttachment* mesh;
+		int inheritDeform;
+		const char* path = readStringRef(input, skeletonData);
+		if (!path) MALLOC_STR(path, name);
+		else {
+			const char* tmp = 0;
+			MALLOC_STR(tmp, path);
+			path = tmp;
 		}
-		case SP_ATTACHMENT_PATH: {
-			spAttachment* attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, 0);
-			spPathAttachment* path = SUB_CAST(spPathAttachment, attachment);
-			int vertexCount = 0;
-			path->closed = readBoolean(input);
-			path->constantSpeed = readBoolean(input);
-			vertexCount = readVarint(input, 1);
-			_readVertices(self, input, SUPER(path), vertexCount);
-			path->lengthsLength = vertexCount / 3;
-			path->lengths = MALLOC(float, path->lengthsLength);
-			for (i = 0; i < path->lengthsLength; ++i) {
-				path->lengths[i] = readFloat(input) * self->scale;
-			}
-			if (nonessential) readInt(input); /* Skip color. */
-			spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
-			return attachment;
+		attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, path);
+		mesh = SUB_CAST(spMeshAttachment, attachment);
+		mesh->path = path;
+		readColor(input, &mesh->color.r, &mesh->color.g, &mesh->color.b, &mesh->color.a);
+		skinName = readStringRef(input, skeletonData);
+		parent = readStringRef(input, skeletonData);
+		inheritDeform = readBoolean(input);
+		if (nonessential) {
+			mesh->width = readFloat(input) * self->scale;
+			mesh->height = readFloat(input) * self->scale;
 		}
-		case SP_ATTACHMENT_POINT: {
-			spAttachment* attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, 0);
-			spPointAttachment* point = SUB_CAST(spPointAttachment, attachment);
-			point->rotation = readFloat(input);
-			point->x = readFloat(input) * self->scale;
-			point->y = readFloat(input) * self->scale;
-
-			if (nonessential) {
-				readColor(input, &point->color.r, &point->color.g, &point->color.b, &point->color.a);
-			}
-			spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
-			return attachment;
+		_spSkeletonBinary_addLinkedMesh(self, mesh, skinName, slotIndex, parent, inheritDeform);
+		return attachment;
+	}
+	case SP_ATTACHMENT_PATH: {
+		spAttachment* attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, 0);
+		spPathAttachment* path = SUB_CAST(spPathAttachment, attachment);
+		int vertexCount = 0;
+		path->closed = readBoolean(input);
+		path->constantSpeed = readBoolean(input);
+		vertexCount = readVarint(input, 1);
+		_readVertices(self, input, SUPER(path), vertexCount);
+		path->lengthsLength = vertexCount / 3;
+		path->lengths = MALLOC(float, path->lengthsLength);
+		for (i = 0; i < path->lengthsLength; ++i) {
+			path->lengths[i] = readFloat(input) * self->scale;
 		}
-		case SP_ATTACHMENT_CLIPPING: {
-			int endSlotIndex = readVarint(input, 1);
-			int vertexCount = readVarint(input, 1);
-			spAttachment* attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, 0);
-			spClippingAttachment* clip = SUB_CAST(spClippingAttachment, attachment);
-			_readVertices(self, input, SUB_CAST(spVertexAttachment, attachment), vertexCount);
-			if (nonessential) readInt(input); /* Skip color. */
-			clip->endSlot = skeletonData->slots[endSlotIndex];
-			spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
-			return attachment;
+		if (nonessential) readInt(input); /* Skip color. */
+		spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
+		return attachment;
+	}
+	case SP_ATTACHMENT_POINT: {
+		spAttachment* attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, 0);
+		spPointAttachment* point = SUB_CAST(spPointAttachment, attachment);
+		point->rotation = readFloat(input);
+		point->x = readFloat(input) * self->scale;
+		point->y = readFloat(input) * self->scale;
+
+		if (nonessential) {
+			readColor(input, &point->color.r, &point->color.g, &point->color.b, &point->color.a);
 		}
+		spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
+		return attachment;
+	}
+	case SP_ATTACHMENT_CLIPPING: {
+		int endSlotIndex = readVarint(input, 1);
+		int vertexCount = readVarint(input, 1);
+		spAttachment* attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, name, 0);
+		spClippingAttachment* clip = SUB_CAST(spClippingAttachment, attachment);
+		_readVertices(self, input, SUB_CAST(spVertexAttachment, attachment), vertexCount);
+		if (nonessential) readInt(input); /* Skip color. */
+		clip->endSlot = skeletonData->slots[endSlotIndex];
+		spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
+		return attachment;
+	}
 	}
 
 	return 0;
@@ -942,11 +942,11 @@ spSkeletonData* spSkeletonBinary_readSkeletonData (spSkeletonBinary* self, const
 		data->length = readFloat(input) * self->scale;
 		mode = readVarint(input, 1);
 		switch (mode) {
-			case 0: data->transformMode = SP_TRANSFORMMODE_NORMAL; break;
-			case 1: data->transformMode = SP_TRANSFORMMODE_ONLYTRANSLATION; break;
-			case 2: data->transformMode = SP_TRANSFORMMODE_NOROTATIONORREFLECTION; break;
-			case 3: data->transformMode = SP_TRANSFORMMODE_NOSCALE; break;
-			case 4: data->transformMode = SP_TRANSFORMMODE_NOSCALEORREFLECTION; break;
+		case 0: data->transformMode = SP_TRANSFORMMODE_NORMAL; break;
+		case 1: data->transformMode = SP_TRANSFORMMODE_ONLYTRANSLATION; break;
+		case 2: data->transformMode = SP_TRANSFORMMODE_NOROTATIONORREFLECTION; break;
+		case 3: data->transformMode = SP_TRANSFORMMODE_NOSCALE; break;
+		case 4: data->transformMode = SP_TRANSFORMMODE_NOSCALEORREFLECTION; break;
 		}
 		data->skinRequired = readBoolean(input);
 		if (nonessential) readInt(input); /* Skip bone color. */

+ 5 - 2
spine-c/spine-c/src/spine/SkeletonBounds.c

@@ -166,8 +166,11 @@ int/*bool*/spSkeletonBounds_aabbContainsPoint (spSkeletonBounds* self, float x,
 
 int/*bool*/spSkeletonBounds_aabbIntersectsSegment (spSkeletonBounds* self, float x1, float y1, float x2, float y2) {
 	float m, x, y;
-	if ((x1 <= self->minX && x2 <= self->minX) || (y1 <= self->minY && y2 <= self->minY) || (x1 >= self->maxX && x2 >= self->maxX)
-			|| (y1 >= self->maxY && y2 >= self->maxY)) return 0;
+	if ((x1 <= self->minX && x2 <= self->minX)
+		|| (y1 <= self->minY && y2 <= self->minY)
+		|| (x1 >= self->maxX && x2 >= self->maxX)
+		|| (y1 >= self->maxY && y2 >= self->maxY)
+	) return 0;
 	m = (y2 - y1) / (x2 - x1);
 	y = m * (self->minX - x1) + y1;
 	if (y > self->minY && y < self->maxY) return 1;

+ 45 - 57
spine-c/spine-c/src/spine/SkeletonJson.c

@@ -93,8 +93,7 @@ static float toColor (const char* value, int index) {
 	char *error;
 	int color;
 
-	if ((size_t)index >= strlen(value) / 2)
-		return -1;
+	if ((size_t)index >= strlen(value) / 2) return -1;
 	value += index * 2;
 
 	digits[0] = *value;
@@ -120,7 +119,8 @@ static void readCurve (Json* frame, spCurveTimeline* timeline, int frameIndex) {
 }
 
 static void _spSkeletonJson_addLinkedMesh (spSkeletonJson* self, spMeshAttachment* mesh, const char* skin, int slotIndex,
-		const char* parent, int inheritDeform) {
+	const char* parent, int inheritDeform
+) {
 	_spLinkedMesh* linkedMesh;
 	_spSkeletonJson* internal = SUB_CAST(_spSkeletonJson, self);
 
@@ -195,7 +195,7 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
 				for (valueMap = timelineMap->child, frameIndex = 0; valueMap; valueMap = valueMap->next, ++frameIndex) {
 					Json* name = Json_getItem(valueMap, "name");
 					spAttachmentTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0),
-												  name->type == Json_NULL ? 0 : name->valueString);
+						name->type == Json_NULL ? 0 : name->valueString);
 				}
 				animation->timelines[animation->timelinesCount++] = SUPER_CAST(spTimeline, timeline);
 				animation->duration = MAX(animation->duration, timeline->frames[timelineMap->size - 1]);
@@ -206,8 +206,8 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
 
 				for (valueMap = timelineMap->child, frameIndex = 0; valueMap; valueMap = valueMap->next, ++frameIndex) {
 					const char* s = Json_getString(valueMap, "color", 0);
-					spColorTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), toColor(s, 0), toColor(s, 1), toColor(s, 2),
-							toColor(s, 3));
+					spColorTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), toColor(s, 0), toColor(s, 1),
+						toColor(s, 2), toColor(s, 3));
 					readCurve(valueMap, SUPER(timeline), frameIndex);
 				}
 				animation->timelines[animation->timelinesCount++] = SUPER_CAST(spTimeline, timeline);
@@ -221,7 +221,7 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
 					const char* s = Json_getString(valueMap, "light", 0);
 					const char* ds = Json_getString(valueMap, "dark", 0);
 					spTwoColorTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), toColor(s, 0), toColor(s, 1), toColor(s, 2),
-											 toColor(s, 3), toColor(ds, 0), toColor(ds, 1), toColor(ds, 2));
+						toColor(s, 3), toColor(ds, 0), toColor(ds, 1), toColor(ds, 2));
 					readCurve(valueMap, SUPER(timeline), frameIndex);
 				}
 				animation->timelines[animation->timelinesCount++] = SUPER_CAST(spTimeline, timeline);
@@ -275,8 +275,9 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
 					timeline->boneIndex = boneIndex;
 
 					for (valueMap = timelineMap->child, frameIndex = 0; valueMap; valueMap = valueMap->next, ++frameIndex) {
-						spTranslateTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), Json_getFloat(valueMap, "x", defaultValue) * timelineScale,
-								Json_getFloat(valueMap, "y", defaultValue) * timelineScale);
+						spTranslateTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0),
+							Json_getFloat(valueMap, "x", defaultValue) * timelineScale,
+							Json_getFloat(valueMap, "y", defaultValue) * timelineScale);
 						readCurve(valueMap, SUPER(timeline), frameIndex);
 					}
 					animation->timelines[animation->timelinesCount++] = SUPER_CAST(spTimeline, timeline);
@@ -641,16 +642,11 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 		data->shearY = Json_getFloat(boneMap, "shearY", 0);
 		transformMode = Json_getString(boneMap, "transform", "normal");
 		data->transformMode = SP_TRANSFORMMODE_NORMAL;
-		if (strcmp(transformMode, "normal") == 0)
-			data->transformMode = SP_TRANSFORMMODE_NORMAL;
-		if (strcmp(transformMode, "onlyTranslation") == 0)
-			data->transformMode = SP_TRANSFORMMODE_ONLYTRANSLATION;
-		if (strcmp(transformMode, "noRotationOrReflection") == 0)
-			data->transformMode = SP_TRANSFORMMODE_NOROTATIONORREFLECTION;
-		if (strcmp(transformMode, "noScale") == 0)
-			data->transformMode = SP_TRANSFORMMODE_NOSCALE;
-		if (strcmp(transformMode, "noScaleOrReflection") == 0)
-			data->transformMode = SP_TRANSFORMMODE_NOSCALEORREFLECTION;
+		if (strcmp(transformMode, "normal") == 0) data->transformMode = SP_TRANSFORMMODE_NORMAL;
+		else if (strcmp(transformMode, "onlyTranslation") == 0) data->transformMode = SP_TRANSFORMMODE_ONLYTRANSLATION;
+		else if (strcmp(transformMode, "noRotationOrReflection") == 0) data->transformMode = SP_TRANSFORMMODE_NOROTATIONORREFLECTION;
+		else if (strcmp(transformMode, "noScale") == 0) data->transformMode = SP_TRANSFORMMODE_NOSCALE;
+		else if (strcmp(transformMode, "noScaleOrReflection") == 0) data->transformMode = SP_TRANSFORMMODE_NOSCALEORREFLECTION;
 		data->skinRequired = Json_getInt(boneMap, "skin", 0) ? 1 : 0;
 
 		skeletonData->bones[i] = data;
@@ -682,20 +678,20 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 			color = Json_getString(slotMap, "color", 0);
 			if (color) {
 				spColor_setFromFloats(&data->color,
-									  toColor(color, 0),
-									  toColor(color, 1),
-									  toColor(color, 2),
-									  toColor(color, 3));
+					toColor(color, 0),
+					toColor(color, 1),
+					toColor(color, 2),
+					toColor(color, 3));
 			}
 
 			dark = Json_getString(slotMap, "dark", 0);
 			if (dark) {
 				data->darkColor = spColor_create();
 				spColor_setFromFloats(data->darkColor,
-									  toColor(dark, 0),
-									  toColor(dark, 1),
-									  toColor(dark, 2),
-									  toColor(dark, 3));
+					toColor(dark, 0),
+					toColor(dark, 1),
+					toColor(dark, 2),
+					toColor(dark, 3));
 			}
 
 			item = Json_getItem(slotMap, "attachment");
@@ -950,20 +946,13 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 
 					const char* typeString = Json_getString(attachmentMap, "type", "region");
 					spAttachmentType type;
-					if (strcmp(typeString, "region") == 0)
-						type = SP_ATTACHMENT_REGION;
-					else if (strcmp(typeString, "mesh") == 0)
-						type = SP_ATTACHMENT_MESH;
-					else if (strcmp(typeString, "linkedmesh") == 0)
-						type = SP_ATTACHMENT_LINKED_MESH;
-					else if (strcmp(typeString, "boundingbox") == 0)
-						type = SP_ATTACHMENT_BOUNDING_BOX;
-					else if (strcmp(typeString, "path") == 0)
-						type = SP_ATTACHMENT_PATH;
-					else if	(strcmp(typeString, "clipping") == 0)
-						type = SP_ATTACHMENT_CLIPPING;
-					else if	(strcmp(typeString, "point") == 0)
-						type = SP_ATTACHMENT_POINT;
+					if (strcmp(typeString, "region") == 0) type = SP_ATTACHMENT_REGION;
+					else if (strcmp(typeString, "mesh") == 0) type = SP_ATTACHMENT_MESH;
+					else if (strcmp(typeString, "linkedmesh") == 0) type = SP_ATTACHMENT_LINKED_MESH;
+					else if (strcmp(typeString, "boundingbox") == 0) type = SP_ATTACHMENT_BOUNDING_BOX;
+					else if (strcmp(typeString, "path") == 0) type = SP_ATTACHMENT_PATH;
+					else if	(strcmp(typeString, "clipping") == 0) type = SP_ATTACHMENT_CLIPPING;
+					else if	(strcmp(typeString, "point") == 0) type = SP_ATTACHMENT_POINT;
 					else {
 						spSkeletonData_dispose(skeletonData);
 						_spSkeletonJson_setError(self, root, "Unknown attachment type: ", typeString);
@@ -995,10 +984,10 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 						color = Json_getString(attachmentMap, "color", 0);
 						if (color) {
 							spColor_setFromFloats(&region->color,
-												  toColor(color, 0),
-												  toColor(color, 1),
-												  toColor(color, 2),
-												  toColor(color, 3));
+								toColor(color, 0),
+								toColor(color, 1),
+								toColor(color, 2),
+								toColor(color, 3));
 						}
 
 						spRegionAttachment_updateOffset(region);
@@ -1015,10 +1004,10 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 						color = Json_getString(attachmentMap, "color", 0);
 						if (color) {
 							spColor_setFromFloats(&mesh->color,
-												  toColor(color, 0),
-												  toColor(color, 1),
-												  toColor(color, 2),
-												  toColor(color, 3));
+								toColor(color, 0),
+								toColor(color, 1),
+								toColor(color, 2),
+								toColor(color, 3));
 						}
 
 						mesh->width = Json_getFloat(attachmentMap, "width", 32) * self->scale;
@@ -1056,8 +1045,8 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 							spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
 						} else {
 							int inheritDeform = Json_getInt(attachmentMap, "deform", 1);
-							_spSkeletonJson_addLinkedMesh(self, SUB_CAST(spMeshAttachment, attachment), Json_getString(attachmentMap, "skin", 0), slot->index,
-									entry->valueString, inheritDeform);
+							_spSkeletonJson_addLinkedMesh(self, SUB_CAST(spMeshAttachment, attachment),
+								Json_getString(attachmentMap, "skin", 0), slot->index, entry->valueString, inheritDeform);
 						}
 						break;
 					}
@@ -1081,9 +1070,8 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 						pathAttachment->lengths = MALLOC(float, pathAttachment->lengthsLength);
 
 						curves = Json_getItem(attachmentMap, "lengths");
-						for (curves = curves->child, ii = 0; curves; curves = curves->next, ++ii) {
+						for (curves = curves->child, ii = 0; curves; curves = curves->next, ++ii)
 							pathAttachment->lengths[ii] = curves->valueFloat * self->scale;
-						}
 						break;
 					}
 					case SP_ATTACHMENT_POINT: {
@@ -1095,10 +1083,10 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 						color = Json_getString(attachmentMap, "color", 0);
 						if (color) {
 							spColor_setFromFloats(&point->color,
-												  toColor(color, 0),
-												  toColor(color, 1),
-												  toColor(color, 2),
-												  toColor(color, 3));
+								toColor(color, 0),
+								toColor(color, 1),
+								toColor(color, 2),
+								toColor(color, 3));
 						}
 						break;
 					}

+ 1 - 1
spine-c/spine-c/src/spine/Skin.c

@@ -226,7 +226,7 @@ void spSkin_copySkin(spSkin* self, const spSkin* other) {
 
 	entry = spSkin_getAttachments(other);
 	while (entry) {
-		if  (entry->attachment->type == SP_ATTACHMENT_MESH) {
+		if (entry->attachment->type == SP_ATTACHMENT_MESH) {
 			spMeshAttachment* attachment = spMeshAttachment_newLinkedMesh(SUB_CAST(spMeshAttachment, entry->attachment));
 			spSkin_setAttachment(self, entry->slotIndex, entry->name, SUPER(SUPER(attachment)));
 		} else {

+ 1 - 1
spine-c/spine-c/src/spine/Slot.c

@@ -74,7 +74,7 @@ void spSlot_setToSetupPose (spSlot* self) {
 		spSlot_setAttachment(self, 0);
 	else {
 		spAttachment* attachment = spSkeleton_getAttachmentForSlotIndex(
-				self->bone->skeleton, self->data->index, self->data->attachmentName);
+			self->bone->skeleton, self->data->index, self->data->attachmentName);
 		CONST_CAST(spAttachment*, self->attachment) = 0;
 		spSlot_setAttachment(self, attachment);
 	}

+ 3 - 3
spine-c/spine-c/src/spine/Triangulator.c

@@ -115,9 +115,9 @@ static int _isConcave(int index, int vertexCount, float* vertices, short* indice
 	int previous = indices[(vertexCount + index - 1) % vertexCount] << 1;
 	int current = indices[index] << 1;
 	int next = indices[(index + 1) % vertexCount] << 1;
-	return !_positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1],
-						 vertices[next],
-						 vertices[next + 1]);
+	return !_positiveArea(vertices[previous], vertices[previous + 1],
+		vertices[current], vertices[current + 1],
+		vertices[next], vertices[next + 1]);
 }
 
 static int _winding (float p1x, float p1y, float p2x, float p2y, float p3x, float p3y) {

+ 28 - 28
spine-cocos2d-objc/src/spine/GLUtils.c

@@ -44,7 +44,7 @@
 
 #include <stdio.h>
 
-#define STRINGIFY(A)  #A
+#define STRINGIFY(A) #A
 #define MAX_VERTICES 64000
 #define MAX_INDICES 64000
 
@@ -76,7 +76,7 @@ const char* TWO_COLOR_TINT_FRAGMENT_SHADER = STRINGIFY(
 \n#ifdef GL_ES\n
 precision lowp float;
 \n#endif\n
-													   
+
 uniform sampler2D texture;
 
 varying vec4 v_light;
@@ -84,10 +84,10 @@ varying vec4 v_dark;
 varying vec2 v_texCoord;
 
 void main() {
-   vec4 texColor = texture2D(texture, v_texCoord);
-   float alpha = texColor.a * v_light.a;
-   gl_FragColor.a = alpha;
-   gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;
+	vec4 texColor = texture2D(texture, v_texCoord);
+	float alpha = texColor.a * v_light.a;
+	gl_FragColor.a = alpha;
+	gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;
 }
 );
 
@@ -111,7 +111,7 @@ void spMesh_allocatePart(spMesh* mesh, spMeshPart* part, uint32_t numVertices, u
 		mesh->numIndices = mesh->numAllocatedIndices + numIndices;
 		mesh->indices = REALLOC(mesh->indices, unsigned short, mesh->numIndices);
 	}
-	
+
 	part->mesh = mesh;
 	part->startVertex = mesh->numAllocatedVertices;
 	part->numIndices = numIndices;
@@ -120,7 +120,7 @@ void spMesh_allocatePart(spMesh* mesh, spMeshPart* part, uint32_t numVertices, u
 	part->textureHandle = textureHandle;
 	part->srcBlend = srcBlend;
 	part->dstBlend = dstBlend;
-	
+
 	mesh->numAllocatedVertices += numVertices;
 	mesh->numAllocatedIndices += numIndices;
 }
@@ -161,19 +161,19 @@ GLuint compileShader(GLenum shaderType, const char* shaderSource) {
 spShader* spShader_create(const char* vertexShaderSource, const char* fragmentShaderSource) {
 	GLuint vertexShader = compileShader(GL_VERTEX_SHADER, vertexShaderSource);
 	GLuint fragmentShader = compileShader(GL_FRAGMENT_SHADER, fragmentShaderSource);
-	
+
 	GLuint program = glCreateProgram();
 	glAttachShader(program, vertexShader);
 	glAttachShader(program, fragmentShader);
 	glLinkProgram(program);
-	
+
 	GLint status;
 	glGetProgramiv(program, GL_LINK_STATUS, &status);
 	if (!status) {
 		printf("Unknown error while linking program\n");
 		exit(-1);
 	}
-	
+
 	spShader* shader = MALLOC(spShader, 1);
 	shader->program = program;
 	shader->vertexShader = vertexShader;
@@ -190,14 +190,14 @@ void spShader_dispose(spShader* shader) {
 
 spTwoColorBatcher* spTwoColorBatcher_create() {
 	spTwoColorBatcher* batcher = MALLOC(spTwoColorBatcher, 1);
-	
+
 	batcher->shader = spShader_create(TWO_COLOR_TINT_VERTEX_SHADER, TWO_COLOR_TINT_FRAGMENT_SHADER);
 	batcher->positionAttributeLocation = glGetAttribLocation(batcher->shader->program, "a_position");
 	batcher->colorAttributeLocation = glGetAttribLocation(batcher->shader->program, "a_color");
 	batcher->color2AttributeLocation = glGetAttribLocation(batcher->shader->program, "a_color2");
 	batcher->texCoordsAttributeLocation = glGetAttribLocation(batcher->shader->program, "a_texCoords");
 	batcher->textureUniformLocation = glGetUniformLocation(batcher->shader->program, "texture");
-	
+
 	glGenBuffers(1, &batcher->vertexBufferHandle);
 	glGenBuffers(1, &batcher->indexBufferHandle);
 	batcher->verticesBuffer = MALLOC(spVertex, MAX_VERTICES);
@@ -214,20 +214,20 @@ void spTwoColorBatcher_add(spTwoColorBatcher* batcher, spMeshPart mesh) {
 	if (batcher->numVertices + mesh.numVertices > MAX_VERTICES || batcher->numIndices + mesh.numIndices > MAX_INDICES) {
 		spTwoColorBatcher_flush(batcher);
 	}
-	
+
 	if (batcher->lastTextureHandle != mesh.textureHandle || batcher->lastSrcBlend != mesh.srcBlend || batcher->lastDstBlend != mesh.dstBlend) {
 		spTwoColorBatcher_flush(batcher);
 	}
-	
+
 	spVertex* vertices = &batcher->verticesBuffer[batcher->numVertices];
 	unsigned short* indices = &batcher->indicesBuffer[batcher->numIndices];
-	
+
 	memcpy(vertices, &mesh.mesh->vertices[mesh.startVertex], mesh.numVertices * sizeof(spVertex));
 	unsigned short offset = (unsigned short)batcher->numVertices;
 	for (int i = 0, j = mesh.startIndex, n = mesh.numIndices; i < n; i++, j++) {
 		indices[i] = mesh.mesh->indices[j] + offset;
 	}
-	
+
 	batcher->numIndices += mesh.numIndices;
 	batcher->numVertices += mesh.numVertices;
 	batcher->lastSrcBlend = mesh.srcBlend;
@@ -238,39 +238,39 @@ void spTwoColorBatcher_add(spTwoColorBatcher* batcher, spMeshPart mesh) {
 void spTwoColorBatcher_flush(spTwoColorBatcher* batcher) {
 	if (batcher->numVertices == 0 || batcher->numIndices == 0)
 		return;
-	
+
 	glUseProgram(batcher->shader->program);
-		
+
 	glActiveTexture(GL_TEXTURE0);
 	glBindTexture(GL_TEXTURE_2D, batcher->lastTextureHandle);
 	glUniform1i(batcher->textureUniformLocation, 0);
-	
+
 	glBlendFunc(batcher->lastSrcBlend, batcher->lastDstBlend);
-	
+
 	glBindBuffer(GL_ARRAY_BUFFER, batcher->vertexBufferHandle);
 	glBufferData(GL_ARRAY_BUFFER, sizeof(spVertex) * batcher->numVertices , batcher->verticesBuffer, GL_DYNAMIC_DRAW);
-	
+
 	glEnableVertexAttribArray(batcher->positionAttributeLocation);
 	glEnableVertexAttribArray(batcher->colorAttributeLocation);
 	glEnableVertexAttribArray(batcher->color2AttributeLocation);
 	glEnableVertexAttribArray(batcher->texCoordsAttributeLocation);
-	
+
 	glVertexAttribPointer(batcher->positionAttributeLocation, 4, GL_FLOAT, GL_FALSE, sizeof(spVertex), (GLvoid*)offsetof(spVertex, x));
 	glVertexAttribPointer(batcher->colorAttributeLocation, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(spVertex), (GLvoid*)offsetof(spVertex, color));
 	glVertexAttribPointer(batcher->color2AttributeLocation, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(spVertex), (GLvoid*)offsetof(spVertex, color2));
 	glVertexAttribPointer(batcher->texCoordsAttributeLocation, 2, GL_FLOAT, GL_FALSE, sizeof(spVertex), (GLvoid*)offsetof(spVertex, u));
-	
+
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, batcher->indexBufferHandle);
 	glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned short) * batcher->numIndices, batcher->indicesBuffer, GL_STATIC_DRAW);
-	
+
 	glDrawElements(GL_TRIANGLES, (GLsizei)batcher->numIndices, GL_UNSIGNED_SHORT, 0);
-	
+
 	glBindBuffer(GL_ARRAY_BUFFER, 0);
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
-	
+
 	glUseProgram(0);
 	glBindTexture(GL_TEXTURE_2D, 0);
-	
+
 	batcher->numIndices = 0;
 	batcher->numVertices = 0;
 	batcher->lastSrcBlend = -1;

+ 4 - 4
spine-cocos2d-objc/src/spine/GLUtils.h

@@ -75,21 +75,21 @@ void spShader_dispose(spShader* shader);
 
 typedef struct spTwoColorBatcher {
 	spShader* shader;
-	
+
 	uint32_t vertexBufferHandle;
 	spVertex* verticesBuffer;
 	uint32_t numVertices;
-	
+
 	uint32_t indexBufferHandle;
 	unsigned short* indicesBuffer;
 	uint32_t numIndices;
-	
+
 	int32_t positionAttributeLocation;
 	int32_t colorAttributeLocation;
 	int32_t color2AttributeLocation;
 	int32_t texCoordsAttributeLocation;
 	int32_t textureUniformLocation;
-	
+
 	uint32_t lastTextureHandle;
 	uint32_t lastSrcBlend;
 	uint32_t lastDstBlend;

+ 2 - 2
spine-cocos2d-objc/src/spine/SkeletonAnimation.h

@@ -48,9 +48,9 @@ typedef void(^spEventListener)(spTrackEntry* entry, spEvent* event);
 	float _timeScale;
 
 	spStartListener _startListener;
-    spInterruptListener _interruptListener;
+	spInterruptListener _interruptListener;
 	spEndListener _endListener;
-    spDisposeListener _disposeListener;
+	spDisposeListener _disposeListener;
 	spCompleteListener _completeListener;
 	spEventListener _eventListener;
 }

+ 7 - 7
spine-cocos2d-objc/src/spine/SkeletonAnimation.m

@@ -107,27 +107,27 @@ static _TrackEntryListeners* getListeners (spTrackEntry* entry) {
 - (id) initWithData:(spSkeletonData*)skeletonData ownsSkeletonData:(bool)ownsSkeletonData {
 	self = [super initWithData:skeletonData ownsSkeletonData:ownsSkeletonData];
 	if (!self) return nil;
-	
+
 	[self initialize];
-	
+
 	return self;
 }
 
 - (id) initWithFile:(NSString*)skeletonDataFile atlas:(spAtlas*)atlas scale:(float)scale {
 	self = [super initWithFile:skeletonDataFile atlas:atlas scale:scale];
 	if (!self) return nil;
-	
+
 	[self initialize];
-	
+
 	return self;
 }
 
 - (id) initWithFile:(NSString*)skeletonDataFile atlasFile:(NSString*)atlasFile scale:(float)scale {
 	self = [super initWithFile:skeletonDataFile atlasFile:atlasFile scale:scale];
 	if (!self) return nil;
-	
+
 	[self initialize];
-	
+
 	return self;
 }
 
@@ -155,7 +155,7 @@ static _TrackEntryListeners* getListeners (spTrackEntry* entry) {
 
 - (void) setAnimationStateData:(spAnimationStateData*)stateData {
 	NSAssert(stateData, @"stateData cannot be null.");
-	
+
 	if (_ownsAnimationStateData) spAnimationStateData_dispose(_state->data);
 	spAnimationState_dispose(_state);
 

+ 1 - 1
spine-cocos2d-objc/src/spine/SkeletonRenderer.h

@@ -38,7 +38,7 @@
 	bool _debugBones;
 	bool _premultipliedAlpha;
 	bool _twoColorTint;
-    bool _skipVisibilityCheck;
+	bool _skipVisibilityCheck;
 	ccBlendFunc _blendFunc;
 	CCDrawNode* _drawNode;
 	bool _ownsSkeletonData;

+ 22 - 22
spine-cocos2d-objc/src/spine/SkeletonRenderer.m

@@ -68,7 +68,7 @@ static bool handlerQueued = false;
 		batcher = spTwoColorBatcher_create();
 		mesh = spMesh_create(64000, 32000);
 	}
-	
+
 	_ownsSkeletonData = ownsSkeletonData;
 
 	_worldVertices = MALLOC(float, 1000); // Max number of vertices per mesh.
@@ -81,7 +81,7 @@ static bool handlerQueued = false;
 	_drawNode = [[CCDrawNode alloc] init];
 	[_drawNode setBlendMode: [CCBlendMode premultipliedAlphaMode]];
 	[self addChild:_drawNode];
-	
+
 	[self setShader:[CCShader positionTextureColorShader]];
 
 	_premultipliedAlpha = true;
@@ -89,7 +89,7 @@ static bool handlerQueued = false;
 		CCBlendFuncSrcColor: @(GL_ONE),
 		CCBlendFuncDstColor: @(GL_ONE_MINUS_SRC_COLOR)}
 	];
-	
+
 	_clipper = spSkeletonClipping_create();
 	_effect = 0;
 }
@@ -167,15 +167,15 @@ static bool handlerQueued = false;
 	// notification system that may break if the block is called on a
 	// separate thread.
 	if (!handlerQueued) {
-		[[CCDirector sharedDirector] addFrameCompletionHandler: ^{			
+		[[CCDirector sharedDirector] addFrameCompletionHandler: ^{
 			spMesh_clearParts(mesh);
 			handlerQueued = false;
 		}];
 		handlerQueued = true;
 	}
-	
+
 	if (_effect) _effect->begin(_effect, _skeleton);
-	
+
 	CCColor* nodeColor = self.color;
 	_skeleton->color.r = nodeColor.red;
 	_skeleton->color.g = nodeColor.green;
@@ -232,7 +232,7 @@ static bool handlerQueued = false;
 		}
 		default: ;
 		}
-		
+
 		if (texture) {
 			if (slot->data->blendMode != blendMode) {
 				blendMode = slot->data->blendMode;
@@ -283,9 +283,9 @@ static bool handlerQueued = false;
 				GLKVector2 extents = GLKVector2Make((maxX - minX) / 2, (maxY - minY) / 2);
 				isVisible = CCRenderCheckVisbility(transform, center, extents);
 			}
-			
+
 			if (isVisible) {
-				
+
 				if (spSkeletonClipping_isClipping(_clipper)) {
 					spSkeletonClipping_clipTriangles(_clipper, vertices, verticesCount, triangles, trianglesCount, uvs, 2);
 					vertices = _clipper->clippedVertices->items;
@@ -294,7 +294,7 @@ static bool handlerQueued = false;
 					triangles = _clipper->clippedTriangles->items;
 					trianglesCount = _clipper->clippedTriangles->size;
 				}
-				
+
 				if (trianglesCount > 0) {
 					if (!self.twoColorTint) {
 						CCRenderBuffer buffer = [renderer enqueueTriangles:(trianglesCount / 3) andVertexes:verticesCount withState:self.renderState globalSortOrder:0];
@@ -330,13 +330,13 @@ static bool handlerQueued = false;
 						} else {
 							dr = dg = db = 0;
 						}
-						
+
 						spMeshPart meshPart;
 						spMesh_allocatePart(mesh, &meshPart, verticesCount / 2, trianglesCount, self.texture.name, srcBlend, dstBlend);
-						
+
 						spVertex* verts = &meshPart.mesh->vertices[meshPart.startVertex];
 						unsigned short* indices = &meshPart.mesh->indices[meshPart.startIndex];
-						
+
 						if (_effect) {
 							spColor light;
 							light.r = r;
@@ -351,13 +351,13 @@ static bool handlerQueued = false;
 							for (int i = 0; i * 2 < verticesCount; i++, verts++) {
 								spColor lightCopy = light;
 								spColor darkCopy = dark;
-								
+
 								CCVertex vertex;
 								vertex.position = GLKVector4Make(vertices[i * 2], vertices[i * 2 + 1], 0.0, 1.0);
 								verts->u = uvs[i * 2];
 								verts->v = 1 - uvs[i * 2 + 1];
 								_effect->transform(_effect, &vertex.position.x, &vertex.position.y, &verts->u, &verts->v, &lightCopy, &darkCopy);
-								
+
 								vertex = CCVertexApplyTransform(vertex, transform);
 								verts->x = vertex.position.x;
 								verts->y = vertex.position.y;
@@ -365,7 +365,7 @@ static bool handlerQueued = false;
 								verts->w = vertex.position.w;
 								verts->color = ((unsigned short)(lightCopy.r * 255))| ((unsigned short)(lightCopy.g * 255)) << 8 | ((unsigned short)(lightCopy.b * 255)) <<16 | ((unsigned short)(lightCopy.a * 255)) << 24;
 								verts->color2 = ((unsigned short)(darkCopy.r * 255)) | ((unsigned short)(darkCopy.g * 255)) << 8 | ((unsigned short)(darkCopy.b * 255)) << 16 | ((unsigned short)(darkCopy.a * 255)) << 24;
-								
+
 							}
 						} else {
 							for (int i = 0; i * 2 < verticesCount; i++, verts++) {
@@ -382,11 +382,11 @@ static bool handlerQueued = false;
 								verts->v = 1 - uvs[i * 2 + 1];
 							}
 						}
-						
+
 						for (int j = 0; j < trianglesCount; j++, indices++) {
 							*indices = triangles[j];
 						}
-						
+
 						[renderer enqueueBlock:^{
 							spTwoColorBatcher_add(batcher, meshPart);
 						} globalSortOrder:0 debugLabel: nil threadSafe: false];
@@ -397,13 +397,13 @@ static bool handlerQueued = false;
 		spSkeletonClipping_clipEnd(_clipper, slot);
 	}
 	spSkeletonClipping_clipEnd2(_clipper);
-	
+
 	if (self.twoColorTint) {
 		[renderer enqueueBlock:^{
 			spTwoColorBatcher_flush(batcher);
 		} globalSortOrder:0 debugLabel: nil threadSafe: false];
 	}
-	
+
 	[_drawNode clear];
 	if (_debugSlots) {
 		// Slots.
@@ -430,7 +430,7 @@ static bool handlerQueued = false;
 			float y = bone->data->length * bone->c + bone->worldY;
 			[_drawNode drawSegmentFrom:ccp(bone->worldX, bone->worldY) to: ccp(x, y)radius:2 color:[CCColor redColor]];
 		}
-		
+
 		// Bone origins.
 		for (int i = 0, n = _skeleton->bonesCount; i < n; i++) {
 			spBone *bone = _skeleton->bones[i];
@@ -439,7 +439,7 @@ static bool handlerQueued = false;
 			if (i == 0) [_drawNode drawDot:ccp(bone->worldX, bone->worldY) radius:4 color:[CCColor blueColor]];
 		}
 	}
-	
+
 	if (_effect) _effect->end(_effect);
 }
 

+ 33 - 32
spine-cocos2dx/src/spine/SkeletonAnimation.cpp

@@ -40,25 +40,26 @@ using std::vector;
 namespace spine {
 
 typedef struct _TrackEntryListeners {
-    StartListener startListener;
-    InterruptListener interruptListener;
-    EndListener endListener;
-    DisposeListener disposeListener;
-    CompleteListener completeListener;
-    EventListener eventListener;
+	StartListener startListener;
+	InterruptListener interruptListener;
+	EndListener endListener;
+	DisposeListener disposeListener;
+	CompleteListener completeListener;
+	EventListener eventListener;
 } _TrackEntryListeners;
-    
+
 void animationCallback (AnimationState* state, EventType type, TrackEntry* entry, Event* event) {
 	((SkeletonAnimation*)state->getRendererObject())->onAnimationStateEvent(entry, type, event);
 }
 
 void trackEntryCallback (AnimationState* state, EventType type, TrackEntry* entry, Event* event) {
 	((SkeletonAnimation*)state->getRendererObject())->onTrackEntryEvent(entry, type, event);
-    if (type == EventType_Dispose)
+	if (type == EventType_Dispose) {
 		if (entry->getRendererObject()) {
 			delete (spine::_TrackEntryListeners*)entry->getRendererObject();
 			entry->setRendererObject(NULL);
 		}
+	}
 }
 
 static _TrackEntryListeners* getListeners (TrackEntry* entry) {
@@ -68,7 +69,7 @@ static _TrackEntryListeners* getListeners (TrackEntry* entry) {
 	}
 	return (_TrackEntryListeners*)entry->getRendererObject();
 }
-    
+
 //
 
 SkeletonAnimation* SkeletonAnimation::createWithData (SkeletonData* skeletonData, bool ownsSkeletonData) {
@@ -150,7 +151,7 @@ void SkeletonAnimation::draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &t
 void SkeletonAnimation::setAnimationStateData (AnimationStateData* stateData) {
 	CCASSERT(stateData, "stateData cannot be null.");
 
-    if (_ownsAnimationStateData) delete _state->getData();
+	if (_ownsAnimationStateData) delete _state->getData();
 	delete _state;
 
 	_ownsAnimationStateData = false;
@@ -180,7 +181,7 @@ TrackEntry* SkeletonAnimation::addAnimation (int trackIndex, const std::string&
 	}
 	return _state->addAnimation(trackIndex, animation, loop, delay);
 }
-	
+
 TrackEntry* SkeletonAnimation::setEmptyAnimation (int trackIndex, float mixDuration) {
 	return _state->setEmptyAnimation(trackIndex, mixDuration);
 }
@@ -214,15 +215,15 @@ void SkeletonAnimation::onAnimationStateEvent (TrackEntry* entry, EventType type
 	case EventType_Start:
 		if (_startListener) _startListener(entry);
 		break;
-    case EventType_Interrupt:
-        if (_interruptListener) _interruptListener(entry);
-        break;
+	case EventType_Interrupt:
+		if (_interruptListener) _interruptListener(entry);
+		break;
 	case EventType_End:
 		if (_endListener) _endListener(entry);
 		break;
-    case EventType_Dispose:
-        if (_disposeListener) _disposeListener(entry);
-        break;
+	case EventType_Dispose:
+		if (_disposeListener) _disposeListener(entry);
+		break;
 	case EventType_Complete:
 		if (_completeListener) _completeListener(entry);
 		break;
@@ -239,15 +240,15 @@ void SkeletonAnimation::onTrackEntryEvent (TrackEntry* entry, EventType type, Ev
 	case EventType_Start:
 		if (listeners->startListener) listeners->startListener(entry);
 		break;
-    case EventType_Interrupt:
-        if (listeners->interruptListener) listeners->interruptListener(entry);
-        break;
+	case EventType_Interrupt:
+		if (listeners->interruptListener) listeners->interruptListener(entry);
+		break;
 	case EventType_End:
 		if (listeners->endListener) listeners->endListener(entry);
 		break;
-    case EventType_Dispose:
-        if (listeners->disposeListener) listeners->disposeListener(entry);
-        break;
+	case EventType_Dispose:
+		if (listeners->disposeListener) listeners->disposeListener(entry);
+		break;
 	case EventType_Complete:
 		if (listeners->completeListener) listeners->completeListener(entry);
 		break;
@@ -260,17 +261,17 @@ void SkeletonAnimation::onTrackEntryEvent (TrackEntry* entry, EventType type, Ev
 void SkeletonAnimation::setStartListener (const StartListener& listener) {
 	_startListener = listener;
 }
-    
+
 void SkeletonAnimation::setInterruptListener (const InterruptListener& listener) {
-    _interruptListener = listener;
+	_interruptListener = listener;
 }
-    
+
 void SkeletonAnimation::setEndListener (const EndListener& listener) {
 	_endListener = listener;
 }
-    
+
 void SkeletonAnimation::setDisposeListener (const DisposeListener& listener) {
-    _disposeListener = listener;
+	_disposeListener = listener;
 }
 
 void SkeletonAnimation::setCompleteListener (const CompleteListener& listener) {
@@ -284,17 +285,17 @@ void SkeletonAnimation::setEventListener (const EventListener& listener) {
 void SkeletonAnimation::setTrackStartListener (TrackEntry* entry, const StartListener& listener) {
 	getListeners(entry)->startListener = listener;
 }
-    
+
 void SkeletonAnimation::setTrackInterruptListener (TrackEntry* entry, const InterruptListener& listener) {
-    getListeners(entry)->interruptListener = listener;
+	getListeners(entry)->interruptListener = listener;
 }
 
 void SkeletonAnimation::setTrackEndListener (TrackEntry* entry, const EndListener& listener) {
 	getListeners(entry)->endListener = listener;
 }
-    
+
 void SkeletonAnimation::setTrackDisposeListener (TrackEntry* entry, const DisposeListener& listener) {
-    getListeners(entry)->disposeListener = listener;
+	getListeners(entry)->disposeListener = listener;
 }
 
 void SkeletonAnimation::setTrackCompleteListener (TrackEntry* entry, const CompleteListener& listener) {

+ 6 - 6
spine-cocos2dx/src/spine/SkeletonAnimation.h

@@ -82,16 +82,16 @@ public:
 	void clearTrack (int trackIndex = 0);
 
 	void setStartListener (const StartListener& listener);
-    void setInterruptListener (const InterruptListener& listener);
+	void setInterruptListener (const InterruptListener& listener);
 	void setEndListener (const EndListener& listener);
-    void setDisposeListener (const DisposeListener& listener);
+	void setDisposeListener (const DisposeListener& listener);
 	void setCompleteListener (const CompleteListener& listener);
 	void setEventListener (const EventListener& listener);
 
 	void setTrackStartListener (TrackEntry* entry, const StartListener& listener);
-    void setTrackInterruptListener (TrackEntry* entry, const InterruptListener& listener);
+	void setTrackInterruptListener (TrackEntry* entry, const InterruptListener& listener);
 	void setTrackEndListener (TrackEntry* entry, const EndListener& listener);
-    void setTrackDisposeListener (TrackEntry* entry, const DisposeListener& listener);
+	void setTrackDisposeListener (TrackEntry* entry, const DisposeListener& listener);
 	void setTrackCompleteListener (TrackEntry* entry, const CompleteListener& listener);
 	void setTrackEventListener (TrackEntry* entry, const EventListener& listener);
 
@@ -114,9 +114,9 @@ protected:
 	bool _firstDraw;
 
 	StartListener _startListener;
-    InterruptListener _interruptListener;
+	InterruptListener _interruptListener;
 	EndListener _endListener;
-    DisposeListener _disposeListener;
+	DisposeListener _disposeListener;
 	CompleteListener _completeListener;
 	EventListener _eventListener;
 

+ 11 - 11
spine-cocos2dx/src/spine/SkeletonBatch.cpp

@@ -56,9 +56,9 @@ SkeletonBatch::SkeletonBatch () {
 	for (unsigned int i = 0; i < INITIAL_SIZE; i++) {
 		_commandsPool.push_back(new TrianglesCommand());
 	}
-	
+
 	reset ();
-		
+
 	// callback after drawing is finished so we can clear out the batch state
 	// for the next frame
 	Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom* eventCustom){
@@ -68,7 +68,7 @@ SkeletonBatch::SkeletonBatch () {
 
 SkeletonBatch::~SkeletonBatch () {
 	Director::getInstance()->getEventDispatcher()->removeCustomEventListeners(EVENT_AFTER_DRAW_RESET_POSITION);
-	
+
 	for (unsigned int i = 0; i < _commandsPool.size(); i++) {
 		delete _commandsPool[i];
 		_commandsPool[i] = nullptr;
@@ -78,7 +78,7 @@ SkeletonBatch::~SkeletonBatch () {
 void SkeletonBatch::update (float delta) {
 	reset();
 }
-	
+
 cocos2d::V3F_C4B_T2F* SkeletonBatch::allocateVertices(uint32_t numVertices) {
 	if (_vertices.size() - _numVertices < numVertices) {
 		cocos2d::V3F_C4B_T2F* oldData = _vertices.data();
@@ -90,18 +90,18 @@ cocos2d::V3F_C4B_T2F* SkeletonBatch::allocateVertices(uint32_t numVertices) {
 			triangles.verts = newData + (triangles.verts - oldData);
 		}
 	}
-	
+
 	cocos2d::V3F_C4B_T2F* vertices = _vertices.data() + _numVertices;
 	_numVertices += numVertices;
 	return vertices;
 }
-	
+
 void SkeletonBatch::deallocateVertices(uint32_t numVertices) {
 	_numVertices -= numVertices;
 }
 
-	
-unsigned short* SkeletonBatch::allocateIndices(uint32_t numIndices) {	
+
+unsigned short* SkeletonBatch::allocateIndices(uint32_t numIndices) {
 	if (_indices.getCapacity() - _indices.size() < numIndices) {
 		unsigned short* oldData = _indices.buffer();
 		int oldSize = _indices.size();
@@ -115,7 +115,7 @@ unsigned short* SkeletonBatch::allocateIndices(uint32_t numIndices) {
 			}
 		}
 	}
-	
+
 	unsigned short* indices = _indices.buffer() + _indices.size();
 	_indices.setSize(_indices.size() + numIndices, 0);
 	return indices;
@@ -125,7 +125,7 @@ void SkeletonBatch::deallocateIndices(uint32_t numIndices) {
 	_indices.setSize(_indices.size() - numIndices, 0);
 }
 
-	
+
 cocos2d::TrianglesCommand* SkeletonBatch::addCommand(cocos2d::Renderer* renderer, float globalOrder, cocos2d::Texture2D* texture, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles& triangles, const cocos2d::Mat4& mv, uint32_t flags) {
 	TrianglesCommand* command = nextFreeCommand();
 	command->init(globalOrder, texture, glProgramState, blendType, triangles, mv, flags);
@@ -142,7 +142,7 @@ void SkeletonBatch::reset() {
 cocos2d::TrianglesCommand* SkeletonBatch::nextFreeCommand() {
 	if (_commandsPool.size() <= _nextFreeCommand) {
 		unsigned int newSize = _commandsPool.size() * 2 + 1;
-		for (int i = _commandsPool.size();  i < newSize; i++) {
+		for (int i = _commandsPool.size(); i < newSize; i++) {
 			_commandsPool.push_back(new TrianglesCommand());
 		}
 	}

+ 20 - 20
spine-cocos2dx/src/spine/SkeletonBatch.h

@@ -35,41 +35,41 @@
 #include <vector>
 
 namespace spine {
-    
-    class SkeletonBatch {
-    public:
-        static SkeletonBatch* getInstance ();
-        
-        static void destroyInstance ();
-        
-        void update (float delta);
-		
+
+	class SkeletonBatch {
+	public:
+		static SkeletonBatch* getInstance ();
+
+		static void destroyInstance ();
+
+		void update (float delta);
+
 		cocos2d::V3F_C4B_T2F* allocateVertices(uint32_t numVertices);
 		void deallocateVertices(uint32_t numVertices);
 		unsigned short* allocateIndices(uint32_t numIndices);
 		void deallocateIndices(uint32_t numVertices);
 		cocos2d::TrianglesCommand* addCommand(cocos2d::Renderer* renderer, float globalOrder, cocos2d::Texture2D* texture, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles& triangles, const cocos2d::Mat4& mv, uint32_t flags);
-        
-    protected:
-        SkeletonBatch ();
-        virtual ~SkeletonBatch ();
-		
+
+	protected:
+		SkeletonBatch ();
+		virtual ~SkeletonBatch ();
+
 		void reset ();
-		
+
 		cocos2d::TrianglesCommand* nextFreeCommand ();
-		
+
 		// pool of commands
 		std::vector<cocos2d::TrianglesCommand*> _commandsPool;
 		uint32_t _nextFreeCommand;
-		
+
 		// pool of vertices
 		std::vector<cocos2d::V3F_C4B_T2F> _vertices;
 		uint32_t _numVertices;
-		
+
 		// pool of indices
 		Vector<unsigned short> _indices;
-    };
-	
+	};
+
 }
 
 #endif // SPINE_SKELETONBATCH_H_

+ 51 - 51
spine-cocos2dx/src/spine/SkeletonRenderer.cpp

@@ -52,7 +52,7 @@ namespace spine {
 			Color4B ColorToColor4B(const Color& color);
 		bool slotIsOutRange(Slot& slot, int startSlotIndex, int endSlotIndex);
 	}
- 
+
 // C Variable length array
 #ifdef _MSC_VER
 	// VLA not supported, use _malloca
@@ -71,7 +71,7 @@ namespace spine {
 		node->autorelease();
 		return node;
 	}
-	
+
 	SkeletonRenderer* SkeletonRenderer::createWithData (SkeletonData* skeletonData, bool ownsSkeletonData) {
 		SkeletonRenderer* node = new SkeletonRenderer(skeletonData, ownsSkeletonData);
 		node->autorelease();
@@ -101,13 +101,13 @@ namespace spine {
 		_skeleton->setToSetupPose();
 		_skeleton->updateWorldTransform();
 	}
-	
+
 	void SkeletonRenderer::setupGLProgramState (bool twoColorTintEnabled) {
 		if (twoColorTintEnabled) {
 			setGLProgramState(SkeletonTwoColorBatch::getInstance()->getTwoColorTintProgramState());
 			return;
 		}
-	
+
 		Texture2D *texture = nullptr;
 		for (int i = 0, n = _skeleton->getSlots().size(); i < n; i++) {
 			Slot* slot = _skeleton->getDrawOrder()[i];
@@ -123,7 +123,7 @@ namespace spine {
 			else {
 				continue;
 			}
-		
+
 			if (texture != nullptr) {
 				break;
 			}
@@ -139,7 +139,7 @@ namespace spine {
 	SkeletonRenderer::SkeletonRenderer ()
 		: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _timeScale(1), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) {
 	}
-	
+
 	SkeletonRenderer::SkeletonRenderer(Skeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData, bool ownsAtlas)
 		: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _timeScale(1), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) {
 		initWithSkeleton(skeleton, ownsSkeleton, ownsSkeletonData, ownsAtlas);
@@ -164,7 +164,7 @@ namespace spine {
 		if (_ownsSkeletonData) delete _skeleton->getData();
 		if (_ownsSkeleton) delete _skeleton;
 		if (_ownsAtlas) delete _atlas;
-		delete _attachmentLoader;	
+		delete _attachmentLoader;
 		delete _clipper;
 	}
 
@@ -175,7 +175,7 @@ namespace spine {
 		_ownsAtlas = ownsAtlas;
 		initialize();
 	}
-	
+
 	void SkeletonRenderer::initWithData (SkeletonData* skeletonData, bool ownsSkeletonData) {
 		_ownsSkeleton = true;
 		setSkeletonData(skeletonData, ownsSkeletonData);
@@ -207,34 +207,34 @@ namespace spine {
 		json.setScale(scale);
 		SkeletonData* skeletonData = json.readSkeletonDataFile(skeletonDataFile.c_str());
 		CCASSERT(skeletonData, !json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data.");
-  
+
 		_ownsSkeleton = true;
 		_ownsAtlas = true;
 		setSkeletonData(skeletonData, true);
 
 		initialize();
 	}
-	
+
 	void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, Atlas* atlas, float scale) {
 		_atlas = atlas;
 		_attachmentLoader = new (__FILE__, __LINE__) Cocos2dAtlasAttachmentLoader(_atlas);
-	
+
 		SkeletonBinary binary(_attachmentLoader);
 		binary.setScale(scale);
 		SkeletonData* skeletonData = binary.readSkeletonDataFile(skeletonDataFile.c_str());
 		CCASSERT(skeletonData, !binary.getError().isEmpty() ? binary.getError().buffer() : "Error reading skeleton data.");
 		_ownsSkeleton = true;
 		setSkeletonData(skeletonData, true);
-	
+
 		initialize();
 	}
 
 	void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) {
 		_atlas = new (__FILE__, __LINE__) Atlas(atlasFile.c_str(), &textureLoader, true);
 		CCASSERT(_atlas, "Error reading atlas file.");
-	
+
 		_attachmentLoader = new (__FILE__, __LINE__) Cocos2dAtlasAttachmentLoader(_atlas);
-	
+
 		SkeletonBinary binary(_attachmentLoader);
 		binary.setScale(scale);
 		SkeletonData* skeletonData = binary.readSkeletonDataFile(skeletonDataFile.c_str());
@@ -242,7 +242,7 @@ namespace spine {
 		_ownsSkeleton = true;
 		_ownsAtlas = true;
 		setSkeletonData(skeletonData, true);
-	
+
 		initialize();
 	}
 
@@ -295,7 +295,7 @@ namespace spine {
 		nodeColor.g = displayedColor.g / 255.f;
 		nodeColor.b = displayedColor.b / 255.f;
 		nodeColor.a = getDisplayedOpacity() / 255.f;
-	
+
 		Color color;
 		Color darkColor;
 		const float darkPremultipliedAlpha = _premultipliedAlpha ? 1.f : 0;
@@ -303,7 +303,7 @@ namespace spine {
 		TwoColorTrianglesCommand* lastTwoColorTrianglesCommand = nullptr;
 		for (int i = 0, n = _skeleton->getSlots().size(); i < n; ++i) {
 			Slot* slot = _skeleton->getDrawOrder()[i];;
-		
+
 			if (slotIsOutRange(*slot, _startSlotIndex, _endSlotIndex)) {
 				_clipper->clipEnd(*slot);
 				continue;
@@ -322,11 +322,11 @@ namespace spine {
 
 			cocos2d::TrianglesCommand::Triangles triangles;
 			TwoColorTriangles trianglesTwoColor;
-		
+
 			if (slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) {
 				RegionAttachment* attachment = static_cast<RegionAttachment*>(slot->getAttachment());
 				attachmentVertices = static_cast<AttachmentVertices*>(attachment->getRendererObject());
-				
+
 				// Early exit if attachment is invisible
 				if (attachment->getColor().a == 0) {
 					_clipper->clipEnd(*slot);
@@ -359,13 +359,13 @@ namespace spine {
 				// Copy world vertices to triangle vertices
 				interleaveCoordinates(dstTriangleVertices, worldCoordPtr, 4, dstStride);
 				worldCoordPtr += 8;
-			
+
 				color = attachment->getColor();
 			}
 			else if (slot->getAttachment()->getRTTI().isExactly(MeshAttachment::rtti)) {
 				MeshAttachment* attachment = (MeshAttachment*)slot->getAttachment();
 				attachmentVertices = (AttachmentVertices*)attachment->getRendererObject();
-				
+
 				float* dstTriangleVertices = nullptr;
 				int dstStride = 0; // in floats
 				int dstVertexCount = 0;
@@ -390,12 +390,12 @@ namespace spine {
 					dstStride = sizeof(V3F_C4B_C4B_T2F) / sizeof(float);
 					dstVertexCount = trianglesTwoColor.vertCount;
 				}
-				
+
 				// Copy world vertices to triangle vertices
 				//assert(dstVertexCount * 2 == attachment->super.worldVerticesLength);
 				interleaveCoordinates(dstTriangleVertices, worldCoordPtr, dstVertexCount, dstStride);
 				worldCoordPtr += dstVertexCount * 2;
-		
+
 				color = attachment->getColor();
 			}
 			else if (slot->getAttachment()->getRTTI().isExactly(ClippingAttachment::rtti)) {
@@ -406,7 +406,7 @@ namespace spine {
 				_clipper->clipEnd(*slot);
 				continue;
 			}
-		
+
 			if (slot->hasDarkColor()) {
 				darkColor = slot->getDarkColor();
 			} else {
@@ -415,7 +415,7 @@ namespace spine {
 				darkColor.b = 0;
 			}
 			darkColor.a = darkPremultipliedAlpha;
-		
+
 			color.a *= nodeColor.a * _skeleton->getColor().a * slot->getColor().a;
 			// skip rendering if the color of this attachment is 0
 			if (color.a == 0){
@@ -431,7 +431,7 @@ namespace spine {
 				color.g *= color.a;
 				color.b *= color.a;
 			}
-		
+
 			const cocos2d::Color4B color4B = ColorToColor4B(color);
 			const cocos2d::Color4B darkColor4B = ColorToColor4B(darkColor);
 			const BlendFunc blendFunc = makeBlendFunc(slot->getData().getBlendMode(), _premultipliedAlpha);
@@ -440,21 +440,21 @@ namespace spine {
 				if (_clipper->isClipping()) {
 					_clipper->clipTriangles((float*)&triangles.verts[0].vertices, triangles.indices, triangles.indexCount, (float*)&triangles.verts[0].texCoords, sizeof(cocos2d::V3F_C4B_T2F) / 4);
 					batch->deallocateVertices(triangles.vertCount);
-				
+
 					if (_clipper->getClippedTriangles().size() == 0){
 						_clipper->clipEnd(*slot);
 						continue;
 					}
-				
+
 					triangles.vertCount = _clipper->getClippedVertices().size() / 2;
 					triangles.verts = batch->allocateVertices(triangles.vertCount);
 					triangles.indexCount = _clipper->getClippedTriangles().size();
 					triangles.indices =
 					batch->allocateIndices(triangles.indexCount);
 					memcpy(triangles.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size());
-				
+
 					cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, _glProgramState, blendFunc, triangles, transform, transformFlags);
-				
+
 					const float* verts = _clipper->getClippedVertices().buffer();
 					const float* uvs = _clipper->getClippedUVs().buffer();
 					if (_effect) {
@@ -481,9 +481,9 @@ namespace spine {
 					}
 				} else {
 					// Not clipping
-				
+
 					cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, _glProgramState, blendFunc, triangles, transform, transformFlags);
-				
+
 					if (_effect) {
 						V3F_C4B_T2F* vertex = batchedTriangles->getTriangles().verts;
 						Color darkTmp;
@@ -501,27 +501,27 @@ namespace spine {
 				}
 			} else {
 				// Two tints
-			
+
 				if (_clipper->isClipping()) {
 					_clipper->clipTriangles((float*)&trianglesTwoColor.verts[0].position, trianglesTwoColor.indices, trianglesTwoColor.indexCount, (float*)&trianglesTwoColor.verts[0].texCoords, sizeof(V3F_C4B_C4B_T2F) / 4);
 					twoColorBatch->deallocateVertices(trianglesTwoColor.vertCount);
-				
+
 					if (_clipper->getClippedTriangles().size() == 0){
 						_clipper->clipEnd(*slot);
 						continue;
 					}
-				
+
 					trianglesTwoColor.vertCount = _clipper->getClippedVertices().size() / 2;
 					trianglesTwoColor.verts = twoColorBatch->allocateVertices(trianglesTwoColor.vertCount);
 					trianglesTwoColor.indexCount = _clipper->getClippedTriangles().size();
 					trianglesTwoColor.indices = twoColorBatch->allocateIndices(trianglesTwoColor.indexCount);
 					memcpy(trianglesTwoColor.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size());
-				
+
 					TwoColorTrianglesCommand* batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags);
-				
+
 					const float* verts = _clipper->getClippedVertices().buffer();
 					const float* uvs = _clipper->getClippedUVs().buffer();
-				
+
 					if (_effect) {
 						V3F_C4B_C4B_T2F* vertex = batchedTriangles->getTriangles().verts;
 						for (int v = 0, vn = batchedTriangles->getTriangles().vertCount, vv = 0; v < vn; ++v, vv += 2, ++vertex) {
@@ -548,7 +548,7 @@ namespace spine {
 					}
 				} else {
 					TwoColorTrianglesCommand* batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags);
-				
+
 					if (_effect) {
 						V3F_C4B_C4B_T2F* vertex = batchedTriangles->getTriangles().verts;
 						for (int v = 0, vn = batchedTriangles->getTriangles().vertCount; v < vn; ++v, ++vertex) {
@@ -570,10 +570,10 @@ namespace spine {
 		_clipper->clipEnd(*slot);
 		}
 		_clipper->clipEnd();
-	
+
 		if (lastTwoColorTrianglesCommand) {
 			Node* parent = this->getParent();
-		
+
 			// We need to decide if we can postpone flushing the current
 			// batch. We can postpone if the next sibling node is a
 			// two color tinted skeleton with the same global-z.
@@ -607,7 +607,7 @@ namespace spine {
 				}
 			}
 		}
-	
+
 		if (_effect) _effect->end();
 
 		if (_debugBoundingRect || _debugSlots || _debugBones || _debugMeshes) {
@@ -627,7 +627,7 @@ namespace spine {
 	#endif
 
 		DrawNode* drawNode = DrawNode::create();
-	
+
 		// Draw bounding rectangle
 		if (_debugBoundingRect) {
 			glLineWidth(2);
@@ -649,7 +649,7 @@ namespace spine {
 			V3F_C4B_T2F_Quad quad;
 			for (int i = 0, n = _skeleton->getSlots().size(); i < n; i++) {
 				Slot* slot = _skeleton->getDrawOrder()[i];
-				
+
 				if (!slot->getBone().isActive()) continue;
 				if (!slot->getAttachment() || !slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) continue;
 
@@ -670,7 +670,7 @@ namespace spine {
 				drawNode->drawPoly(points, 4, true, Color4F::BLUE);
 			}
 		}
-	
+
 		if (_debugBones) {
 			// Bone lengths.
 			glLineWidth(2);
@@ -690,7 +690,7 @@ namespace spine {
 				if (i == 0) color = Color4F::GREEN;
 			}
 		}
-	
+
 		if (_debugMeshes) {
 			// Meshes.
 			glLineWidth(1);
@@ -717,7 +717,7 @@ namespace spine {
 				VLA_FREE(worldCoord);
 			}
 		}
-	
+
 		drawNode->draw(renderer, transform, transformFlags);
 	#if !defined(USE_MATRIX_STACK_PROJECTION_ONLY)
 		director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
@@ -768,7 +768,7 @@ namespace spine {
 	bool SkeletonRenderer::setAttachment (const std::string& slotName, const char* attachmentName) {
 		return _skeleton->getAttachment(slotName.c_str(), attachmentName) ? true : false;
 	}
-	
+
 	void SkeletonRenderer::setTwoColorTint(bool enabled) {
 		setupGLProgramState(enabled);
 	}
@@ -776,11 +776,11 @@ namespace spine {
 	bool SkeletonRenderer::isTwoColorTint() {
 		return getGLProgramState() == SkeletonTwoColorBatch::getInstance()->getTwoColorTintProgramState();
 	}
-	
+
 	void SkeletonRenderer::setVertexEffect(VertexEffect *effect) {
 		this->_effect = effect;
 	}
-	
+
 	void SkeletonRenderer::setSlotsRange(int startSlotIndex, int endSlotIndex) {
 		_startSlotIndex = startSlotIndex == -1 ? 0 : startSlotIndex;
 		_endSlotIndex = endSlotIndex == -1 ? std::numeric_limits<int>::max() : endSlotIndex;
@@ -810,7 +810,7 @@ namespace spine {
 	bool SkeletonRenderer::getDebugBonesEnabled () const {
 		return _debugBones;
 	}
-	
+
 	void SkeletonRenderer::setDebugMeshesEnabled (bool enabled) {
 		_debugMeshes = enabled;
 	}

+ 10 - 10
spine-cocos2dx/src/spine/SkeletonRenderer.h

@@ -63,10 +63,10 @@ namespace spine {
 
 		void setDebugBonesEnabled(bool enabled);
 		bool getDebugBonesEnabled() const;
-	
+
 		void setDebugMeshesEnabled(bool enabled);
 		bool getDebugMeshesEnabled() const;
- 
+
 		void setDebugBoundingRectEnabled(bool enabled);
 		bool getDebugBoundingRectEnabled() const;
 
@@ -81,14 +81,14 @@ namespace spine {
 		Bone* findBone (const std::string& boneName) const;
 		/* Returns 0 if the slot was not found. */
 		Slot* findSlot (const std::string& slotName) const;
-	
+
 		/* Sets the skin used to look up attachments not found in the SkeletonData defaultSkin. Attachments from the new skin are
 		 * attached if the corresponding attachment from the old skin was attached.
 		 * @param skin May be empty string ("") for no skin.*/
 		void setSkin (const std::string& skinName);
 		/** @param skin May be 0 for no skin.*/
 		void setSkin (const char* skinName);
-	
+
 		/* Returns 0 if the slot or attachment was not found. */
 		Attachment* getAttachment (const std::string& slotName, const std::string& attachmentName) const;
 		/* Returns false if the slot or attachment was not found.
@@ -96,15 +96,15 @@ namespace spine {
 		bool setAttachment (const std::string& slotName, const std::string& attachmentName);
 		/* @param attachmentName May be 0 for no attachment. */
 		bool setAttachment (const std::string& slotName, const char* attachmentName);
-	
+
 		/* Enables/disables two color tinting for this instance. May break batching */
 		void setTwoColorTint(bool enabled);
 		/* Whether two color tinting is enabled */
 		bool isTwoColorTint();
-	
+
 		/* Sets the vertex effect to be used, set to 0 to disable vertex effects */
 		void setVertexEffect(VertexEffect* effect);
-	
+
 		/* Sets the range of slots that should be rendered. Use -1, -1 to clear the range */
 		void setSlotsRange(int startSlotIndex, int endSlotIndex);
 
@@ -113,7 +113,7 @@ namespace spine {
 		const cocos2d::BlendFunc& getBlendFunc () const override;
 		void setOpacityModifyRGB (bool value) override;
 		bool isOpacityModifyRGB () const override;
-	
+
 	CC_CONSTRUCTOR_ACCESS:
 		SkeletonRenderer ();
 		SkeletonRenderer(Skeleton* skeleton, bool ownsSkeleton = false, bool ownsSkeletonData = false, bool ownsAtlas = false);
@@ -131,7 +131,7 @@ namespace spine {
 		void initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1);
 
 		virtual void initialize ();
-	
+
 	protected:
 		void setSkeletonData (SkeletonData* skeletonData, bool ownsSkeletonData);
 		void setupGLProgramState(bool twoColorTintEnabled);
@@ -154,7 +154,7 @@ namespace spine {
 		SkeletonClipping* _clipper;
 		VertexEffect* _effect;
 		cocos2d::Rect _boundingRect;
-	
+
 		int _startSlotIndex;
 		int _endSlotIndex;
 	};

+ 31 - 31
spine-cocos2dx/src/spine/SkeletonTwoColorBatch.cpp

@@ -83,7 +83,7 @@ void TwoColorTrianglesCommand::generateMaterialID() {
 		setSkipBatching(true);
 	}
 	else {
-		int glProgram = (int)_glProgram->getProgram();		
+		int glProgram = (int)_glProgram->getProgram();
 		_materialID = glProgram + (int)_textureID + (int)_blendType.src + (int)_blendType.dst;
 	}
 }
@@ -91,17 +91,17 @@ void TwoColorTrianglesCommand::generateMaterialID() {
 void TwoColorTrianglesCommand::useMaterial() const {
 	//Set texture
 	GL::bindTexture2D(_textureID);
-	
+
 	if (_alphaTextureID > 0) {
 		// ANDROID ETC1 ALPHA supports.
 		GL::bindTexture2DN(1, _alphaTextureID);
 	}
 	//set blend mode
 	GL::blendFunc(_blendType.src, _blendType.dst);
-	
+
 	_glProgramState->apply(_mv);
 }
-	
+
 void TwoColorTrianglesCommand::draw() {
 	SkeletonTwoColorBatch::getInstance()->batch(this);
 }
@@ -143,7 +143,7 @@ varying vec2 v_texCoord;
 void main() {
 	vec4 texColor = texture2D(CC_Texture0, v_texCoord);
 	float alpha = texColor.a * v_light.a;
-	gl_FragColor.a = alpha;	
+	gl_FragColor.a = alpha;
 	gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;
 }
 );
@@ -167,19 +167,19 @@ SkeletonTwoColorBatch::SkeletonTwoColorBatch () : _vertexBuffer(0), _indexBuffer
 	for (unsigned int i = 0; i < INITIAL_SIZE; i++) {
 		_commandsPool.push_back(new TwoColorTrianglesCommand());
 	}
-	
+
 	reset ();
-	
+
 	// callback after drawing is finished so we can clear out the batch state
 	// for the next frame
 	Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom* eventCustom){
 		this->update(0);
 	});
-	
+
 	_twoColorTintShader = cocos2d::GLProgram::createWithByteArrays(TWO_COLOR_TINT_VERTEX_SHADER, TWO_COLOR_TINT_FRAGMENT_SHADER);
 	_twoColorTintShaderState = GLProgramState::getOrCreateWithGLProgram(_twoColorTintShader);
 	_twoColorTintShaderState->retain();
-	
+
 	glGenBuffers(1, &_vertexBufferHandle);
 	_vertexBuffer = new V3F_C4B_C4B_T2F[MAX_VERTICES];
 	glGenBuffers(1, &_indexBufferHandle);
@@ -192,7 +192,7 @@ SkeletonTwoColorBatch::SkeletonTwoColorBatch () : _vertexBuffer(0), _indexBuffer
 
 SkeletonTwoColorBatch::~SkeletonTwoColorBatch () {
 	Director::getInstance()->getEventDispatcher()->removeCustomEventListeners(EVENT_AFTER_DRAW_RESET_POSITION);
-	
+
 	for (unsigned int i = 0; i < _commandsPool.size(); i++) {
 		delete _commandsPool[i];
 		_commandsPool[i] = nullptr;
@@ -202,7 +202,7 @@ SkeletonTwoColorBatch::~SkeletonTwoColorBatch () {
 	delete[] _indexBuffer;
 }
 
-void SkeletonTwoColorBatch::update (float delta) {	
+void SkeletonTwoColorBatch::update (float delta) {
 	reset();
 }
 
@@ -217,13 +217,13 @@ V3F_C4B_C4B_T2F* SkeletonTwoColorBatch::allocateVertices(uint32_t numVertices) {
 			triangles.verts = newData + (triangles.verts - oldData);
 		}
 	}
-	
+
 	V3F_C4B_C4B_T2F* vertices = _vertices.data() + _numVertices;
 	_numVertices += numVertices;
 	return vertices;
 }
-	
-	
+
+
 void SkeletonTwoColorBatch::deallocateVertices(uint32_t numVertices) {
 	_numVertices -= numVertices;
 }
@@ -243,7 +243,7 @@ unsigned short* SkeletonTwoColorBatch::allocateIndices(uint32_t numIndices) {
 			}
 		}
 	}
-	
+
 	unsigned short* indices = _indices.buffer() + _indices.size();
 	_indices.setSize(_indices.size() + numIndices, 0);
 	return indices;
@@ -256,68 +256,68 @@ void SkeletonTwoColorBatch::deallocateIndices(uint32_t numIndices) {
 TwoColorTrianglesCommand* SkeletonTwoColorBatch::addCommand(cocos2d::Renderer* renderer, float globalOrder, GLuint textureID, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const TwoColorTriangles& triangles, const cocos2d::Mat4& mv, uint32_t flags) {
 	TwoColorTrianglesCommand* command = nextFreeCommand();
 	command->init(globalOrder, textureID, glProgramState, blendType, triangles, mv, flags);
-	renderer->addCommand(command);	
+	renderer->addCommand(command);
 	return command;
 }
-	
+
 void SkeletonTwoColorBatch::batch (TwoColorTrianglesCommand* command) {
 	if (_numVerticesBuffer + command->getTriangles().vertCount >= MAX_VERTICES || _numIndicesBuffer + command->getTriangles().indexCount >= MAX_INDICES) {
 		flush(_lastCommand);
 	}
-	
+
 	uint32_t materialID = command->getMaterialID();
 	if (_lastCommand && _lastCommand->getMaterialID() != materialID) {
 		flush(_lastCommand);
 	}
-	
+
 	memcpy(_vertexBuffer + _numVerticesBuffer, command->getTriangles().verts, sizeof(V3F_C4B_C4B_T2F) * command->getTriangles().vertCount);
 	const Mat4& modelView = command->getModelView();
 	for (int i = _numVerticesBuffer; i < _numVerticesBuffer + command->getTriangles().vertCount; i++) {
 		modelView.transformPoint(&_vertexBuffer[i].position);
 	}
-	
+
 	unsigned short vertexOffset = (unsigned short)_numVerticesBuffer;
 	unsigned short* indices = command->getTriangles().indices;
 	for (int i = 0, j = _numIndicesBuffer; i < command->getTriangles().indexCount; i++, j++) {
 		_indexBuffer[j] = indices[i] + vertexOffset;
 	}
-	
+
 	_numVerticesBuffer += command->getTriangles().vertCount;
 	_numIndicesBuffer += command->getTriangles().indexCount;
-	
+
 	if (command->isForceFlush()) {
 		flush(command);
 	}
 	_lastCommand = command;
 }
-	
+
 void SkeletonTwoColorBatch::flush (TwoColorTrianglesCommand* materialCommand) {
 	if (!materialCommand)
 		return;
-	
+
 	materialCommand->useMaterial();
-	
+
 	glBindBuffer(GL_ARRAY_BUFFER, _vertexBufferHandle);
 	glBufferData(GL_ARRAY_BUFFER, sizeof(V3F_C4B_C4B_T2F) * _numVerticesBuffer , _vertexBuffer, GL_DYNAMIC_DRAW);
-	
+
 	glEnableVertexAttribArray(_positionAttributeLocation);
 	glEnableVertexAttribArray(_colorAttributeLocation);
 	glEnableVertexAttribArray(_color2AttributeLocation);
 	glEnableVertexAttribArray(_texCoordsAttributeLocation);
-	
+
 	glVertexAttribPointer(_positionAttributeLocation, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_C4B_T2F), (GLvoid*)offsetof(V3F_C4B_C4B_T2F, position));
 	glVertexAttribPointer(_colorAttributeLocation, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_C4B_T2F), (GLvoid*)offsetof(V3F_C4B_C4B_T2F, color));
 	glVertexAttribPointer(_color2AttributeLocation, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_C4B_T2F), (GLvoid*)offsetof(V3F_C4B_C4B_T2F, color2));
 	glVertexAttribPointer(_texCoordsAttributeLocation, 2, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_C4B_T2F), (GLvoid*)offsetof(V3F_C4B_C4B_T2F, texCoords));
-	
+
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBufferHandle);
 	glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned short) * _numIndicesBuffer, _indexBuffer, GL_STATIC_DRAW);
-	
+
 	glDrawElements(GL_TRIANGLES, (GLsizei)_numIndicesBuffer, GL_UNSIGNED_SHORT, 0);
-	
+
 	glBindBuffer(GL_ARRAY_BUFFER, 0);
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
-	
+
 	_numVerticesBuffer = 0;
 	_numIndicesBuffer = 0;
 	_numBatches++;

+ 37 - 37
spine-cocos2dx/src/spine/SkeletonTwoColorBatch.h

@@ -41,50 +41,50 @@ namespace spine {
 		cocos2d::Color4B color2;
 		cocos2d::Tex2F texCoords;
 	};
-	
+
 	struct TwoColorTriangles {
 		V3F_C4B_C4B_T2F* verts;
 		unsigned short* indices;
 		int vertCount;
 		int indexCount;
 	};
-	
+
 	class TwoColorTrianglesCommand : public cocos2d::CustomCommand {
 	public:
 		TwoColorTrianglesCommand();
-		
+
 		~TwoColorTrianglesCommand();
-	
+
 		void init(float globalOrder, GLuint textureID, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const TwoColorTriangles& triangles, const cocos2d::Mat4& mv, uint32_t flags);
-		
+
 		void useMaterial() const;
-		
+
 		inline uint32_t getMaterialID() const { return _materialID; }
-		
+
 		inline GLuint getTextureID() const { return _textureID; }
-		
+
 		inline const TwoColorTriangles& getTriangles() const { return _triangles; }
-		
+
 		inline ssize_t getVertexCount() const { return _triangles.vertCount; }
-		
+
 		inline ssize_t getIndexCount() const { return _triangles.indexCount; }
-		
+
 		inline const V3F_C4B_C4B_T2F* getVertices() const { return _triangles.verts; }
-		
+
 		inline const unsigned short* getIndices() const { return _triangles.indices; }
-		
+
 		inline cocos2d::GLProgramState* getGLProgramState() const { return _glProgramState; }
-		
+
 		inline cocos2d::BlendFunc getBlendType() const { return _blendType; }
-		
+
 		inline const cocos2d::Mat4& getModelView() const { return _mv; }
-		
+
 		void draw ();
-		
+
 		void setForceFlush (bool forceFlush) { _forceFlush = forceFlush; }
-		
+
 		bool isForceFlush () { return _forceFlush; };
-		
+
 	protected:
 		void generateMaterialID();
 		uint32_t _materialID;
@@ -98,33 +98,33 @@ namespace spine {
 		bool _forceFlush;
 	};
 
-    class SkeletonTwoColorBatch {
-    public:
-        static SkeletonTwoColorBatch* getInstance ();
+	class SkeletonTwoColorBatch {
+	public:
+		static SkeletonTwoColorBatch* getInstance ();
 
-        static void destroyInstance ();
+		static void destroyInstance ();
 
-        void update (float delta);
+		void update (float delta);
 
 		V3F_C4B_C4B_T2F* allocateVertices(uint32_t numVertices);
 		void deallocateVertices(uint32_t numVertices);
-		
+
 		unsigned short* allocateIndices(uint32_t numIndices);
 		void deallocateIndices(uint32_t numIndices);
 
 		TwoColorTrianglesCommand* addCommand(cocos2d::Renderer* renderer, float globalOrder, GLuint textureID, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const TwoColorTriangles& triangles, const cocos2d::Mat4& mv, uint32_t flags);
 
 		cocos2d::GLProgramState* getTwoColorTintProgramState () { return _twoColorTintShaderState; }
-		
+
 		void batch (TwoColorTrianglesCommand* command);
-		
+
 		void flush (TwoColorTrianglesCommand* materialCommand);
-		
+
 		uint32_t getNumBatches () { return _numBatches; };
-		
-    protected:
-        SkeletonTwoColorBatch ();
-        virtual ~SkeletonTwoColorBatch ();
+
+	protected:
+		SkeletonTwoColorBatch ();
+		virtual ~SkeletonTwoColorBatch ();
 
 		void reset ();
 
@@ -137,14 +137,14 @@ namespace spine {
 		// pool of vertices
 		std::vector<V3F_C4B_C4B_T2F> _vertices;
 		uint32_t _numVertices;
-		
+
 		// pool of indices
 		Vector<unsigned short> _indices;
-		
+
 		// two color tint shader and state
 		cocos2d::GLProgram* _twoColorTintShader;
 		cocos2d::GLProgramState* _twoColorTintShaderState;
-		
+
 		// VBO handles & attribute locations
 		GLuint _vertexBufferHandle;
 		V3F_C4B_C4B_T2F* _vertexBuffer;
@@ -156,10 +156,10 @@ namespace spine {
 		GLint _colorAttributeLocation;
 		GLint _color2AttributeLocation;
 		GLint _texCoordsAttributeLocation;
-		
+
 		// last batched command, needed for flushing to set material
 		TwoColorTrianglesCommand* _lastCommand;
-		
+
 		// number of batches in the last frame
 		uint32_t _numBatches;
 	};

+ 4 - 4
spine-cocos2dx/src/spine/spine-cocos2dx.cpp

@@ -48,7 +48,7 @@ static void setAttachmentVertices(RegionAttachment* attachment) {
 		vertices[i].texCoords.u = attachment->getUVs()[ii];
 		vertices[i].texCoords.v = attachment->getUVs()[ii + 1];
 	}
-	attachment->setRendererObject(attachmentVertices, deleteAttachmentVertices);	
+	attachment->setRendererObject(attachmentVertices, deleteAttachmentVertices);
 }
 
 static void setAttachmentVertices(MeshAttachment* attachment) {
@@ -63,7 +63,7 @@ static void setAttachmentVertices(MeshAttachment* attachment) {
 	attachment->setRendererObject(attachmentVertices, deleteAttachmentVertices);
 }
 
-Cocos2dAtlasAttachmentLoader::Cocos2dAtlasAttachmentLoader(Atlas* atlas): AtlasAttachmentLoader(atlas) {	
+Cocos2dAtlasAttachmentLoader::Cocos2dAtlasAttachmentLoader(Atlas* atlas): AtlasAttachmentLoader(atlas) {
 }
 
 void Cocos2dAtlasAttachmentLoader::configureAttachment(Attachment* attachment) {
@@ -113,7 +113,7 @@ void Cocos2dTextureLoader::load(AtlasPage& page, const spine::String& path) {
 		page.height = texture->getPixelsHigh();
 	}
 }
-	
+
 void Cocos2dTextureLoader::unload(void* texture) {
 	if (texture)
 	{
@@ -125,7 +125,7 @@ void Cocos2dTextureLoader::unload(void* texture) {
 char *Cocos2dExtension::_readFile(const spine::String &path, int *length) {
 	Data data = FileUtils::getInstance()->getDataFromFile(FileUtils::getInstance()->fullPathForFilename(path.buffer()));
 	if (data.isNull()) return nullptr;
-	
+
 	// avoid buffer overflow (int is shorter than ssize_t in certain platforms)
 #if COCOS2D_VERSION >= 0x00031200
 	ssize_t tmpLen;

+ 5 - 5
spine-cocos2dx/src/spine/spine-cocos2dx.h

@@ -43,18 +43,18 @@ namespace spine {
 		Cocos2dAtlasAttachmentLoader(Atlas* atlas);
 		virtual void configureAttachment(Attachment* attachment);
 	};
-	
+
 	class Cocos2dTextureLoader: public TextureLoader {
 	public:
-		
+
 		virtual void load(AtlasPage& page, const String& path);
-		
+
 		virtual void unload(void* texture);
 	};
-	
+
 	class Cocos2dExtension: public DefaultSpineExtension {
 	public:
-		
+
 	protected:
 		virtual char *_readFile(const String &path, int *length);
 	};

+ 68 - 68
spine-corona/spine-corona/spine.lua

@@ -129,7 +129,7 @@ function spine.Skeleton:updateWorldTransform()
 	local premultipliedAlpha = self.premultipliedAlpha
 
 	self.batches = 0
-	
+
 	if (self.vertexEffect) then self.vertexEffect:beginEffect(self) end
 
 	-- Remove old drawing group, we will start anew
@@ -154,94 +154,94 @@ function spine.Skeleton:updateWorldTransform()
 		vertices = nil,
 		uvs = nil
 	}
-	
+
 	for _,slot in ipairs(drawOrder) do
 		local attachment = slot.attachment
 		local vertices = nil
 		local uvs = nil
 		local numVertices = 0
 		local indices = nil
-    
-    if slot.bone.active then 
-    
-      if attachment then
-        if attachment.type == spine.AttachmentType.region then
-          numVertices = 4
-          vertices = worldVertices
-          attachment:computeWorldVertices(slot.bone, vertices, 0, 2)
-          uvs = attachment.uvs
-          indices = QUAD_TRIANGLES
-          texture = attachment.region.renderObject.texture				
-          blendMode = toCoronaBlendMode(slot.data.blendMode)
-        elseif attachment.type == spine.AttachmentType.mesh then
-          numVertices = attachment.worldVerticesLength / 2
-          vertices = worldVertices
-          attachment:computeWorldVertices(slot, 0, attachment.worldVerticesLength, vertices, 0, 2)
-          uvs = attachment.uvs
-          indices = attachment.triangles
-          texture = attachment.region.renderObject.texture
-          blendMode = toCoronaBlendMode(slot.data.blendMode)
-        elseif attachment.type == spine.AttachmentType.clipping then
-          self.clipper:clipStart(slot, attachment)
-        end
 
-        if texture and vertices and indices then
-          local skeleton = slot.bone.skeleton
-          local skeletonColor = skeleton.color
-          local slotColor = slot.color
-          local attachmentColor = attachment.color
-          local alpha = skeletonColor.a * slotColor.a * attachmentColor.a
-          local multiplier = alpha
-          if premultipliedAlpha then multiplier = 1 end
-          color:set(skeletonColor.r * slotColor.r * attachmentColor.r * multiplier,
-                    skeletonColor.g * slotColor.g * attachmentColor.g * multiplier,
-                    skeletonColor.b * slotColor.b * attachmentColor.b * multiplier,
-                    alpha)
-          
-          if not lastTexture then lastTexture = texture end
-          if lastColor.r == -1 then lastColor:setFrom(color) end
-          if not lastBlendMode then lastBlendMode = blendMode end
+		if slot.bone.active then
+
+			if attachment then
+				if attachment.type == spine.AttachmentType.region then
+					numVertices = 4
+					vertices = worldVertices
+					attachment:computeWorldVertices(slot.bone, vertices, 0, 2)
+					uvs = attachment.uvs
+					indices = QUAD_TRIANGLES
+					texture = attachment.region.renderObject.texture
+					blendMode = toCoronaBlendMode(slot.data.blendMode)
+				elseif attachment.type == spine.AttachmentType.mesh then
+					numVertices = attachment.worldVerticesLength / 2
+					vertices = worldVertices
+					attachment:computeWorldVertices(slot, 0, attachment.worldVerticesLength, vertices, 0, 2)
+					uvs = attachment.uvs
+					indices = attachment.triangles
+					texture = attachment.region.renderObject.texture
+					blendMode = toCoronaBlendMode(slot.data.blendMode)
+				elseif attachment.type == spine.AttachmentType.clipping then
+					self.clipper:clipStart(slot, attachment)
+				end
+
+				if texture and vertices and indices then
+					local skeleton = slot.bone.skeleton
+					local skeletonColor = skeleton.color
+					local slotColor = slot.color
+					local attachmentColor = attachment.color
+					local alpha = skeletonColor.a * slotColor.a * attachmentColor.a
+					local multiplier = alpha
+					if premultipliedAlpha then multiplier = 1 end
+					color:set(skeletonColor.r * slotColor.r * attachmentColor.r * multiplier,
+						skeletonColor.g * slotColor.g * attachmentColor.g * multiplier,
+						skeletonColor.b * slotColor.b * attachmentColor.b * multiplier,
+						alpha)
 
-          if (texture ~= lastTexture or not colorEquals(color, lastColor) or blendMode ~= lastBlendMode) then
-            self:flush(groupVertices, groupUvs, groupIndices, lastTexture, lastColor, lastBlendMode, drawingGroup)
-            lastTexture = texture
-            lastColor:setFrom(color)
-            lastBlendMode = blendMode
-            groupVertices = {}
-            groupUvs = {}
-            groupIndices = {}
-          end
-          
-          if self.clipper:isClipping() then
-            self.clipper:clipTriangles(vertices, uvs, indices, #indices)
-            vertices = self.clipper.clippedVertices
-            numVertices = #vertices / 2
-            uvs = self.clipper.clippedUVs
-            indices = self.clipper.clippedTriangles
-          end
+					if not lastTexture then lastTexture = texture end
+					if lastColor.r == -1 then lastColor:setFrom(color) end
+					if not lastBlendMode then lastBlendMode = blendMode end
 
-          self:batch(vertices, uvs, numVertices, indices, groupVertices, groupUvs, groupIndices)
-        end
-        
-        self.clipper:clipEnd(slot)
-      end
+					if (texture ~= lastTexture or not colorEquals(color, lastColor) or blendMode ~= lastBlendMode) then
+						self:flush(groupVertices, groupUvs, groupIndices, lastTexture, lastColor, lastBlendMode, drawingGroup)
+						lastTexture = texture
+						lastColor:setFrom(color)
+						lastBlendMode = blendMode
+						groupVertices = {}
+						groupUvs = {}
+						groupIndices = {}
+					end
+
+					if self.clipper:isClipping() then
+						self.clipper:clipTriangles(vertices, uvs, indices, #indices)
+						vertices = self.clipper.clippedVertices
+						numVertices = #vertices / 2
+						uvs = self.clipper.clippedUVs
+						indices = self.clipper.clippedTriangles
+					end
+
+					self:batch(vertices, uvs, numVertices, indices, groupVertices, groupUvs, groupIndices)
+				end
+
+				self.clipper:clipEnd(slot)
+			end
 		end
 	end
 
 	if #groupVertices > 0 then
 		self:flush(groupVertices, groupUvs, groupIndices, texture, color, blendMode, drawingGroup)
 	end
-	
+
 	self.clipper:clipEnd2()
 	if (self.vertexEffect) then self.vertexEffect:endEffect() end
 end
 
 function spine.Skeleton:flush(groupVertices, groupUvs, groupIndices, texture, color, blendMode, drawingGroup)
 	local mesh = display.newMesh(drawingGroup, 0, 0, {
-			mode = "indexed",
-			vertices = groupVertices,
-			uvs = groupUvs,
-			indices = groupIndices
+		mode = "indexed",
+		vertices = groupVertices,
+		uvs = groupUvs,
+		indices = groupIndices
 	})
 	mesh.fill = texture
 	mesh:setFillColor(color.r, color.g, color.b)

+ 1 - 1
spine-cpp/spine-cpp/include/spine/Animation.h

@@ -88,7 +88,7 @@ public:
 	/// Applies all the animation's timelines to the specified skeleton.
 	/// See also Timeline::apply(Skeleton&, float, float, Vector, float, MixPose, MixDirection)
 	void apply(Skeleton &skeleton, float lastTime, float time, bool loop, Vector<Event *> *pEvents, float alpha,
-			   MixBlend blend, MixDirection direction);
+		MixBlend blend, MixDirection direction);
 
 	const String &getName();
 

+ 354 - 391
spine-cpp/spine-cpp/include/spine/AnimationState.h

@@ -42,23 +42,23 @@
 #endif
 
 namespace spine {
-    enum EventType {
-        EventType_Start,
-        EventType_Interrupt,
-        EventType_End,
-        EventType_Complete,
-        EventType_Dispose,
-        EventType_Event
-    };
-    
-    class AnimationState;
-    class TrackEntry;
-
-    class Animation;
-    class Event;
-    class AnimationStateData;
-    class Skeleton;
-    class RotateTimeline;
+	enum EventType {
+		EventType_Start,
+		EventType_Interrupt,
+		EventType_End,
+		EventType_Complete,
+		EventType_Dispose,
+		EventType_Event
+	};
+
+	class AnimationState;
+	class TrackEntry;
+
+	class Animation;
+	class Event;
+	class AnimationStateData;
+	class Skeleton;
+	class RotateTimeline;
 
 #ifdef SPINE_USE_STD_FUNCTION
 	typedef std::function<void (AnimationState* state, EventType type, TrackEntry* entry, Event* event)> AnimationStateListener;
@@ -75,400 +75,363 @@ namespace spine {
 		/// The callback function to be called
 		virtual void callback(AnimationState* state, EventType type, TrackEntry* entry, Event* event) = 0;
 	};
-    
-    /// State for the playback of an animation
-    class SP_API TrackEntry : public SpineObject, public HasRendererObject {
-        friend class EventQueue;
-        friend class AnimationState;
-        
-    public:
-        TrackEntry();
-
-        virtual ~TrackEntry();
-        
-        /// The index of the track where this entry is either current or queued.
-        int getTrackIndex();
-        
-        /// The animation to apply for this track entry.
-        Animation* getAnimation();
-        
-        ///
-        /// If true, the animation will repeat. If false, it will not, instead its last frame is applied if played beyond its duration.
-        bool getLoop();
-        void setLoop(bool inValue);
-
-        ///
-        /// If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead
-        /// of being mixed out.
-        ///
-        /// When mixing between animations that key the same property, if a lower track also keys that property then the value will
-        /// briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%
-        /// while the second animation mixes from 0% to 100%. Setting holdPrevious to true applies the first animation
-        /// at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which
-        /// keys the property, only when a higher track also keys the property.
-        ///
-        /// Snapping will occur if holdPrevious is true and this animation does not key all the same properties as the
-        /// previous animation.
-        bool getHoldPrevious();
-        void setHoldPrevious(bool inValue);
-        
-        ///
-        /// Seconds to postpone playing the animation. When a track entry is the current track entry, delay postpones incrementing
-        /// the track time. When a track entry is queued, delay is the time from the start of the previous animation to when the
-        /// track entry will become the current track entry.
-        float getDelay();
-        void setDelay(float inValue);
-        
-        ///
-        /// Current time in seconds this track entry has been the current track entry. The track time determines
-        /// TrackEntry.AnimationTime. The track time can be set to start the animation at a time other than 0, without affecting looping.
-        float getTrackTime();
-        void setTrackTime(float inValue);
-        
-        ///
-        /// The track time in seconds when this animation will be removed from the track. Defaults to the animation duration for
-        /// non-looping animations and to int.MaxValue for looping animations. If the track end time is reached and no
-        /// other animations are queued for playback, and mixing from any previous animations is complete, properties keyed by the animation,
-        /// are set to the setup pose and the track is cleared.
-        ///
-        /// It may be desired to use AnimationState.addEmptyAnimation(int, float, float) to mix the properties back to the
-        /// setup pose over time, rather than have it happen instantly.
-        ///
-        float getTrackEnd();
-        void setTrackEnd(float inValue);
-        
-        ///
-        /// Seconds when this animation starts, both initially and after looping. Defaults to 0.
-        ///
-        /// When changing the animation start time, it often makes sense to set TrackEntry.AnimationLast to the same value to
-        /// prevent timeline keys before the start time from triggering.
-        ///
-        float getAnimationStart();
-        void setAnimationStart(float inValue);
-        
-        ///
-        /// Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will
-        /// loop back to TrackEntry.AnimationStart at this time. Defaults to the animation duration.
-        float getAnimationEnd();
-        void setAnimationEnd(float inValue);
-        
-        ///
-        /// The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this
-        /// animation is applied, event timelines will fire all events between the animation last time (exclusive) and animation time
-        /// (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation is applied.
-        float getAnimationLast();
-        void setAnimationLast(float inValue);
-        
-        ///
-        /// Uses TrackEntry.TrackTime to compute the animation time between TrackEntry.AnimationStart. and
-        /// TrackEntry.AnimationEnd. When the track time is 0, the animation time is equal to the animation start time.
-        ///
-        float getAnimationTime();
-        
-        ///
-        /// Multiplier for the delta time when the animation state is updated, causing time for this animation to play slower or
-        /// faster. Defaults to 1.
-        ///
-        float getTimeScale();
-        void setTimeScale(float inValue);
-        
-        ///
-        /// Values less than 1 mix this animation with the last skeleton pose. Defaults to 1, which overwrites the last skeleton pose with
-        /// this animation.
-        ///
-        /// Typically track 0 is used to completely pose the skeleton, then alpha can be used on higher tracks. It doesn't make sense
-        /// to use alpha on track 0 if the skeleton pose is from the last frame render.
-        ///
-        float getAlpha();
-        void setAlpha(float inValue);
-        
-        ///
-        /// When the mix percentage (mix time / mix duration) is less than the event threshold, event timelines for the animation
-        /// being mixed out will be applied. Defaults to 0, so event timelines are not applied for an animation being mixed out.
-        float getEventThreshold();
-        void setEventThreshold(float inValue);
-        
-        ///
-        /// When the mix percentage (mix time / mix duration) is less than the attachment threshold, attachment timelines for the
-        /// animation being mixed out will be applied. Defaults to 0, so attachment timelines are not applied for an animation being
-        /// mixed out.
-        float getAttachmentThreshold();
-        void setAttachmentThreshold(float inValue);
-        
-        ///
-        /// When the mix percentage (mix time / mix duration) is less than the draw order threshold, draw order timelines for the
-        /// animation being mixed out will be applied. Defaults to 0, so draw order timelines are not applied for an animation being
-        /// mixed out.
-        ///
-        float getDrawOrderThreshold();
-        void setDrawOrderThreshold(float inValue);
-        
-        ///
-        /// The animation queued to start after this animation, or NULL.
-        TrackEntry* getNext();
-        
-        ///
-        /// Returns true if at least one loop has been completed.
-        bool isComplete();
-        
-        ///
-        /// Seconds from 0 to the mix duration when mixing from the previous animation to this animation. May be slightly more than
-        /// TrackEntry.MixDuration when the mix is complete.
-        float getMixTime();
-        void setMixTime(float inValue);
-        
-        ///
-        /// Seconds for mixing from the previous animation to this animation. Defaults to the value provided by
-        /// AnimationStateData based on the animation before this animation (if any).
-        ///
-        /// The mix duration can be set manually rather than use the value from AnimationStateData.GetMix.
-        /// In that case, the mixDuration must be set before AnimationState.update(float) is next called.
-        ///
-        /// When using AnimationState::addAnimation(int, Animation, bool, float) with a delay
-        /// less than or equal to 0, note the Delay is set using the mix duration from the AnimationStateData
-        ///
-        ///
-        ///
-        float getMixDuration();
-        void setMixDuration(float inValue);
-
-
-        MixBlend getMixBlend();
-        void setMixBlend(MixBlend blend);
-        
-        ///
-        /// The track entry for the previous animation when mixing from the previous animation to this animation, or NULL if no
-        /// mixing is currently occuring. When mixing from multiple animations, MixingFrom makes up a double linked list with MixingTo.
-        TrackEntry* getMixingFrom();
-
-        ///
-        /// The track entry for the next animation when mixing from this animation, or NULL if no mixing is currently occuring.
-        /// When mixing from multiple animations, MixingTo makes up a double linked list with MixingFrom.
-        TrackEntry* getMixingTo();
-        
-        ///
-        /// Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the
-        /// long way around when using alpha and starting animations on other tracks.
-        ///
-        /// Mixing involves finding a rotation between two others, which has two possible solutions: the short way or the long way around.
-        /// The two rotations likely change over time, so which direction is the short or long way also changes.
-        /// If the short way was always chosen, bones would flip to the other side when that direction became the long way.
-        /// TrackEntry chooses the short way the first time it is applied and remembers that direction.
-        void resetRotationDirections();
-        
-        void setListener(AnimationStateListener listener);
+
+	/// State for the playback of an animation
+	class SP_API TrackEntry : public SpineObject, public HasRendererObject {
+		friend class EventQueue;
+		friend class AnimationState;
+
+	public:
+		TrackEntry();
+
+		virtual ~TrackEntry();
+
+		/// The index of the track where this entry is either current or queued.
+		int getTrackIndex();
+
+		/// The animation to apply for this track entry.
+		Animation* getAnimation();
+
+		/// If true, the animation will repeat. If false, it will not, instead its last frame is applied if played beyond its duration.
+		bool getLoop();
+		void setLoop(bool inValue);
+
+		/// If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead
+		/// of being mixed out.
+		///
+		/// When mixing between animations that key the same property, if a lower track also keys that property then the value will
+		/// briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%
+		/// while the second animation mixes from 0% to 100%. Setting holdPrevious to true applies the first animation
+		/// at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which
+		/// keys the property, only when a higher track also keys the property.
+		///
+		/// Snapping will occur if holdPrevious is true and this animation does not key all the same properties as the
+		/// previous animation.
+		bool getHoldPrevious();
+		void setHoldPrevious(bool inValue);
+
+		/// Seconds to postpone playing the animation. When a track entry is the current track entry, delay postpones incrementing
+		/// the track time. When a track entry is queued, delay is the time from the start of the previous animation to when the
+		/// track entry will become the current track entry.
+		float getDelay();
+		void setDelay(float inValue);
+
+		/// Current time in seconds this track entry has been the current track entry. The track time determines
+		/// TrackEntry.AnimationTime. The track time can be set to start the animation at a time other than 0, without affecting looping.
+		float getTrackTime();
+		void setTrackTime(float inValue);
+
+		/// The track time in seconds when this animation will be removed from the track. Defaults to the animation duration for
+		/// non-looping animations and to int.MaxValue for looping animations. If the track end time is reached and no
+		/// other animations are queued for playback, and mixing from any previous animations is complete, properties keyed by the animation,
+		/// are set to the setup pose and the track is cleared.
+		///
+		/// It may be desired to use AnimationState.addEmptyAnimation(int, float, float) to mix the properties back to the
+		/// setup pose over time, rather than have it happen instantly.
+		float getTrackEnd();
+		void setTrackEnd(float inValue);
+
+		/// Seconds when this animation starts, both initially and after looping. Defaults to 0.
+		///
+		/// When changing the animation start time, it often makes sense to set TrackEntry.AnimationLast to the same value to
+		/// prevent timeline keys before the start time from triggering.
+		float getAnimationStart();
+		void setAnimationStart(float inValue);
+
+		/// Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will
+		/// loop back to TrackEntry.AnimationStart at this time. Defaults to the animation duration.
+		float getAnimationEnd();
+		void setAnimationEnd(float inValue);
+
+		/// The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this
+		/// animation is applied, event timelines will fire all events between the animation last time (exclusive) and animation time
+		/// (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation is applied.
+		float getAnimationLast();
+		void setAnimationLast(float inValue);
+
+		/// Uses TrackEntry.TrackTime to compute the animation time between TrackEntry.AnimationStart. and
+		/// TrackEntry.AnimationEnd. When the track time is 0, the animation time is equal to the animation start time.
+		float getAnimationTime();
+
+		/// Multiplier for the delta time when the animation state is updated, causing time for this animation to play slower or
+		/// faster. Defaults to 1.
+		float getTimeScale();
+		void setTimeScale(float inValue);
+
+		/// Values less than 1 mix this animation with the last skeleton pose. Defaults to 1, which overwrites the last skeleton pose with
+		/// this animation.
+		///
+		/// Typically track 0 is used to completely pose the skeleton, then alpha can be used on higher tracks. It doesn't make sense
+		/// to use alpha on track 0 if the skeleton pose is from the last frame render.
+		float getAlpha();
+		void setAlpha(float inValue);
+
+		///
+		/// When the mix percentage (mix time / mix duration) is less than the event threshold, event timelines for the animation
+		/// being mixed out will be applied. Defaults to 0, so event timelines are not applied for an animation being mixed out.
+		float getEventThreshold();
+		void setEventThreshold(float inValue);
+
+		/// When the mix percentage (mix time / mix duration) is less than the attachment threshold, attachment timelines for the
+		/// animation being mixed out will be applied. Defaults to 0, so attachment timelines are not applied for an animation being
+		/// mixed out.
+		float getAttachmentThreshold();
+		void setAttachmentThreshold(float inValue);
+
+		/// When the mix percentage (mix time / mix duration) is less than the draw order threshold, draw order timelines for the
+		/// animation being mixed out will be applied. Defaults to 0, so draw order timelines are not applied for an animation being
+		/// mixed out.
+		float getDrawOrderThreshold();
+		void setDrawOrderThreshold(float inValue);
+
+		/// The animation queued to start after this animation, or NULL.
+		TrackEntry* getNext();
+
+		/// Returns true if at least one loop has been completed.
+		bool isComplete();
+
+		/// Seconds from 0 to the mix duration when mixing from the previous animation to this animation. May be slightly more than
+		/// TrackEntry.MixDuration when the mix is complete.
+		float getMixTime();
+		void setMixTime(float inValue);
+
+		/// Seconds for mixing from the previous animation to this animation. Defaults to the value provided by
+		/// AnimationStateData based on the animation before this animation (if any).
+		///
+		/// The mix duration can be set manually rather than use the value from AnimationStateData.GetMix.
+		/// In that case, the mixDuration must be set before AnimationState.update(float) is next called.
+		///
+		/// When using AnimationState::addAnimation(int, Animation, bool, float) with a delay
+		/// less than or equal to 0, note the Delay is set using the mix duration from the AnimationStateData
+		float getMixDuration();
+		void setMixDuration(float inValue);
+
+		MixBlend getMixBlend();
+		void setMixBlend(MixBlend blend);
+
+		/// The track entry for the previous animation when mixing from the previous animation to this animation, or NULL if no
+		/// mixing is currently occuring. When mixing from multiple animations, MixingFrom makes up a double linked list with MixingTo.
+		TrackEntry* getMixingFrom();
+
+		/// The track entry for the next animation when mixing from this animation, or NULL if no mixing is currently occuring.
+		/// When mixing from multiple animations, MixingTo makes up a double linked list with MixingFrom.
+		TrackEntry* getMixingTo();
+
+		/// Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the
+		/// long way around when using alpha and starting animations on other tracks.
+		///
+		/// Mixing involves finding a rotation between two others, which has two possible solutions: the short way or the long way around.
+		/// The two rotations likely change over time, so which direction is the short or long way also changes.
+		/// If the short way was always chosen, bones would flip to the other side when that direction became the long way.
+		/// TrackEntry chooses the short way the first time it is applied and remembers that direction.
+		void resetRotationDirections();
+
+		void setListener(AnimationStateListener listener);
 
 		void setListener(AnimationStateListenerObject* listener);
 
-    private:
-        Animation* _animation;
-        
-        TrackEntry* _next;
-        TrackEntry* _mixingFrom;
-        TrackEntry* _mixingTo;
-        int _trackIndex;
-
-        bool _loop, _holdPrevious;
-        float _eventThreshold, _attachmentThreshold, _drawOrderThreshold;
-        float _animationStart, _animationEnd, _animationLast, _nextAnimationLast;
-        float _delay, _trackTime, _trackLast, _nextTrackLast, _trackEnd, _timeScale;
-        float _alpha, _mixTime, _mixDuration, _interruptAlpha, _totalAlpha;
-        MixBlend _mixBlend;
-        Vector<int> _timelineMode;
-        Vector<TrackEntry*> _timelineHoldMix;
-        Vector<float> _timelinesRotation;
-        AnimationStateListener _listener;
+	private:
+		Animation* _animation;
+
+		TrackEntry* _next;
+		TrackEntry* _mixingFrom;
+		TrackEntry* _mixingTo;
+		int _trackIndex;
+
+		bool _loop, _holdPrevious;
+		float _eventThreshold, _attachmentThreshold, _drawOrderThreshold;
+		float _animationStart, _animationEnd, _animationLast, _nextAnimationLast;
+		float _delay, _trackTime, _trackLast, _nextTrackLast, _trackEnd, _timeScale;
+		float _alpha, _mixTime, _mixDuration, _interruptAlpha, _totalAlpha;
+		MixBlend _mixBlend;
+		Vector<int> _timelineMode;
+		Vector<TrackEntry*> _timelineHoldMix;
+		Vector<float> _timelinesRotation;
+		AnimationStateListener _listener;
 		AnimationStateListenerObject* _listenerObject;
-        
-        void reset();
-    };
-    
-    class SP_API EventQueueEntry : public SpineObject {
-        friend class EventQueue;
-        
-    public:
-        EventType _type;
-        TrackEntry* _entry;
-        Event* _event;
-        
-        EventQueueEntry(EventType eventType, TrackEntry* trackEntry, Event* event = NULL);
-    };
-    
-    class SP_API EventQueue : public SpineObject {
-        friend class AnimationState;
-        
-    private:
-        Vector<EventQueueEntry> _eventQueueEntries;
-        AnimationState& _state;
-        Pool<TrackEntry>& _trackEntryPool;
-        bool _drainDisabled;
-        
-        static EventQueue* newEventQueue(AnimationState& state, Pool<TrackEntry>& trackEntryPool);
-
-        static EventQueueEntry newEventQueueEntry(EventType eventType, TrackEntry* entry, Event* event = NULL);
-        
-        EventQueue(AnimationState& state, Pool<TrackEntry>& trackEntryPool);
-        
-        ~EventQueue();
-        
-        void start(TrackEntry* entry);
-
-        void interrupt(TrackEntry* entry);
-
-        void end(TrackEntry* entry);
-
-        void dispose(TrackEntry* entry);
-
-        void complete(TrackEntry* entry);
-
-        void event(TrackEntry* entry, Event* event);
-
-        /// Raises all events in the queue and drains the queue.
-        void drain();
-    };
-    
-    class SP_API AnimationState : public SpineObject, public HasRendererObject {
-        friend class TrackEntry;
-        friend class EventQueue;
-        
-    public:
-        explicit AnimationState(AnimationStateData* data);
-        
-        ~AnimationState();
-        
-        ///
-        /// Increments the track entry times, setting queued animations as current if needed
-        /// @param delta delta time
-        void update(float delta);
-        
-        ///
-        /// Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the
-        /// animation state can be applied to multiple skeletons to pose them identically.
-        bool apply(Skeleton& skeleton);
-        
-        ///
-        /// Removes all animations from all tracks, leaving skeletons in their previous pose.
-        /// It may be desired to use AnimationState.setEmptyAnimations(float) to mix the skeletons back to the setup pose,
-        /// rather than leaving them in their previous pose.
-        void clearTracks();
-        
-        ///
-        /// Removes all animations from the tracks, leaving skeletons in their previous pose.
-        /// It may be desired to use AnimationState.setEmptyAnimations(float) to mix the skeletons back to the setup pose,
-        /// rather than leaving them in their previous pose.
-        void clearTrack(size_t trackIndex);
-        
-        /// Sets an animation by name. setAnimation(int, Animation, bool)
-        TrackEntry* setAnimation(size_t trackIndex, const String& animationName, bool loop);
-        
-        /// Sets the current animation for a track, discarding any queued animations.
-        /// @param loop If true, the animation will repeat.
-        /// If false, it will not, instead its last frame is applied if played beyond its duration.
-        /// In either case TrackEntry.TrackEnd determines when the track is cleared.
-        /// @return
-        /// A track entry to allow further customization of animation playback. References to the track entry must not be kept
-        /// after AnimationState.Dispose.
-        TrackEntry* setAnimation(size_t trackIndex, Animation* animation, bool loop);
-        
-        /// Queues an animation by name.
-        /// addAnimation(int, Animation, bool, float)
-        TrackEntry* addAnimation(size_t trackIndex, const String& animationName, bool loop, float delay);
-        
-        /// Adds an animation to be played delay seconds after the current or last queued animation
-        /// for a track. If the track is empty, it is equivalent to calling setAnimation.
-        /// @param delay
-        /// Seconds to begin this animation after the start of the previous animation. May be &lt;= 0 to use the animation
-        /// duration of the previous track minus any mix duration plus the negative delay.
-        ///
-        /// @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
-        /// after AnimationState.Dispose
-        TrackEntry* addAnimation(size_t trackIndex, Animation* animation, bool loop, float delay);
-        
-        ///
-        /// Sets an empty animation for a track, discarding any queued animations, and mixes to it over the specified mix duration.
-        TrackEntry* setEmptyAnimation(size_t trackIndex, float mixDuration);
-        
-        ///
-        /// Adds an empty animation to be played after the current or last queued animation for a track, and mixes to it over the
-        /// specified mix duration.
-        /// @return
-        /// A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose.
-        ///
-        /// @param trackIndex Track number.
-        /// @param mixDuration Mix duration.
-        /// @param delay Seconds to begin this animation after the start of the previous animation. May be &lt;= 0 to use the animation
-        /// duration of the previous track minus any mix duration plus the negative delay.
-        TrackEntry* addEmptyAnimation(size_t trackIndex, float mixDuration, float delay);
-        
-        ///
-        /// Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration.
-        void setEmptyAnimations(float mixDuration);
-        
-        /// @return The track entry for the animation currently playing on the track, or NULL if no animation is currently playing.
-        TrackEntry* getCurrent(size_t trackIndex);
-        
-        AnimationStateData* getData();
-        
-        /// A list of tracks that have animations, which may contain NULLs.
-        Vector<TrackEntry*> &getTracks();
-
-        float getTimeScale();
-        void setTimeScale(float inValue);
-
-        void setListener(AnimationStateListener listener);
+
+		void reset();
+	};
+
+	class SP_API EventQueueEntry : public SpineObject {
+		friend class EventQueue;
+
+	public:
+		EventType _type;
+		TrackEntry* _entry;
+		Event* _event;
+
+		EventQueueEntry(EventType eventType, TrackEntry* trackEntry, Event* event = NULL);
+	};
+
+	class SP_API EventQueue : public SpineObject {
+		friend class AnimationState;
+
+	private:
+		Vector<EventQueueEntry> _eventQueueEntries;
+		AnimationState& _state;
+		Pool<TrackEntry>& _trackEntryPool;
+		bool _drainDisabled;
+
+		static EventQueue* newEventQueue(AnimationState& state, Pool<TrackEntry>& trackEntryPool);
+
+		static EventQueueEntry newEventQueueEntry(EventType eventType, TrackEntry* entry, Event* event = NULL);
+
+		EventQueue(AnimationState& state, Pool<TrackEntry>& trackEntryPool);
+
+		~EventQueue();
+
+		void start(TrackEntry* entry);
+
+		void interrupt(TrackEntry* entry);
+
+		void end(TrackEntry* entry);
+
+		void dispose(TrackEntry* entry);
+
+		void complete(TrackEntry* entry);
+
+		void event(TrackEntry* entry, Event* event);
+
+		/// Raises all events in the queue and drains the queue.
+		void drain();
+	};
+
+	class SP_API AnimationState : public SpineObject, public HasRendererObject {
+		friend class TrackEntry;
+		friend class EventQueue;
+
+	public:
+		explicit AnimationState(AnimationStateData* data);
+
+		~AnimationState();
+
+		/// Increments the track entry times, setting queued animations as current if needed
+		/// @param delta delta time
+		void update(float delta);
+
+		/// Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the
+		/// animation state can be applied to multiple skeletons to pose them identically.
+		bool apply(Skeleton& skeleton);
+
+		/// Removes all animations from all tracks, leaving skeletons in their previous pose.
+		/// It may be desired to use AnimationState.setEmptyAnimations(float) to mix the skeletons back to the setup pose,
+		/// rather than leaving them in their previous pose.
+		void clearTracks();
+
+		/// Removes all animations from the tracks, leaving skeletons in their previous pose.
+		/// It may be desired to use AnimationState.setEmptyAnimations(float) to mix the skeletons back to the setup pose,
+		/// rather than leaving them in their previous pose.
+		void clearTrack(size_t trackIndex);
+
+		/// Sets an animation by name. setAnimation(int, Animation, bool)
+		TrackEntry* setAnimation(size_t trackIndex, const String& animationName, bool loop);
+
+		/// Sets the current animation for a track, discarding any queued animations.
+		/// @param loop If true, the animation will repeat.
+		/// If false, it will not, instead its last frame is applied if played beyond its duration.
+		/// In either case TrackEntry.TrackEnd determines when the track is cleared.
+		/// @return
+		/// A track entry to allow further customization of animation playback. References to the track entry must not be kept
+		/// after AnimationState.Dispose.
+		TrackEntry* setAnimation(size_t trackIndex, Animation* animation, bool loop);
+
+		/// Queues an animation by name.
+		/// addAnimation(int, Animation, bool, float)
+		TrackEntry* addAnimation(size_t trackIndex, const String& animationName, bool loop, float delay);
+
+		/// Adds an animation to be played delay seconds after the current or last queued animation
+		/// for a track. If the track is empty, it is equivalent to calling setAnimation.
+		/// @param delay
+		/// Seconds to begin this animation after the start of the previous animation. May be &lt;= 0 to use the animation
+		/// duration of the previous track minus any mix duration plus the negative delay.
+		///
+		/// @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
+		/// after AnimationState.Dispose
+		TrackEntry* addAnimation(size_t trackIndex, Animation* animation, bool loop, float delay);
+
+		/// Sets an empty animation for a track, discarding any queued animations, and mixes to it over the specified mix duration.
+		TrackEntry* setEmptyAnimation(size_t trackIndex, float mixDuration);
+
+		/// Adds an empty animation to be played after the current or last queued animation for a track, and mixes to it over the
+		/// specified mix duration.
+		/// @return
+		/// A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose.
+		///
+		/// @param trackIndex Track number.
+		/// @param mixDuration Mix duration.
+		/// @param delay Seconds to begin this animation after the start of the previous animation. May be &lt;= 0 to use the animation
+		/// duration of the previous track minus any mix duration plus the negative delay.
+		TrackEntry* addEmptyAnimation(size_t trackIndex, float mixDuration, float delay);
+
+		/// Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration.
+		void setEmptyAnimations(float mixDuration);
+
+		/// @return The track entry for the animation currently playing on the track, or NULL if no animation is currently playing.
+		TrackEntry* getCurrent(size_t trackIndex);
+
+		AnimationStateData* getData();
+
+		/// A list of tracks that have animations, which may contain NULLs.
+		Vector<TrackEntry*> &getTracks();
+
+		float getTimeScale();
+		void setTimeScale(float inValue);
+
+		void setListener(AnimationStateListener listener);
 		void setListener(AnimationStateListenerObject* listener);
 
 		void disableQueue();
 		void enableQueue();
-        
-    private:
-        
-        AnimationStateData* _data;
 
-        Pool<TrackEntry> _trackEntryPool;
-        Vector<TrackEntry*> _tracks;
-        Vector<Event*> _events;
-        EventQueue* _queue;
+	private:
 
-        Vector<int> _propertyIDs;
-        bool _animationsChanged;
+		AnimationStateData* _data;
 
-        AnimationStateListener _listener;
+		Pool<TrackEntry> _trackEntryPool;
+		Vector<TrackEntry*> _tracks;
+		Vector<Event*> _events;
+		EventQueue* _queue;
+
+		Vector<int> _propertyIDs;
+		bool _animationsChanged;
+
+		AnimationStateListener _listener;
 		AnimationStateListenerObject* _listenerObject;
-        
-        float _timeScale;
 
-        static Animation* getEmptyAnimation();
-        
-        static void applyRotateTimeline(RotateTimeline* rotateTimeline, Skeleton& skeleton, float time, float alpha, MixBlend pose, Vector<float>& timelinesRotation, size_t i, bool firstFrame);
-        
-        /// Returns true when all mixing from entries are complete.
-        bool updateMixingFrom(TrackEntry* to, float delta);
-        
-        float applyMixingFrom(TrackEntry* to, Skeleton& skeleton, MixBlend currentPose);
-        
-        void queueEvents(TrackEntry* entry, float animationTime);
-        
-        /// Sets the active TrackEntry for a given track number.
-        void setCurrent(size_t index, TrackEntry *current, bool interrupt);
+		float _timeScale;
+
+		static Animation* getEmptyAnimation();
+
+		static void applyRotateTimeline(RotateTimeline* rotateTimeline, Skeleton& skeleton, float time, float alpha, MixBlend pose, Vector<float>& timelinesRotation, size_t i, bool firstFrame);
+
+		/// Returns true when all mixing from entries are complete.
+		bool updateMixingFrom(TrackEntry* to, float delta);
 
-        TrackEntry* expandToIndex(size_t index);
+		float applyMixingFrom(TrackEntry* to, Skeleton& skeleton, MixBlend currentPose);
 
-        /// Object-pooling version of new TrackEntry. Obtain an unused TrackEntry from the pool and clear/initialize its values.
-        /// @param last May be NULL.
-        TrackEntry* newTrackEntry(size_t trackIndex, Animation *animation, bool loop, TrackEntry *last);
+		void queueEvents(TrackEntry* entry, float animationTime);
 
-        /// Dispose all track entries queued after the given TrackEntry.
-        void disposeNext(TrackEntry* entry);
+		/// Sets the active TrackEntry for a given track number.
+		void setCurrent(size_t index, TrackEntry *current, bool interrupt);
 
-        void animationsChanged();
+		TrackEntry* expandToIndex(size_t index);
 
-        void computeHold(TrackEntry *entry);
+		/// Object-pooling version of new TrackEntry. Obtain an unused TrackEntry from the pool and clear/initialize its values.
+		/// @param last May be NULL.
+		TrackEntry* newTrackEntry(size_t trackIndex, Animation *animation, bool loop, TrackEntry *last);
 
-        void computeNotLast(TrackEntry *entry);
+		/// Dispose all track entries queued after the given TrackEntry.
+		void disposeNext(TrackEntry* entry);
 
-        bool hasTimeline(TrackEntry *entry, int inId);
-    };
+		void animationsChanged();
+
+		void computeHold(TrackEntry *entry);
+
+		void computeNotLast(TrackEntry *entry);
+
+		bool hasTimeline(TrackEntry *entry, int inId);
+	};
 }
 
 #endif /* Spine_AnimationState_h */

+ 42 - 44
spine-cpp/spine-cpp/include/spine/AnimationStateData.h

@@ -37,51 +37,49 @@
 #include <assert.h>
 
 namespace spine {
-    class SkeletonData;
-    class Animation;
-    
-    /// Stores mix (crossfade) durations to be applied when AnimationState animations are changed.
-    class SP_API AnimationStateData : public SpineObject {
-        friend class AnimationState;
-        
-    public:
+	class SkeletonData;
+	class Animation;
+
+	/// Stores mix (crossfade) durations to be applied when AnimationState animations are changed.
+	class SP_API AnimationStateData : public SpineObject {
+		friend class AnimationState;
+
+	public:
 		explicit AnimationStateData(SkeletonData* skeletonData);
-		
-        /// The SkeletonData to look up animations when they are specified by name.
-        SkeletonData* getSkeletonData();
-        
-        /// The mix duration to use when no mix duration has been specifically defined between two animations.
-        float getDefaultMix();
-        void setDefaultMix(float inValue);
-        
-        /// Sets a mix duration by animation names.
-        void setMix(const String& fromName, const String& toName, float duration);
-        
-        /// Sets a mix duration when changing from the specified animation to the other.
-        /// See TrackEntry.MixDuration.
-        void setMix(Animation* from, Animation* to, float duration);
-        
-        ///
-        /// The mix duration to use when changing from the specified animation to the other,
-        /// or the DefaultMix if no mix duration has been set.
-        ///
-        float getMix(Animation* from, Animation* to);
-
-    private:
-        class AnimationPair : public SpineObject {
-        public:
-            Animation* _a1;
-            Animation* _a2;
-
-            explicit AnimationPair(Animation* a1 = NULL, Animation* a2 = NULL);
-            
-            bool operator==(const AnimationPair &other) const;
-        };
-        
-        SkeletonData* _skeletonData;
-        float _defaultMix;
-        HashMap<AnimationPair, float> _animationToMixTime;
-    };
+
+		/// The SkeletonData to look up animations when they are specified by name.
+		SkeletonData* getSkeletonData();
+
+		/// The mix duration to use when no mix duration has been specifically defined between two animations.
+		float getDefaultMix();
+		void setDefaultMix(float inValue);
+
+		/// Sets a mix duration by animation names.
+		void setMix(const String& fromName, const String& toName, float duration);
+
+		/// Sets a mix duration when changing from the specified animation to the other.
+		/// See TrackEntry.MixDuration.
+		void setMix(Animation* from, Animation* to, float duration);
+
+		/// The mix duration to use when changing from the specified animation to the other,
+		/// or the DefaultMix if no mix duration has been set.
+		float getMix(Animation* from, Animation* to);
+
+	private:
+		class AnimationPair : public SpineObject {
+		public:
+			Animation* _a1;
+			Animation* _a2;
+
+			explicit AnimationPair(Animation* a1 = NULL, Animation* a2 = NULL);
+
+			bool operator==(const AnimationPair &other) const;
+		};
+
+		SkeletonData* _skeletonData;
+		float _defaultMix;
+		HashMap<AnimationPair, float> _animationToMixTime;
+	};
 }
 
 #endif /* Spine_AnimationStateData_h */

+ 2 - 2
spine-cpp/spine-cpp/include/spine/Atlas.h

@@ -76,8 +76,8 @@ public:
 	int width, height;
 
 	explicit AtlasPage(const String &inName) : name(inName), format(Format_RGBA8888), minFilter(TextureFilter_Nearest),
-											   magFilter(TextureFilter_Nearest), uWrap(TextureWrap_ClampToEdge),
-											   vWrap(TextureWrap_ClampToEdge), width(0), height(0) {
+		magFilter(TextureFilter_Nearest), uWrap(TextureWrap_ClampToEdge),
+		vWrap(TextureWrap_ClampToEdge), width(0), height(0) {
 	}
 };
 

+ 26 - 28
spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h

@@ -36,38 +36,36 @@
 
 
 namespace spine {
-    class Atlas;
-    class AtlasRegion;
-    
-    ///
-    /// An AttachmentLoader that configures attachments using texture regions from an Atlas.
-    /// See http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data about Loading Skeleton Data in the Spine Runtimes Guide.
-    ///
+	class Atlas;
+	class AtlasRegion;
+
+	/// An AttachmentLoader that configures attachments using texture regions from an Atlas.
+	/// See http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data about Loading Skeleton Data in the Spine Runtimes Guide.
 	class SP_API AtlasAttachmentLoader : public AttachmentLoader {
-    public:
+	public:
 		RTTI_DECL
-		
-        explicit AtlasAttachmentLoader(Atlas* atlas);
-        
-        virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path);
-        
-        virtual MeshAttachment* newMeshAttachment(Skin& skin, const String& name, const String& path);
-        
-        virtual BoundingBoxAttachment* newBoundingBoxAttachment(Skin& skin, const String& name);
-        
-        virtual PathAttachment* newPathAttachment(Skin& skin, const String& name);
-        
-        virtual PointAttachment* newPointAttachment(Skin& skin, const String& name);
-        
-        virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name);
+
+		explicit AtlasAttachmentLoader(Atlas* atlas);
+
+		virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path);
+
+		virtual MeshAttachment* newMeshAttachment(Skin& skin, const String& name, const String& path);
+
+		virtual BoundingBoxAttachment* newBoundingBoxAttachment(Skin& skin, const String& name);
+
+		virtual PathAttachment* newPathAttachment(Skin& skin, const String& name);
+
+		virtual PointAttachment* newPointAttachment(Skin& skin, const String& name);
+
+		virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name);
 
 		virtual void configureAttachment(Attachment* attachment);
-        
-        AtlasRegion* findRegion(const String& name);
-        
-    private:
-        Atlas* _atlas;
-    };
+
+		AtlasRegion* findRegion(const String& name);
+
+	private:
+		Atlas* _atlas;
+	};
 }
 
 #endif /* Spine_AtlasAttachmentLoader_h */

+ 33 - 33
spine-cpp/spine-cpp/include/spine/AttachmentLoader.h

@@ -35,41 +35,41 @@
 #include <spine/SpineString.h>
 
 namespace spine {
-    class Skin;
-    class Attachment;
-    class RegionAttachment;
-    class MeshAttachment;
-    class BoundingBoxAttachment;
-    class PathAttachment;
-    class PointAttachment;
-    class ClippingAttachment;
-    
-    class SP_API AttachmentLoader : public SpineObject {
+	class Skin;
+	class Attachment;
+	class RegionAttachment;
+	class MeshAttachment;
+	class BoundingBoxAttachment;
+	class PathAttachment;
+	class PointAttachment;
+	class ClippingAttachment;
+
+	class SP_API AttachmentLoader : public SpineObject {
 	public:
-        RTTI_DECL
-        
-        AttachmentLoader();
-        
-        virtual ~AttachmentLoader();
-        
-        /// @return May be NULL to not load any attachment.
-        virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path) = 0;
-        
-        /// @return May be NULL to not load any attachment.
-        virtual MeshAttachment* newMeshAttachment(Skin& skin, const String& name, const String& path) = 0;
-        
-        /// @return May be NULL to not load any attachment.
-        virtual BoundingBoxAttachment* newBoundingBoxAttachment(Skin& skin, const String& name) = 0;
-        
-        /// @return May be NULL to not load any attachment
-        virtual PathAttachment* newPathAttachment(Skin& skin, const String& name) = 0;
-        
-        virtual PointAttachment* newPointAttachment(Skin& skin, const String& name) = 0;
-        
-        virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name) = 0;
+		RTTI_DECL
+
+		AttachmentLoader();
+
+		virtual ~AttachmentLoader();
+
+		/// @return May be NULL to not load any attachment.
+		virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path) = 0;
+
+		/// @return May be NULL to not load any attachment.
+		virtual MeshAttachment* newMeshAttachment(Skin& skin, const String& name, const String& path) = 0;
+
+		/// @return May be NULL to not load any attachment.
+		virtual BoundingBoxAttachment* newBoundingBoxAttachment(Skin& skin, const String& name) = 0;
+
+		/// @return May be NULL to not load any attachment
+		virtual PathAttachment* newPathAttachment(Skin& skin, const String& name) = 0;
+
+		virtual PointAttachment* newPointAttachment(Skin& skin, const String& name) = 0;
+
+		virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name) = 0;
 
-        virtual void configureAttachment(Attachment* attachment) = 0;
-    };
+		virtual void configureAttachment(Attachment* attachment) = 0;
+	};
 }
 
 #endif /* Spine_AttachmentLoader_h */

+ 27 - 27
spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h

@@ -39,35 +39,35 @@
 
 namespace spine {
 
-    class Skeleton;
-    class Event;
-    
-    class SP_API AttachmentTimeline : public Timeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        explicit AttachmentTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-        /// Sets the time and value of the specified keyframe.
-        void setFrame(int frameIndex, float time, const String& attachmentName);
-        
+	class Skeleton;
+	class Event;
+
+	class SP_API AttachmentTimeline : public Timeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		explicit AttachmentTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+		/// Sets the time and value of the specified keyframe.
+		void setFrame(int frameIndex, float time, const String& attachmentName);
+
 		size_t getSlotIndex();
-        void setSlotIndex(size_t inValue);
-        const Vector<float>& getFrames();
-        const Vector<String>& getAttachmentNames();
+		void setSlotIndex(size_t inValue);
+		const Vector<float>& getFrames();
+		const Vector<String>& getAttachmentNames();
 		size_t getFrameCount();
-    private:
-        size_t _slotIndex;
-        Vector<float> _frames;
-        Vector<String> _attachmentNames;
-    };
+	private:
+		size_t _slotIndex;
+		Vector<float> _frames;
+		Vector<String> _attachmentNames;
+	};
 }
 
 #endif /* Spine_AttachmentTimeline_h */

+ 9 - 9
spine-cpp/spine-cpp/include/spine/AttachmentType.h

@@ -31,15 +31,15 @@
 #define Spine_AttachmentType_h
 
 namespace spine {
-    enum AttachmentType {
-        AttachmentType_Region,
-        AttachmentType_Boundingbox,
-        AttachmentType_Mesh,
-        AttachmentType_Linkedmesh,
-        AttachmentType_Path,
-        AttachmentType_Point,
-        AttachmentType_Clipping
-    };
+	enum AttachmentType {
+		AttachmentType_Region,
+		AttachmentType_Boundingbox,
+		AttachmentType_Mesh,
+		AttachmentType_Linkedmesh,
+		AttachmentType_Path,
+		AttachmentType_Point,
+		AttachmentType_Clipping
+	};
 }
 
 #endif /* Spine_AttachmentType_h */

+ 0 - 2
spine-cpp/spine-cpp/include/spine/Bone.h

@@ -98,9 +98,7 @@ public:
 
 	float localToWorldRotation(float localRotation);
 
-	///
 	/// Rotates the world transform the specified amount and sets isAppliedValid to false.
-	///
 	/// @param degrees Degrees.
 	void rotateWorld(float degrees);
 

+ 6 - 6
spine-cpp/spine-cpp/include/spine/BoundingBoxAttachment.h

@@ -34,14 +34,14 @@
 #include <spine/SpineObject.h>
 
 namespace spine {
-    /// Attachment that has a polygon for bounds checking.
-    class SP_API BoundingBoxAttachment : public VertexAttachment {
-        RTTI_DECL
-        
-        explicit BoundingBoxAttachment(const String& name);
+	/// Attachment that has a polygon for bounds checking.
+	class SP_API BoundingBoxAttachment : public VertexAttachment {
+		RTTI_DECL
+
+		explicit BoundingBoxAttachment(const String& name);
 
 		virtual Attachment* copy();
-    };
+	};
 }
 
 #endif /* Spine_BoundingBoxAttachment_h */

+ 19 - 19
spine-cpp/spine-cpp/include/spine/ClippingAttachment.h

@@ -33,27 +33,27 @@
 #include <spine/VertexAttachment.h>
 
 namespace spine {
-    class SlotData;
-    
-    class SP_API ClippingAttachment : public VertexAttachment {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        friend class SkeletonClipping;
-        
-        RTTI_DECL
-        
-    public:
-        explicit ClippingAttachment(const String& name);
-        
-        SlotData* getEndSlot();
-        void setEndSlot(SlotData* inValue);
+	class SlotData;
+
+	class SP_API ClippingAttachment : public VertexAttachment {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		friend class SkeletonClipping;
+
+		RTTI_DECL
+
+	public:
+		explicit ClippingAttachment(const String& name);
+
+		SlotData* getEndSlot();
+		void setEndSlot(SlotData* inValue);
 
 		virtual Attachment* copy();
-        
-    private:
-        SlotData* _endSlot;
-    };
+
+	private:
+		SlotData* _endSlot;
+	};
 }
 
 #endif /* Spine_ClippingAttachment_h */

+ 1 - 1
spine-cpp/spine-cpp/include/spine/ColorTimeline.h

@@ -47,7 +47,7 @@ public:
 
 	virtual void
 	apply(Skeleton &skeleton, float lastTime, float time, Vector<Event *> *pEvents, float alpha, MixBlend blend,
-		  MixDirection direction);
+		MixDirection direction);
 
 	virtual int getPropertyId();
 

+ 83 - 83
spine-cpp/spine-cpp/include/spine/ContainerUtil.h

@@ -39,89 +39,89 @@
 #include <assert.h>
 
 namespace spine {
-    class SP_API ContainerUtil : public SpineObject {
-    public:
-        /// Finds an item by comparing each item's name.
-        /// It is more efficient to cache the results of this method than to call it multiple times.
-        /// @return May be NULL.
-        template<typename T>
-        static T* findWithName(Vector<T*>& items, const String& name) {
-            assert(name.length() > 0);
-            
-            for (size_t i = 0; i < items.size(); ++i) {
-                T* item = items[i];
-                if (item->getName() == name) {
-                    return item;
-                }
-            }
-            
-            return NULL;
-        }
-        
-        /// @return -1 if the item was not found.
-        template<typename T>
-        static int findIndexWithName(Vector<T*>& items, const String& name) {
-            assert(name.length() > 0);
-            
-            for (size_t i = 0, len = items.size(); i < len; ++i) {
-                T* item = items[i];
-                if (item->getName() == name) {
-                    return static_cast<int>(i);
-                }
-            }
-            
-            return -1;
-        }
-        
-        /// Finds an item by comparing each item's name.
-        /// It is more efficient to cache the results of this method than to call it multiple times.
-        /// @return May be NULL.
-        template<typename T>
-        static T* findWithDataName(Vector<T*>& items, const String& name) {
-            assert(name.length() > 0);
-            
-            for (size_t i = 0; i < items.size(); ++i) {
-                T* item = items[i];
-                if (item->getData().getName() == name) {
-                    return item;
-                }
-            }
-            
-            return NULL;
-        }
-        
-        /// @return -1 if the item was not found.
-        template<typename T>
-        static int findIndexWithDataName(Vector<T*>& items, const String& name) {
-            assert(name.length() > 0);
-            
-            for (size_t i = 0, len = items.size(); i < len; ++i) {
-                T* item = items[i];
-                if (item->getData().getName() == name) {
-                    return static_cast<int>(i);
-                }
-            }
-            
-            return -1;
-        }
-        
-        template<typename T>
-        static void cleanUpVectorOfPointers(Vector<T*>& items) {
-            for (int i = (int)items.size() - 1; i >= 0; i--) {
-                T* item = items[i];
-                
-                delete item;
-
-                items.removeAt(i);
-            }
-        }
-        
-    private:
-        // ctor, copy ctor, and assignment should be private in a Singleton
-        ContainerUtil();
-        ContainerUtil(const ContainerUtil&);
-        ContainerUtil& operator=(const ContainerUtil&);
-    };
+	class SP_API ContainerUtil : public SpineObject {
+	public:
+		/// Finds an item by comparing each item's name.
+		/// It is more efficient to cache the results of this method than to call it multiple times.
+		/// @return May be NULL.
+		template<typename T>
+		static T* findWithName(Vector<T*>& items, const String& name) {
+			assert(name.length() > 0);
+
+			for (size_t i = 0; i < items.size(); ++i) {
+				T* item = items[i];
+				if (item->getName() == name) {
+					return item;
+				}
+			}
+
+			return NULL;
+		}
+
+		/// @return -1 if the item was not found.
+		template<typename T>
+		static int findIndexWithName(Vector<T*>& items, const String& name) {
+			assert(name.length() > 0);
+
+			for (size_t i = 0, len = items.size(); i < len; ++i) {
+				T* item = items[i];
+				if (item->getName() == name) {
+					return static_cast<int>(i);
+				}
+			}
+
+			return -1;
+		}
+
+		/// Finds an item by comparing each item's name.
+		/// It is more efficient to cache the results of this method than to call it multiple times.
+		/// @return May be NULL.
+		template<typename T>
+		static T* findWithDataName(Vector<T*>& items, const String& name) {
+			assert(name.length() > 0);
+
+			for (size_t i = 0; i < items.size(); ++i) {
+				T* item = items[i];
+				if (item->getData().getName() == name) {
+					return item;
+				}
+			}
+
+			return NULL;
+		}
+
+		/// @return -1 if the item was not found.
+		template<typename T>
+		static int findIndexWithDataName(Vector<T*>& items, const String& name) {
+			assert(name.length() > 0);
+
+			for (size_t i = 0, len = items.size(); i < len; ++i) {
+				T* item = items[i];
+				if (item->getData().getName() == name) {
+					return static_cast<int>(i);
+				}
+			}
+
+			return -1;
+		}
+
+		template<typename T>
+		static void cleanUpVectorOfPointers(Vector<T*>& items) {
+			for (int i = (int)items.size() - 1; i >= 0; i--) {
+				T* item = items[i];
+
+				delete item;
+
+				items.removeAt(i);
+			}
+		}
+
+	private:
+		// ctor, copy ctor, and assignment should be private in a Singleton
+		ContainerUtil();
+		ContainerUtil(const ContainerUtil&);
+		ContainerUtil& operator=(const ContainerUtil&);
+	};
 }
 
 #endif /* Spine_ContainerUtil_h */

+ 37 - 37
spine-cpp/spine-cpp/include/spine/CurveTimeline.h

@@ -34,43 +34,43 @@
 #include <spine/Vector.h>
 
 namespace spine {
-    /// Base class for frames that use an interpolation bezier curve.
-    class SP_API CurveTimeline : public Timeline {
-        RTTI_DECL
-        
-    public:
-        explicit CurveTimeline(int frameCount);
-
-        virtual ~CurveTimeline();
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction) = 0;
-        
-        virtual int getPropertyId() = 0;
-        
-        size_t getFrameCount();
-        
-        void setLinear(size_t frameIndex);
-        
-        void setStepped(size_t frameIndex);
-        
-        /// Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
-        /// cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
-        /// the difference between the keyframe's values.
-        void setCurve(size_t frameIndex, float cx1, float cy1, float cx2, float cy2);
-        
-        float getCurvePercent(size_t frameIndex, float percent);
-        
-        float getCurveType(size_t frameIndex);
-        
-    protected:
-        static const float LINEAR;
-        static const float STEPPED;
-        static const float BEZIER;
-        static const int BEZIER_SIZE;
-        
-    private:
-        Vector<float> _curves; // type, x, y, ...
-    };
+	/// Base class for frames that use an interpolation bezier curve.
+	class SP_API CurveTimeline : public Timeline {
+		RTTI_DECL
+
+	public:
+		explicit CurveTimeline(int frameCount);
+
+		virtual ~CurveTimeline();
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction) = 0;
+
+		virtual int getPropertyId() = 0;
+
+		size_t getFrameCount();
+
+		void setLinear(size_t frameIndex);
+
+		void setStepped(size_t frameIndex);
+
+		/// Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
+		/// cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
+		/// the difference between the keyframe's values.
+		void setCurve(size_t frameIndex, float cx1, float cy1, float cx2, float cy2);
+
+		float getCurvePercent(size_t frameIndex, float percent);
+
+		float getCurveType(size_t frameIndex);
+
+	protected:
+		static const float LINEAR;
+		static const float STEPPED;
+		static const float BEZIER;
+		static const int BEZIER_SIZE;
+
+	private:
+		Vector<float> _curves; // type, x, y, ...
+	};
 }
 
 #endif /* Spine_CurveTimeline_h */

+ 31 - 31
spine-cpp/spine-cpp/include/spine/DeformTimeline.h

@@ -33,37 +33,37 @@
 #include <spine/CurveTimeline.h>
 
 namespace spine {
-    class VertexAttachment;
-    
-    class SP_API DeformTimeline : public CurveTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        explicit DeformTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-        /// Sets the time and value of the specified keyframe.
-        void setFrame(int frameIndex, float time, Vector<float>& vertices);
-        
-        int getSlotIndex();
-        void setSlotIndex(int inValue);
-        Vector<float>& getFrames();
-        Vector< Vector<float> >& getVertices();
-        VertexAttachment* getAttachment();
-        void setAttachment(VertexAttachment* inValue);
-        
-    private:
-        int _slotIndex;
-        Vector<float> _frames;
-        Vector< Vector<float> > _frameVertices;
-        VertexAttachment* _attachment;
-    };
+	class VertexAttachment;
+
+	class SP_API DeformTimeline : public CurveTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		explicit DeformTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+		/// Sets the time and value of the specified keyframe.
+		void setFrame(int frameIndex, float time, Vector<float>& vertices);
+
+		int getSlotIndex();
+		void setSlotIndex(int inValue);
+		Vector<float>& getFrames();
+		Vector< Vector<float> >& getVertices();
+		VertexAttachment* getAttachment();
+		void setAttachment(VertexAttachment* inValue);
+
+	private:
+		int _slotIndex;
+		Vector<float> _frames;
+		Vector< Vector<float> > _frameVertices;
+		VertexAttachment* _attachment;
+	};
 }
 
 #endif /* Spine_DeformTimeline_h */

+ 25 - 25
spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h

@@ -33,31 +33,31 @@
 #include <spine/Timeline.h>
 
 namespace spine {
-    class SP_API DrawOrderTimeline : public Timeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-    
-    public:
-        explicit DrawOrderTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-        /// Sets the time and value of the specified keyframe.
-        /// @param drawOrder May be NULL to use bind pose draw order
-        void setFrame(size_t frameIndex, float time, Vector<int>& drawOrder);
-        
-        Vector<float>& getFrames();
-        Vector< Vector<int> >& getDrawOrders();
-        size_t getFrameCount();
-    
-    private:
-        Vector<float> _frames;
-        Vector< Vector<int> > _drawOrders;
-    };
+	class SP_API DrawOrderTimeline : public Timeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		explicit DrawOrderTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+		/// Sets the time and value of the specified keyframe.
+		/// @param drawOrder May be NULL to use bind pose draw order
+		void setFrame(size_t frameIndex, float time, Vector<int>& drawOrder);
+
+		Vector<float>& getFrames();
+		Vector< Vector<int> >& getDrawOrders();
+		size_t getFrameCount();
+
+	private:
+		Vector<float> _frames;
+		Vector< Vector<int> > _drawOrders;
+	};
 }
 
 #endif /* Spine_DrawOrderTimeline_h */

+ 26 - 26
spine-cpp/spine-cpp/include/spine/EventTimeline.h

@@ -33,32 +33,32 @@
 #include <spine/Timeline.h>
 
 namespace spine {
-    class SP_API EventTimeline : public Timeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        explicit EventTimeline(int frameCount);
-        
-        ~EventTimeline();
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-        /// Sets the time and value of the specified keyframe.
-        void setFrame(size_t frameIndex, Event* event);
-        
-        Vector<float> getFrames();
-        Vector<Event*>& getEvents();
-        size_t getFrameCount();
-        
-    private:
-        Vector<float> _frames;
-        Vector<Event*> _events;
-    };
+	class SP_API EventTimeline : public Timeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		explicit EventTimeline(int frameCount);
+
+		~EventTimeline();
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+		/// Sets the time and value of the specified keyframe.
+		void setFrame(size_t frameIndex, Event* event);
+
+		Vector<float> getFrames();
+		Vector<Event*>& getEvents();
+		size_t getFrameCount();
+
+	private:
+		Vector<float> _frames;
+		Vector<Event*> _events;
+	};
 }
 
 #endif /* Spine_EventTimeline_h */

+ 1 - 1
spine-cpp/spine-cpp/include/spine/HashMap.h

@@ -34,7 +34,7 @@
 #include <spine/Vector.h>
 #include <spine/SpineObject.h>
 
- // Required for new with line number and file name in  MSVC
+ // Required for new with line number and file name in MSVC
 #ifdef _MSC_VER
 #pragma warning(disable:4291)
 #endif

+ 41 - 41
spine-cpp/spine-cpp/include/spine/IkConstraintData.h

@@ -36,54 +36,54 @@
 #include <spine/ConstraintData.h>
 
 namespace spine {
-    class BoneData;
-    
-    class SP_API IkConstraintData : public ConstraintData {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        friend class IkConstraint;
-        friend class Skeleton;
-        friend class IkConstraintTimeline;
-        
-    public:
-        explicit IkConstraintData(const String& name);
-        
-        /// The bones that are constrained by this IK Constraint.
-        Vector<BoneData*>& getBones();
-        
-        /// The bone that is the IK target.
-        BoneData* getTarget();
-        void setTarget(BoneData* inValue);
-        
-        /// Controls the bend direction of the IK bones, either 1 or -1.
-        int getBendDirection();
-        void setBendDirection(int inValue);
+	class BoneData;
 
-        bool getCompress();
-        void setCompress(bool inValue);
+	class SP_API IkConstraintData : public ConstraintData {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+		friend class IkConstraint;
+		friend class Skeleton;
+		friend class IkConstraintTimeline;
 
-        bool getStretch();
-        void setStretch(bool inValue);
+	public:
+		explicit IkConstraintData(const String& name);
 
-        bool getUniform();
-        void setUniform(bool inValue);
-        
-        float getMix();
-        void setMix(float inValue);
+		/// The bones that are constrained by this IK Constraint.
+		Vector<BoneData*>& getBones();
+
+		/// The bone that is the IK target.
+		BoneData* getTarget();
+		void setTarget(BoneData* inValue);
+
+		/// Controls the bend direction of the IK bones, either 1 or -1.
+		int getBendDirection();
+		void setBendDirection(int inValue);
+
+		bool getCompress();
+		void setCompress(bool inValue);
+
+		bool getStretch();
+		void setStretch(bool inValue);
+
+		bool getUniform();
+		void setUniform(bool inValue);
+
+		float getMix();
+		void setMix(float inValue);
 
 		float getSoftness();
 		void setSoftness(float inValue);
 
-    private:
-        Vector<BoneData*> _bones;
-        BoneData* _target;
-        int _bendDirection;
-        bool _compress;
-        bool _stretch;
-        bool _uniform;
-        float _mix;
-        float _softness;
-    };
+	private:
+		Vector<BoneData*> _bones;
+		BoneData* _target;
+		int _bendDirection;
+		bool _compress;
+		bool _stretch;
+		bool _uniform;
+		float _mix;
+		float _softness;
+	};
 }
 
 #endif /* Spine_IkConstraintData_h */

+ 22 - 22
spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h

@@ -34,25 +34,25 @@
 
 namespace spine {
 
-    class SP_API IkConstraintTimeline : public CurveTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        static const int ENTRIES;
-        
-        explicit IkConstraintTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-        /// Sets the time, mix and bend direction of the specified keyframe.
-        void setFrame (int frameIndex, float time, float mix, float softness, int bendDirection, bool compress, bool stretch);
-        
-    private:
+	class SP_API IkConstraintTimeline : public CurveTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		static const int ENTRIES;
+
+		explicit IkConstraintTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+		/// Sets the time, mix and bend direction of the specified keyframe.
+		void setFrame (int frameIndex, float time, float mix, float softness, int bendDirection, bool compress, bool stretch);
+
+	private:
 		static const int PREV_TIME;
 		static const int PREV_MIX;
 		static const int PREV_SOFTNESS;
@@ -65,9 +65,9 @@ namespace spine {
 		static const int COMPRESS;
 		static const int STRETCH;
 
-        Vector<float> _frames;
-        int _ikConstraintIndex;
-    };
+		Vector<float> _frames;
+		int _ikConstraintIndex;
+	};
 }
 
 #endif /* Spine_IkConstraintTimeline_h */

+ 94 - 94
spine-cpp/spine-cpp/include/spine/MeshAttachment.h

@@ -36,105 +36,105 @@
 #include <spine/HasRendererObject.h>
 
 namespace spine {
-    /// Attachment that displays a texture region using a mesh.
-    class SP_API MeshAttachment : public VertexAttachment, public HasRendererObject {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        friend class AtlasAttachmentLoader;
-        
-        RTTI_DECL
-        
-    public:
-        explicit MeshAttachment(const String& name);
-
-        virtual ~MeshAttachment();
-
-        void updateUVs();
-        
-        int getHullLength();
-        void setHullLength(int inValue);
-        
-        Vector<float>& getRegionUVs();
-        
-        /// The UV pair for each vertex, normalized within the entire texture. See also MeshAttachment::updateUVs
-        Vector<float>& getUVs();
-        
-        Vector<unsigned short>& getTriangles();
-        
-        Color& getColor();
-        
-        const String& getPath();
-        void setPath(const String& inValue);
-        
-        float getRegionU();
-        void setRegionU(float inValue);
-        
-        float getRegionV();
-        void setRegionV(float inValue);
-        
-        float getRegionU2();
-        void setRegionU2(float inValue);
-        
-        float getRegionV2();
-        void setRegionV2(float inValue);
-        
-        bool getRegionRotate();
-        void setRegionRotate(bool inValue);
-        
-        float getRegionOffsetX();
-        void setRegionOffsetX(float inValue);
-        
-        // Pixels stripped from the bottom left, unrotated.
-        float getRegionOffsetY();
-        void setRegionOffsetY(float inValue);
-        
-        float getRegionWidth();
-        void setRegionWidth(float inValue);
-        
-        // Unrotated, stripped size.
-        float getRegionHeight();
-        void setRegionHeight(float inValue);
-        
-        float getRegionOriginalWidth();
-        void setRegionOriginalWidth(float inValue);
-        
-        // Unrotated, unstripped size.
-        float getRegionOriginalHeight();
-        void setRegionOriginalHeight(float inValue);
-        
-        MeshAttachment* getParentMesh();
-        void setParentMesh(MeshAttachment* inValue);
-        
-        // Nonessential.
-        Vector<unsigned short>& getEdges();
-        float getWidth();
-        void setWidth(float inValue);
-        float getHeight();
-        void setHeight(float inValue);
+	/// Attachment that displays a texture region using a mesh.
+	class SP_API MeshAttachment : public VertexAttachment, public HasRendererObject {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+		friend class AtlasAttachmentLoader;
+
+		RTTI_DECL
+
+	public:
+		explicit MeshAttachment(const String& name);
+
+		virtual ~MeshAttachment();
+
+		void updateUVs();
+
+		int getHullLength();
+		void setHullLength(int inValue);
+
+		Vector<float>& getRegionUVs();
+
+		/// The UV pair for each vertex, normalized within the entire texture. See also MeshAttachment::updateUVs
+		Vector<float>& getUVs();
+
+		Vector<unsigned short>& getTriangles();
+
+		Color& getColor();
+
+		const String& getPath();
+		void setPath(const String& inValue);
+
+		float getRegionU();
+		void setRegionU(float inValue);
+
+		float getRegionV();
+		void setRegionV(float inValue);
+
+		float getRegionU2();
+		void setRegionU2(float inValue);
+
+		float getRegionV2();
+		void setRegionV2(float inValue);
+
+		bool getRegionRotate();
+		void setRegionRotate(bool inValue);
+
+		float getRegionOffsetX();
+		void setRegionOffsetX(float inValue);
+
+		// Pixels stripped from the bottom left, unrotated.
+		float getRegionOffsetY();
+		void setRegionOffsetY(float inValue);
+
+		float getRegionWidth();
+		void setRegionWidth(float inValue);
+
+		// Unrotated, stripped size.
+		float getRegionHeight();
+		void setRegionHeight(float inValue);
+
+		float getRegionOriginalWidth();
+		void setRegionOriginalWidth(float inValue);
+
+		// Unrotated, unstripped size.
+		float getRegionOriginalHeight();
+		void setRegionOriginalHeight(float inValue);
+
+		MeshAttachment* getParentMesh();
+		void setParentMesh(MeshAttachment* inValue);
+
+		// Nonessential.
+		Vector<unsigned short>& getEdges();
+		float getWidth();
+		void setWidth(float inValue);
+		float getHeight();
+		void setHeight(float inValue);
 
 		virtual Attachment* copy();
 
 		MeshAttachment* newLinkedMesh();
 
-    private:
-        float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
-        MeshAttachment* _parentMesh;
-        Vector<float> _uvs;
-        Vector<float> _regionUVs;
-        Vector<unsigned short> _triangles;
-        Vector<unsigned short> _edges;
-        String _path;
-        float _regionU;
-        float _regionV;
-        float _regionU2;
-        float _regionV2;
-        float _width;
-        float _height;
-        Color _color;
-        int _hullLength;
-        bool _regionRotate;
-        int _regionDegrees;
-    };
+	private:
+		float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
+		MeshAttachment* _parentMesh;
+		Vector<float> _uvs;
+		Vector<float> _regionUVs;
+		Vector<unsigned short> _triangles;
+		Vector<unsigned short> _edges;
+		String _path;
+		float _regionU;
+		float _regionV;
+		float _regionU2;
+		float _regionV2;
+		float _width;
+		float _height;
+		Color _color;
+		int _hullLength;
+		bool _regionRotate;
+		int _regionDegrees;
+	};
 }
 
 #endif /* Spine_MeshAttachment_h */

+ 1 - 1
spine-cpp/spine-cpp/include/spine/MixBlend.h

@@ -31,7 +31,7 @@
 #define Spine_MixPose_h
 
 namespace spine {
-///
+
 /// Controls how a timeline is mixed with the setup or current pose.
 /// See also Timeline::apply(Skeleton&, float, float, Vector&, float, Blend, MixDirection)
 enum MixBlend {

+ 2 - 1
spine-cpp/spine-cpp/include/spine/MixDirection.h

@@ -31,13 +31,14 @@
 #define Spine_MixDirection_h
 
 namespace spine {
-///
+
 /// Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose) or mixing in toward 1 (the timeline's pose).
 /// See also Timeline::apply(Skeleton&, float, float, Vector&, float, MixPose, MixDirection)
 enum MixDirection {
 	MixDirection_In = 0,
 	MixDirection_Out
 };
+
 }
 
 #endif /* Spine_MixDirection_h */

+ 20 - 20
spine-cpp/spine-cpp/include/spine/PathAttachment.h

@@ -33,28 +33,28 @@
 #include <spine/VertexAttachment.h>
 
 namespace spine {
-    class SP_API PathAttachment : public VertexAttachment {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        explicit PathAttachment(const String& name);
-        
-        /// The length in the setup pose from the start of the path to the end of each curve.
-        Vector<float>& getLengths();
-        bool isClosed();
-        void setClosed(bool inValue);
-        bool isConstantSpeed();
-        void setConstantSpeed(bool inValue);
+	class SP_API PathAttachment : public VertexAttachment {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		explicit PathAttachment(const String& name);
+
+		/// The length in the setup pose from the start of the path to the end of each curve.
+		Vector<float>& getLengths();
+		bool isClosed();
+		void setClosed(bool inValue);
+		bool isConstantSpeed();
+		void setConstantSpeed(bool inValue);
 
 		virtual Attachment* copy();
-    private:
-        Vector<float> _lengths;
-        bool _closed;
-        bool _constantSpeed;
-    };
+	private:
+		Vector<float> _lengths;
+		bool _closed;
+		bool _constantSpeed;
+	};
 }
 
 #endif /* Spine_PathAttachment_h */

+ 71 - 71
spine-cpp/spine-cpp/include/spine/PathConstraint.h

@@ -35,81 +35,81 @@
 #include <spine/Vector.h>
 
 namespace spine {
-    class PathConstraintData;
-    class Skeleton;
-    class PathAttachment;
-    class Bone;
-    class Slot;
-    
-    class SP_API PathConstraint : public Updatable {
-        friend class Skeleton;
-        friend class PathConstraintMixTimeline;
-        friend class PathConstraintPositionTimeline;
-        friend class PathConstraintSpacingTimeline;
-        
-        RTTI_DECL
-        
-    public:
-        PathConstraint(PathConstraintData& data, Skeleton& skeleton);
-        
-        /// Applies the constraint to the constrained bones.
-        void apply();
-        
-        virtual void update();
-        
-        virtual int getOrder();
-        
-        float getPosition();
-        void setPosition(float inValue);
-        
-        float getSpacing();
-        void setSpacing(float inValue);
-        
-        float getRotateMix();
-        void setRotateMix(float inValue);
-        
-        float getTranslateMix();
-        void setTranslateMix(float inValue);
-        
-        Vector<Bone*>& getBones();
-        
-        Slot* getTarget();
-        void setTarget(Slot* inValue);
-        
-        PathConstraintData& getData();
+	class PathConstraintData;
+	class Skeleton;
+	class PathAttachment;
+	class Bone;
+	class Slot;
+
+	class SP_API PathConstraint : public Updatable {
+		friend class Skeleton;
+		friend class PathConstraintMixTimeline;
+		friend class PathConstraintPositionTimeline;
+		friend class PathConstraintSpacingTimeline;
+
+		RTTI_DECL
+
+	public:
+		PathConstraint(PathConstraintData& data, Skeleton& skeleton);
+
+		/// Applies the constraint to the constrained bones.
+		void apply();
+
+		virtual void update();
+
+		virtual int getOrder();
+
+		float getPosition();
+		void setPosition(float inValue);
+
+		float getSpacing();
+		void setSpacing(float inValue);
+
+		float getRotateMix();
+		void setRotateMix(float inValue);
+
+		float getTranslateMix();
+		void setTranslateMix(float inValue);
+
+		Vector<Bone*>& getBones();
+
+		Slot* getTarget();
+		void setTarget(Slot* inValue);
+
+		PathConstraintData& getData();
 
 		bool isActive();
 
 		void setActive(bool inValue);
-        
-    private:
-        static const float EPSILON;
-        static const int NONE;
-        static const int BEFORE;
-        static const int AFTER;
-        
-        PathConstraintData& _data;
-        Vector<Bone*> _bones;
-        Slot* _target;
-        float _position, _spacing, _rotateMix, _translateMix;
-        
-        Vector<float> _spaces;
-        Vector<float> _positions;
-        Vector<float> _world;
-        Vector<float> _curves;
-        Vector<float> _lengths;
-        Vector<float> _segments;
-
-        bool _active;
-        
-        Vector<float>& computeWorldPositions(PathAttachment& path, int spacesCount, bool tangents, bool percentPosition, bool percentSpacing);
-        
-        static void addBeforePosition(float p, Vector<float>& temp, int i, Vector<float>& output, int o);
-        
-        static void addAfterPosition(float p, Vector<float>& temp, int i, Vector<float>& output, int o);
-        
-        static void addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, Vector<float>& output, int o, bool tangents);
-    };
+
+	private:
+		static const float EPSILON;
+		static const int NONE;
+		static const int BEFORE;
+		static const int AFTER;
+
+		PathConstraintData& _data;
+		Vector<Bone*> _bones;
+		Slot* _target;
+		float _position, _spacing, _rotateMix, _translateMix;
+
+		Vector<float> _spaces;
+		Vector<float> _positions;
+		Vector<float> _world;
+		Vector<float> _curves;
+		Vector<float> _lengths;
+		Vector<float> _segments;
+
+		bool _active;
+
+		Vector<float>& computeWorldPositions(PathAttachment& path, int spacesCount, bool tangents, bool percentPosition, bool percentSpacing);
+
+		static void addBeforePosition(float p, Vector<float>& temp, int i, Vector<float>& output, int o);
+
+		static void addAfterPosition(float p, Vector<float>& temp, int i, Vector<float>& output, int o);
+
+		static void addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, Vector<float>& output, int o, bool tangents);
+	};
 }
 
 #endif /* Spine_PathConstraint_h */

+ 54 - 54
spine-cpp/spine-cpp/include/spine/PathConstraintData.h

@@ -39,60 +39,60 @@
 #include <spine/ConstraintData.h>
 
 namespace spine {
-    class BoneData;
-    class SlotData;
-    
-    class SP_API PathConstraintData : public ConstraintData {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        friend class PathConstraint;
-        friend class Skeleton;
-        friend class PathConstraintMixTimeline;
-        friend class PathConstraintPositionTimeline;
-        friend class PathConstraintSpacingTimeline;
-        
-    public:
-        explicit PathConstraintData(const String& name);
-        
-        Vector<BoneData*>& getBones();
-        
-        SlotData* getTarget();
-        void setTarget(SlotData* inValue);
-        
-        PositionMode getPositionMode();
-        void setPositionMode(PositionMode inValue);
-        
-        SpacingMode getSpacingMode();
-        void setSpacingMode(SpacingMode inValue);
-        
-        RotateMode getRotateMode();
-        void setRotateMode(RotateMode inValue);
-        
-        float getOffsetRotation();
-        void setOffsetRotation(float inValue);
-        
-        float getPosition();
-        void setPosition(float inValue);
-        
-        float getSpacing();
-        void setSpacing(float inValue);
-        
-        float getRotateMix();
-        void setRotateMix(float inValue);
-        
-        float getTranslateMix();
-        void setTranslateMix(float inValue);
-
-    private:
-        Vector<BoneData*> _bones;
-        SlotData* _target;
-        PositionMode _positionMode;
-        SpacingMode _spacingMode;
-        RotateMode _rotateMode;
-        float _offsetRotation;
-        float _position, _spacing, _rotateMix, _translateMix;
-    };
+	class BoneData;
+	class SlotData;
+
+	class SP_API PathConstraintData : public ConstraintData {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		friend class PathConstraint;
+		friend class Skeleton;
+		friend class PathConstraintMixTimeline;
+		friend class PathConstraintPositionTimeline;
+		friend class PathConstraintSpacingTimeline;
+
+	public:
+		explicit PathConstraintData(const String& name);
+
+		Vector<BoneData*>& getBones();
+
+		SlotData* getTarget();
+		void setTarget(SlotData* inValue);
+
+		PositionMode getPositionMode();
+		void setPositionMode(PositionMode inValue);
+
+		SpacingMode getSpacingMode();
+		void setSpacingMode(SpacingMode inValue);
+
+		RotateMode getRotateMode();
+		void setRotateMode(RotateMode inValue);
+
+		float getOffsetRotation();
+		void setOffsetRotation(float inValue);
+
+		float getPosition();
+		void setPosition(float inValue);
+
+		float getSpacing();
+		void setSpacing(float inValue);
+
+		float getRotateMix();
+		void setRotateMix(float inValue);
+
+		float getTranslateMix();
+		void setTranslateMix(float inValue);
+
+	private:
+		Vector<BoneData*> _bones;
+		SlotData* _target;
+		PositionMode _positionMode;
+		SpacingMode _spacingMode;
+		RotateMode _rotateMode;
+		float _offsetRotation;
+		float _position, _spacing, _rotateMix, _translateMix;
+	};
 }
 
 #endif /* Spine_PathConstraintData_h */

+ 23 - 23
spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h

@@ -35,34 +35,34 @@
 namespace spine {
 #define SP_PATHCONSTRAINTMIXTIMELINE_ENTRIES 5
 
-    class SP_API PathConstraintMixTimeline : public CurveTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        static const int ENTRIES;
-        
-        explicit PathConstraintMixTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-    private:
+	class SP_API PathConstraintMixTimeline : public CurveTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		static const int ENTRIES;
+
+		explicit PathConstraintMixTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+	private:
 		static const int PREV_TIME;
 		static const int PREV_ROTATE;
 		static const int PREV_TRANSLATE;
 		static const int ROTATE;
 		static const int TRANSLATE;
-        
-        Vector<float> _frames;
-        int _pathConstraintIndex;
-        
-        /// Sets the time and mixes of the specified keyframe.
-        void setFrame(int frameIndex, float time, float rotateMix, float translateMix);
-    };
+
+		Vector<float> _frames;
+		int _pathConstraintIndex;
+
+		/// Sets the time and mixes of the specified keyframe.
+		void setFrame(int frameIndex, float time, float rotateMix, float translateMix);
+	};
 }
 
 #endif /* Spine_PathConstraintMixTimeline_h */

+ 25 - 25
spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h

@@ -34,34 +34,34 @@
 
 namespace spine {
 
-    class SP_API PathConstraintPositionTimeline : public CurveTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        static const int ENTRIES;
-        
-        explicit PathConstraintPositionTimeline(int frameCount);
+	class SP_API PathConstraintPositionTimeline : public CurveTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
 
-        virtual ~PathConstraintPositionTimeline();
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-        /// Sets the time and value of the specified keyframe.
-        void setFrame(int frameIndex, float time, float value);
-        
-    protected:
+		RTTI_DECL
+
+	public:
+		static const int ENTRIES;
+
+		explicit PathConstraintPositionTimeline(int frameCount);
+
+		virtual ~PathConstraintPositionTimeline();
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+		/// Sets the time and value of the specified keyframe.
+		void setFrame(int frameIndex, float time, float value);
+
+	protected:
 		static const int PREV_TIME;
 		static const int PREV_VALUE;
-        static const int VALUE;
-        
-        Vector<float> _frames;
-        int _pathConstraintIndex;
-    };
+		static const int VALUE;
+
+		Vector<float> _frames;
+		int _pathConstraintIndex;
+	};
 }
 
 #endif /* Spine_PathConstraintPositionTimeline_h */

+ 13 - 13
spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h

@@ -33,19 +33,19 @@
 #include <spine/PathConstraintPositionTimeline.h>
 
 namespace spine {
-    class SP_API PathConstraintSpacingTimeline : public PathConstraintPositionTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        explicit PathConstraintSpacingTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-    };
+	class SP_API PathConstraintSpacingTimeline : public PathConstraintPositionTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		explicit PathConstraintSpacingTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+	};
 }
 
 #endif /* Spine_PathConstraintSpacingTimeline_h */

+ 34 - 35
spine-cpp/spine-cpp/include/spine/PointAttachment.h

@@ -33,42 +33,41 @@
 #include <spine/Attachment.h>
 
 namespace spine {
-    class Bone;
-    
-    /// 
-    /// An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be
-    /// used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a
-    /// skin.
-    ///
-    /// See http://esotericsoftware.com/spine-point-attachments for Point Attachments in the Spine User Guide.
-    /// 
-    class SP_API PointAttachment : public Attachment {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        explicit PointAttachment(const String& name);
-        
-        void computeWorldPosition(Bone& bone, float& ox, float& oy);
-        
-        float computeWorldRotation(Bone& bone);
-        
-        float getX();
-        void setX(float inValue);
-        
-        float getY();
-        void setY(float inValue);
-        
-        float getRotation();
-        void setRotation(float inValue);
+	class Bone;
 
-        virtual Attachment* copy();
-        
-    private:
-        float _x, _y, _rotation;
-    };
+	/// An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be
+	/// used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a
+	/// skin.
+	///
+	/// See http://esotericsoftware.com/spine-point-attachments for Point Attachments in the Spine User Guide.
+	///
+	class SP_API PointAttachment : public Attachment {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		explicit PointAttachment(const String& name);
+
+		void computeWorldPosition(Bone& bone, float& ox, float& oy);
+
+		float computeWorldRotation(Bone& bone);
+
+		float getX();
+		void setX(float inValue);
+
+		float getY();
+		void setY(float inValue);
+
+		float getRotation();
+		void setRotation(float inValue);
+
+		virtual Attachment* copy();
+
+	private:
+		float _x, _y, _rotation;
+	};
 }
 
 #endif /* Spine_PointAttachment_h */

+ 1 - 1
spine-cpp/spine-cpp/include/spine/Pool.h

@@ -54,7 +54,7 @@ public:
 
 			return ret;
 		} else {
-			T *ret = new(__FILE__, __LINE__)  T();
+			T *ret = new(__FILE__, __LINE__) T();
 
 			return ret;
 		}

+ 88 - 88
spine-cpp/spine-cpp/include/spine/RegionAttachment.h

@@ -40,95 +40,95 @@
 #define NUM_UVS 8
 
 namespace spine {
-    class Bone;
-    
-    /// Attachment that displays a texture region.
-    class SP_API RegionAttachment : public Attachment, public HasRendererObject {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        friend class AtlasAttachmentLoader;
-        
-        RTTI_DECL
-        
-    public:
-        explicit RegionAttachment(const String& name);
-
-        void updateOffset();
-        
-        void setUVs(float u, float v, float u2, float v2, bool rotate);
-        
-        /// Transforms the attachment's four vertices to world coordinates.
-        /// @param bone The parent bone.
-        /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + 8.
-        /// @param offset The worldVertices index to begin writing values.
-        /// @param stride The number of worldVertices entries between the value pairs written.
+	class Bone;
+
+	/// Attachment that displays a texture region.
+	class SP_API RegionAttachment : public Attachment, public HasRendererObject {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+		friend class AtlasAttachmentLoader;
+
+		RTTI_DECL
+
+	public:
+		explicit RegionAttachment(const String& name);
+
+		void updateOffset();
+
+		void setUVs(float u, float v, float u2, float v2, bool rotate);
+
+		/// Transforms the attachment's four vertices to world coordinates.
+		/// @param bone The parent bone.
+		/// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + 8.
+		/// @param offset The worldVertices index to begin writing values.
+		/// @param stride The number of worldVertices entries between the value pairs written.
 		void computeWorldVertices(Bone& bone, float *worldVertices, size_t offset, size_t stride = 2);
-        void computeWorldVertices(Bone& bone, Vector<float>& worldVertices, size_t offset, size_t stride = 2);
-        
-        float getX();
-        void setX(float inValue);
-        float getY();
-        void setY(float inValue);
-        float getRotation();
-        void setRotation(float inValue);
-        float getScaleX();
-        void setScaleX(float inValue);
-        float getScaleY();
-        void setScaleY(float inValue);
-        float getWidth();
-        void setWidth(float inValue);
-        float getHeight();
-        void setHeight(float inValue);
-
-        Color& getColor();
-
-        const String& getPath();
-        void setPath(const String& inValue);
-
-        float getRegionOffsetX();
-        void setRegionOffsetX(float inValue);
-
-        float getRegionOffsetY();
-        void setRegionOffsetY(float inValue);
-
-        float getRegionWidth();
-        void setRegionWidth(float inValue);
-
-        float getRegionHeight();
-        void setRegionHeight(float inValue);
-
-        float getRegionOriginalWidth();
-        void setRegionOriginalWidth(float inValue);
-
-        float getRegionOriginalHeight();
-        void setRegionOriginalHeight(float inValue);
-        
-        Vector<float>& getOffset();
-        Vector<float>& getUVs();
-
-        virtual Attachment* copy();
-        
-    private:
-        static const int BLX;
-        static const int BLY;
-        static const int ULX;
-        static const int ULY;
-        static const int URX;
-        static const int URY;
-        static const int BRX;
-        static const int BRY;
-        
-        float _x, _y, _rotation, _scaleX, _scaleY, _width, _height;
-        float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
-        Vector<float> _vertexOffset;
-        Vector<float> _uvs;
-        String _path;
-        float _regionU;
-        float _regionV;
-        float _regionU2;
-        float _regionV2;
-        Color _color;
-    };
+		void computeWorldVertices(Bone& bone, Vector<float>& worldVertices, size_t offset, size_t stride = 2);
+
+		float getX();
+		void setX(float inValue);
+		float getY();
+		void setY(float inValue);
+		float getRotation();
+		void setRotation(float inValue);
+		float getScaleX();
+		void setScaleX(float inValue);
+		float getScaleY();
+		void setScaleY(float inValue);
+		float getWidth();
+		void setWidth(float inValue);
+		float getHeight();
+		void setHeight(float inValue);
+
+		Color& getColor();
+
+		const String& getPath();
+		void setPath(const String& inValue);
+
+		float getRegionOffsetX();
+		void setRegionOffsetX(float inValue);
+
+		float getRegionOffsetY();
+		void setRegionOffsetY(float inValue);
+
+		float getRegionWidth();
+		void setRegionWidth(float inValue);
+
+		float getRegionHeight();
+		void setRegionHeight(float inValue);
+
+		float getRegionOriginalWidth();
+		void setRegionOriginalWidth(float inValue);
+
+		float getRegionOriginalHeight();
+		void setRegionOriginalHeight(float inValue);
+
+		Vector<float>& getOffset();
+		Vector<float>& getUVs();
+
+		virtual Attachment* copy();
+
+	private:
+		static const int BLX;
+		static const int BLY;
+		static const int ULX;
+		static const int ULY;
+		static const int URX;
+		static const int URY;
+		static const int BRX;
+		static const int BRY;
+
+		float _x, _y, _rotation, _scaleX, _scaleY, _width, _height;
+		float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
+		Vector<float> _vertexOffset;
+		Vector<float> _uvs;
+		String _path;
+		float _regionU;
+		float _regionV;
+		float _regionU2;
+		float _regionV2;
+		Color _color;
+	};
 }
 
 #endif /* Spine_RegionAttachment_h */

+ 31 - 31
spine-cpp/spine-cpp/include/spine/RotateTimeline.h

@@ -33,38 +33,38 @@
 #include <spine/CurveTimeline.h>
 
 namespace spine {
-    class SP_API RotateTimeline : public CurveTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        friend class AnimationState;
-        
-        RTTI_DECL
-        
-    public:
-        static const int ENTRIES = 2;
+	class SP_API RotateTimeline : public CurveTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+		friend class AnimationState;
 
-        explicit RotateTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-        /// Sets the time and value of the specified keyframe.
-        void setFrame(int frameIndex, float time, float degrees);
-        
-        int getBoneIndex();
-        void setBoneIndex(int inValue);
-        
-        Vector<float>& getFrames();
-        
-    private:
-        static const int PREV_TIME = -2;
-        static const int PREV_ROTATION = -1;
-        static const int ROTATION = 1;
-        
-        int _boneIndex;
-        Vector<float> _frames; // time, angle, ...
-    };
+		RTTI_DECL
+
+	public:
+		static const int ENTRIES = 2;
+
+		explicit RotateTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+		/// Sets the time and value of the specified keyframe.
+		void setFrame(int frameIndex, float time, float degrees);
+
+		int getBoneIndex();
+		void setBoneIndex(int inValue);
+
+		Vector<float>& getFrames();
+
+	private:
+		static const int PREV_TIME = -2;
+		static const int PREV_ROTATION = -1;
+		static const int ROTATION = 1;
+
+		int _boneIndex;
+		Vector<float> _frames; // time, angle, ...
+	};
 }
 
 #endif /* Spine_RotateTimeline_h */

+ 13 - 13
spine-cpp/spine-cpp/include/spine/ScaleTimeline.h

@@ -33,19 +33,19 @@
 #include <spine/TranslateTimeline.h>
 
 namespace spine {
-    class SP_API ScaleTimeline : public TranslateTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        explicit ScaleTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-    };
+	class SP_API ScaleTimeline : public TranslateTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		explicit ScaleTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+	};
 }
 
 #endif /* Spine_ScaleTimeline_h */

+ 13 - 13
spine-cpp/spine-cpp/include/spine/ShearTimeline.h

@@ -33,19 +33,19 @@
 #include <spine/TranslateTimeline.h>
 
 namespace spine {
-    class SP_API ShearTimeline : public TranslateTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        explicit ShearTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-    };
+	class SP_API ShearTimeline : public TranslateTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		RTTI_DECL
+
+	public:
+		explicit ShearTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+	};
 }
 
 #endif /* Spine_ShearTimeline_h */

+ 0 - 1
spine-cpp/spine-cpp/include/spine/Skeleton.h

@@ -135,7 +135,6 @@ public:
 	/// See Skeleton::setSlotsToSetupPose()
 	/// Also, often AnimationState::apply(Skeleton&) is called before the next time the
 	/// skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.
-	///
 	/// @param newSkin May be NULL.
 	void setSkin(Skin *newSkin);
 

+ 89 - 89
spine-cpp/spine-cpp/include/spine/SkeletonBinary.h

@@ -37,95 +37,95 @@
 #include <spine/Color.h>
 
 namespace spine {
-    class SkeletonData;
-    class Atlas;
-    class AttachmentLoader;
-    class LinkedMesh;
-    class Skin;
-    class Attachment;
-    class VertexAttachment;
-    class Animation;
-    class CurveTimeline;
-    
-    class SP_API SkeletonBinary : public SpineObject {
-    public:
-        static const int BONE_ROTATE;
-        static const int BONE_TRANSLATE;
-        static const int BONE_SCALE;
-        static const int BONE_SHEAR;
-        
-        static const int SLOT_ATTACHMENT;
-        static const int SLOT_COLOR;
-        static const int SLOT_TWO_COLOR;
-        
-        static const int PATH_POSITION;
-        static const int PATH_SPACING;
-        static const int PATH_MIX;
-        
-        static const int CURVE_LINEAR;
-        static const int CURVE_STEPPED;
-        static const int CURVE_BEZIER;
-
-        explicit SkeletonBinary(Atlas* atlasArray);
-
-        explicit SkeletonBinary(AttachmentLoader* attachmentLoader);
-        
-        ~SkeletonBinary();
-        
-        SkeletonData* readSkeletonData(const unsigned char* binary, int length);
-        
-        SkeletonData* readSkeletonDataFile(const String& path);
-
-        void setScale(float scale) { _scale = scale; }
-
-        String& getError() { return _error; }
-        
-    private:
-        struct DataInput : public SpineObject {
-            const unsigned char* cursor;
-            const unsigned char* end;
-        };
-        
-        AttachmentLoader* _attachmentLoader;
-        Vector<LinkedMesh*> _linkedMeshes;
-        String _error;
-        float _scale;
-        const bool _ownsLoader;
-        
-        void setError(const char* value1, const char* value2);
-        
-        char* readString(DataInput* input);
-
-        char* readStringRef(DataInput* input, SkeletonData* skeletonData);
-        
-        float readFloat(DataInput* input);
-        
-        unsigned char readByte(DataInput* input);
-        
-        signed char readSByte(DataInput* input);
-        
-        bool readBoolean(DataInput* input);
-        
-        int readInt(DataInput* input);
-        
-        void readColor(DataInput* input, Color& color);
-        
-        int readVarint(DataInput* input, bool optimizePositive);
-        
-        Skin* readSkin(DataInput* input, bool defaultSkin, SkeletonData* skeletonData, bool nonessential);
-        
-        Attachment* readAttachment(DataInput* input, Skin* skin, int slotIndex, const String& attachmentName, SkeletonData* skeletonData, bool nonessential);
-        
-        void readVertices(DataInput* input, VertexAttachment* attachment, int vertexCount);
-        
-        void readFloatArray(DataInput *input, int n, float scale, Vector<float>& array);
-        
-        void readShortArray(DataInput *input, Vector<unsigned short>& array);
-        
-        Animation* readAnimation(const String& name, DataInput* input, SkeletonData *skeletonData);
-        
-        void readCurve(DataInput* input, int frameIndex, CurveTimeline* timeline);
-    };
+	class SkeletonData;
+	class Atlas;
+	class AttachmentLoader;
+	class LinkedMesh;
+	class Skin;
+	class Attachment;
+	class VertexAttachment;
+	class Animation;
+	class CurveTimeline;
+
+	class SP_API SkeletonBinary : public SpineObject {
+	public:
+		static const int BONE_ROTATE;
+		static const int BONE_TRANSLATE;
+		static const int BONE_SCALE;
+		static const int BONE_SHEAR;
+
+		static const int SLOT_ATTACHMENT;
+		static const int SLOT_COLOR;
+		static const int SLOT_TWO_COLOR;
+
+		static const int PATH_POSITION;
+		static const int PATH_SPACING;
+		static const int PATH_MIX;
+
+		static const int CURVE_LINEAR;
+		static const int CURVE_STEPPED;
+		static const int CURVE_BEZIER;
+
+		explicit SkeletonBinary(Atlas* atlasArray);
+
+		explicit SkeletonBinary(AttachmentLoader* attachmentLoader);
+
+		~SkeletonBinary();
+
+		SkeletonData* readSkeletonData(const unsigned char* binary, int length);
+
+		SkeletonData* readSkeletonDataFile(const String& path);
+
+		void setScale(float scale) { _scale = scale; }
+
+		String& getError() { return _error; }
+
+	private:
+		struct DataInput : public SpineObject {
+			const unsigned char* cursor;
+			const unsigned char* end;
+		};
+
+		AttachmentLoader* _attachmentLoader;
+		Vector<LinkedMesh*> _linkedMeshes;
+		String _error;
+		float _scale;
+		const bool _ownsLoader;
+
+		void setError(const char* value1, const char* value2);
+
+		char* readString(DataInput* input);
+
+		char* readStringRef(DataInput* input, SkeletonData* skeletonData);
+
+		float readFloat(DataInput* input);
+
+		unsigned char readByte(DataInput* input);
+
+		signed char readSByte(DataInput* input);
+
+		bool readBoolean(DataInput* input);
+
+		int readInt(DataInput* input);
+
+		void readColor(DataInput* input, Color& color);
+
+		int readVarint(DataInput* input, bool optimizePositive);
+
+		Skin* readSkin(DataInput* input, bool defaultSkin, SkeletonData* skeletonData, bool nonessential);
+
+		Attachment* readAttachment(DataInput* input, Skin* skin, int slotIndex, const String& attachmentName, SkeletonData* skeletonData, bool nonessential);
+
+		void readVertices(DataInput* input, VertexAttachment* attachment, int vertexCount);
+
+		void readFloatArray(DataInput *input, int n, float scale, Vector<float>& array);
+
+		void readShortArray(DataInput *input, Vector<unsigned short>& array);
+
+		Animation* readAnimation(const String& name, DataInput* input, SkeletonData *skeletonData);
+
+		void readCurve(DataInput* input, int frameIndex, CurveTimeline* timeline);
+	};
 }
 
 #endif /* Spine_SkeletonBinary_h */

+ 64 - 67
spine-cpp/spine-cpp/include/spine/SkeletonBounds.h

@@ -34,74 +34,71 @@
 #include <spine/SpineObject.h>
 
 namespace spine {
-    class Skeleton;
-    class BoundingBoxAttachment;
-    class Polygon;
-    
-    /// 
-    /// Collects each BoundingBoxAttachment that is visible and computes the world vertices for its polygon.
-    /// The polygon vertices are provided along with convenience methods for doing hit detection.
-    ///
-    class SP_API SkeletonBounds : public SpineObject {
-    public:
-        SkeletonBounds();
-        
-        ///
-        /// Clears any previous polygons, finds all visible bounding box attachments,
-        /// and computes the world vertices for each bounding box's polygon.
-        /// @param skeleton The skeleton.
-        /// @param updateAabb
-        /// If true, the axis aligned bounding box containing all the polygons is computed.
-        /// If false, the SkeletonBounds AABB methods will always return true.
-        ///
-        void update(Skeleton& skeleton, bool updateAabb);
-        
-        /// Returns true if the axis aligned bounding box contains the point.
-        bool aabbcontainsPoint(float x, float y);
-        
-        /// Returns true if the axis aligned bounding box intersects the line segment.
-        bool aabbintersectsSegment(float x1, float y1, float x2, float y2);
-        
-        /// Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds.
-        bool aabbIntersectsSkeleton(SkeletonBounds bounds);
-        
-        /// Returns true if the polygon contains the point.
-        bool containsPoint(Polygon* polygon, float x, float y);
-        
-        /// Returns the first bounding box attachment that contains the point, or NULL. When doing many checks, it is usually more
-        /// efficient to only call this method if {@link #aabbcontainsPoint(float, float)} returns true.
-        BoundingBoxAttachment* containsPoint(float x, float y);
-        
-        /// Returns the first bounding box attachment that contains the line segment, or NULL. When doing many checks, it is usually
-        /// more efficient to only call this method if {@link #aabbintersectsSegment(float, float, float, float)} returns true.
-        BoundingBoxAttachment* intersectsSegment(float x1, float y1, float x2, float y2);
-        
-        /// Returns true if the polygon contains the line segment.
-        bool intersectsSegment(Polygon* polygon, float x1, float y1, float x2, float y2);
-        
-        Polygon* getPolygon(BoundingBoxAttachment* attachment);
-
-        float getWidth();
-        float getHeight();
-
-    private:
-        Vector<Polygon*> _polygonPool;
-        Vector<BoundingBoxAttachment*> _boundingBoxes;
-        Vector<Polygon*> _polygons;
-        float _minX, _minY, _maxX, _maxY;
-        
-        void aabbCompute();
-    };
-    
-    class Polygon : public SpineObject {
-    public:
-        Vector<float> _vertices;
-        int _count;
-        
-        Polygon() : _count(0) {
+	class Skeleton;
+	class BoundingBoxAttachment;
+	class Polygon;
+
+	/// Collects each BoundingBoxAttachment that is visible and computes the world vertices for its polygon.
+	/// The polygon vertices are provided along with convenience methods for doing hit detection.
+	class SP_API SkeletonBounds : public SpineObject {
+	public:
+		SkeletonBounds();
+
+		/// Clears any previous polygons, finds all visible bounding box attachments,
+		/// and computes the world vertices for each bounding box's polygon.
+		/// @param skeleton The skeleton.
+		/// @param updateAabb
+		/// If true, the axis aligned bounding box containing all the polygons is computed.
+		/// If false, the SkeletonBounds AABB methods will always return true.
+		///
+		void update(Skeleton& skeleton, bool updateAabb);
+
+		/// Returns true if the axis aligned bounding box contains the point.
+		bool aabbcontainsPoint(float x, float y);
+
+		/// Returns true if the axis aligned bounding box intersects the line segment.
+		bool aabbintersectsSegment(float x1, float y1, float x2, float y2);
+
+		/// Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds.
+		bool aabbIntersectsSkeleton(SkeletonBounds bounds);
+
+		/// Returns true if the polygon contains the point.
+		bool containsPoint(Polygon* polygon, float x, float y);
+
+		/// Returns the first bounding box attachment that contains the point, or NULL. When doing many checks, it is usually more
+		/// efficient to only call this method if {@link #aabbcontainsPoint(float, float)} returns true.
+		BoundingBoxAttachment* containsPoint(float x, float y);
+
+		/// Returns the first bounding box attachment that contains the line segment, or NULL. When doing many checks, it is usually
+		/// more efficient to only call this method if {@link #aabbintersectsSegment(float, float, float, float)} returns true.
+		BoundingBoxAttachment* intersectsSegment(float x1, float y1, float x2, float y2);
+
+		/// Returns true if the polygon contains the line segment.
+		bool intersectsSegment(Polygon* polygon, float x1, float y1, float x2, float y2);
+
+		Polygon* getPolygon(BoundingBoxAttachment* attachment);
+
+		float getWidth();
+		float getHeight();
+
+	private:
+		Vector<Polygon*> _polygonPool;
+		Vector<BoundingBoxAttachment*> _boundingBoxes;
+		Vector<Polygon*> _polygons;
+		float _minX, _minY, _maxX, _maxY;
+
+		void aabbCompute();
+	};
+
+	class Polygon : public SpineObject {
+	public:
+		Vector<float> _vertices;
+		int _count;
+
+		Polygon() : _count(0) {
 			_vertices.ensureCapacity(16);
-        }
-    };
+		}
+	};
 }
 
 #endif /* Spine_SkeletonBounds_h */

+ 38 - 38
spine-cpp/spine-cpp/include/spine/SkeletonClipping.h

@@ -34,46 +34,46 @@
 #include <spine/Triangulator.h>
 
 namespace spine {
-    class Slot;
-    class ClippingAttachment;
-    
-    class SP_API SkeletonClipping : public SpineObject {
-    public:
-        SkeletonClipping();
+	class Slot;
+	class ClippingAttachment;
+
+	class SP_API SkeletonClipping : public SpineObject {
+	public:
+		SkeletonClipping();
+
+		size_t clipStart(Slot& slot, ClippingAttachment* clip);
+
+		void clipEnd(Slot& slot);
+
+		void clipEnd();
 
-        size_t clipStart(Slot& slot, ClippingAttachment* clip);
-        
-        void clipEnd(Slot& slot);
-        
-        void clipEnd();
-		
 		void clipTriangles(float* vertices, unsigned short* triangles, size_t trianglesLength, float* uvs, size_t stride);
-		
-        void clipTriangles(Vector<float>& vertices, Vector<unsigned short>& triangles, Vector<float>& uvs, size_t stride);
-        
-        bool isClipping();
-        
-        Vector<float>& getClippedVertices();
-        Vector<unsigned short>& getClippedTriangles();
-        Vector<float>& getClippedUVs();
-        
-    private:
-        Triangulator _triangulator;
-        Vector<float> _clippingPolygon;
-        Vector<float> _clipOutput;
-        Vector<float> _clippedVertices;
-        Vector<unsigned short> _clippedTriangles;
-        Vector<float> _clippedUVs;
-        Vector<float> _scratch;
-        ClippingAttachment* _clipAttachment;
-        Vector< Vector<float>* > *_clippingPolygons;
-        
-        /** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping
-                  * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */
-        bool clip(float x1, float y1, float x2, float y2, float x3, float y3, Vector<float>* clippingArea, Vector<float>* output);
-        
-        static void makeClockwise(Vector<float>& polygon);
-    };
+
+		void clipTriangles(Vector<float>& vertices, Vector<unsigned short>& triangles, Vector<float>& uvs, size_t stride);
+
+		bool isClipping();
+
+		Vector<float>& getClippedVertices();
+		Vector<unsigned short>& getClippedTriangles();
+		Vector<float>& getClippedUVs();
+
+	private:
+		Triangulator _triangulator;
+		Vector<float> _clippingPolygon;
+		Vector<float> _clipOutput;
+		Vector<float> _clippedVertices;
+		Vector<unsigned short> _clippedTriangles;
+		Vector<float> _clippedUVs;
+		Vector<float> _scratch;
+		ClippingAttachment* _clipAttachment;
+		Vector< Vector<float>* > *_clippingPolygons;
+
+		/** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping
+		  * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */
+		bool clip(float x1, float y1, float x2, float y2, float x3, float y3, Vector<float>* clippingArea, Vector<float>* output);
+
+		static void makeClockwise(Vector<float>& polygon);
+	};
 }
 
 #endif /* Spine_SkeletonClipping_h */

+ 0 - 1
spine-cpp/spine-cpp/include/spine/SkeletonData.h

@@ -112,7 +112,6 @@ public:
 
 	/// The skeleton's default skin.
 	/// By default this skin contains all attachments that were not in a skin in Spine.
-	///
 	/// @return May be NULL.
 	Skin *getDefaultSkin();
 

+ 12 - 12
spine-cpp/spine-cpp/include/spine/TextureLoader.h

@@ -34,18 +34,18 @@
 #include <spine/SpineString.h>
 
 namespace spine {
-    class AtlasPage;
-    
-    class SP_API TextureLoader : public SpineObject {
-    public:
-        TextureLoader();
-        
-        virtual ~TextureLoader();
-        
-        virtual void load(AtlasPage& page, const String& path) = 0;
-        
-        virtual void unload(void* texture) = 0;
-    };
+	class AtlasPage;
+
+	class SP_API TextureLoader : public SpineObject {
+	public:
+		TextureLoader();
+
+		virtual ~TextureLoader();
+
+		virtual void load(AtlasPage& page, const String& path) = 0;
+
+		virtual void unload(void* texture) = 0;
+	};
 }
 
 #endif /* Spine_TextureLoader_h */

+ 3 - 4
spine-cpp/spine-cpp/include/spine/Timeline.h

@@ -55,14 +55,13 @@ public:
 	/// @param time The time within the animation. Most timelines find the key before and the key after this time so they can interpolate between the keys.
 	/// @param pEvents If any events are fired, they are added to this array. Can be NULL to ignore firing events or if the timeline does not fire events. May be NULL.
 	/// @param alpha alpha 0 applies the current or setup pose value (depending on pose parameter). 1 applies the timeline
-	///     value. Between 0 and 1 applies a value between the current or setup pose and the timeline value. By adjusting
-	///     alpha over time, an animation can be mixed in or out. alpha can also be useful to
-	///      apply animations on top of each other (layered).
+	///	value. Between 0 and 1 applies a value between the current or setup pose and the timeline value. By adjusting alpha over
+	///	time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layered).
 	/// @param blend Controls how mixing is applied when alpha is than 1.
 	/// @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline.
 	virtual void
 	apply(Skeleton &skeleton, float lastTime, float time, Vector<Event *> *pEvents, float alpha, MixBlend blend,
-		  MixDirection direction) = 0;
+		MixDirection direction) = 0;
 
 	virtual int getPropertyId() = 0;
 };

+ 53 - 53
spine-cpp/spine-cpp/include/spine/TransformConstraint.h

@@ -35,63 +35,63 @@
 #include <spine/Vector.h>
 
 namespace spine {
-    class TransformConstraintData;
-    class Skeleton;
-    class Bone;
-    
-    class SP_API TransformConstraint : public Updatable {
-        friend class Skeleton;
-        friend class TransformConstraintTimeline;
-        
-        RTTI_DECL
-        
-    public:
-        TransformConstraint(TransformConstraintData& data, Skeleton& skeleton);
-        
-        void apply();
-        
-        virtual void update();
-        
-        virtual int getOrder();
-        
-        TransformConstraintData& getData();
-        
-        Vector<Bone*>& getBones();
-        
-        Bone* getTarget();
-        void setTarget(Bone* inValue);
-        
-        float getRotateMix();
-        void setRotateMix(float inValue);
-        
-        float getTranslateMix();
-        void setTranslateMix(float inValue);
-        
-        float getScaleMix();
-        void setScaleMix(float inValue);
-        
-        float getShearMix();
-        void setShearMix(float inValue);
+	class TransformConstraintData;
+	class Skeleton;
+	class Bone;
+
+	class SP_API TransformConstraint : public Updatable {
+		friend class Skeleton;
+		friend class TransformConstraintTimeline;
+
+		RTTI_DECL
+
+	public:
+		TransformConstraint(TransformConstraintData& data, Skeleton& skeleton);
+
+		void apply();
+
+		virtual void update();
+
+		virtual int getOrder();
+
+		TransformConstraintData& getData();
+
+		Vector<Bone*>& getBones();
+
+		Bone* getTarget();
+		void setTarget(Bone* inValue);
+
+		float getRotateMix();
+		void setRotateMix(float inValue);
+
+		float getTranslateMix();
+		void setTranslateMix(float inValue);
+
+		float getScaleMix();
+		void setScaleMix(float inValue);
+
+		float getShearMix();
+		void setShearMix(float inValue);
 
 		bool isActive();
 
 		void setActive(bool inValue);
-        
-    private:
-        TransformConstraintData& _data;
-        Vector<Bone*> _bones;
-        Bone* _target;
-        float _rotateMix, _translateMix, _scaleMix, _shearMix;
-        bool _active;
-        
-        void applyAbsoluteWorld();
-        
-        void applyRelativeWorld();
-        
-        void applyAbsoluteLocal();
-        
-        void applyRelativeLocal();
-    };
+
+	private:
+		TransformConstraintData& _data;
+		Vector<Bone*> _bones;
+		Bone* _target;
+		float _rotateMix, _translateMix, _scaleMix, _shearMix;
+		bool _active;
+
+		void applyAbsoluteWorld();
+
+		void applyRelativeWorld();
+
+		void applyAbsoluteLocal();
+
+		void applyRelativeLocal();
+	};
 }
 
 #endif /* Spine_TransformConstraint_h */

+ 36 - 36
spine-cpp/spine-cpp/include/spine/TransformConstraintData.h

@@ -36,43 +36,43 @@
 #include <spine/ConstraintData.h>
 
 namespace spine {
-    class BoneData;
-    
-    class SP_API TransformConstraintData : public ConstraintData {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        friend class TransformConstraint;
-        friend class Skeleton;
-        friend class TransformConstraintTimeline;
-        
-    public:
-        explicit TransformConstraintData(const String& name);
+	class BoneData;
 
-        Vector<BoneData*>& getBones();
-        BoneData* getTarget();
-        float getRotateMix();
-        float getTranslateMix();
-        float getScaleMix();
-        float getShearMix();
-        
-        float getOffsetRotation();
-        float getOffsetX();
-        float getOffsetY();
-        float getOffsetScaleX();
-        float getOffsetScaleY();
-        float getOffsetShearY();
-        
-        bool isRelative();
-        bool isLocal();
-        
-    private:
-        Vector<BoneData*> _bones;
-        BoneData* _target;
-        float _rotateMix, _translateMix, _scaleMix, _shearMix;
-        float _offsetRotation, _offsetX, _offsetY, _offsetScaleX, _offsetScaleY, _offsetShearY;
-        bool _relative, _local;
-    };
+	class SP_API TransformConstraintData : public ConstraintData {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+
+		friend class TransformConstraint;
+		friend class Skeleton;
+		friend class TransformConstraintTimeline;
+
+	public:
+		explicit TransformConstraintData(const String& name);
+
+		Vector<BoneData*>& getBones();
+		BoneData* getTarget();
+		float getRotateMix();
+		float getTranslateMix();
+		float getScaleMix();
+		float getShearMix();
+
+		float getOffsetRotation();
+		float getOffsetX();
+		float getOffsetY();
+		float getOffsetScaleX();
+		float getOffsetScaleY();
+		float getOffsetShearY();
+
+		bool isRelative();
+		bool isLocal();
+
+	private:
+		Vector<BoneData*> _bones;
+		BoneData* _target;
+		float _rotateMix, _translateMix, _scaleMix, _shearMix;
+		float _offsetRotation, _offsetX, _offsetY, _offsetScaleX, _offsetScaleY, _offsetShearY;
+		bool _relative, _local;
+	};
 }
 
 #endif /* Spine_TransformConstraintData_h */

+ 21 - 21
spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h

@@ -34,24 +34,24 @@
 
 namespace spine {
 
-    class SP_API TransformConstraintTimeline : public CurveTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        static const int ENTRIES;
+	class SP_API TransformConstraintTimeline : public CurveTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
 
-        explicit TransformConstraintTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-        void setFrame(size_t frameIndex, float time, float rotateMix, float translateMix, float scaleMix, float shearMix);
-        
-    private:
+		RTTI_DECL
+
+	public:
+		static const int ENTRIES;
+
+		explicit TransformConstraintTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+		void setFrame(size_t frameIndex, float time, float rotateMix, float translateMix, float scaleMix, float shearMix);
+
+	private:
 		static const int PREV_TIME;
 		static const int PREV_ROTATE;
 		static const int PREV_TRANSLATE;
@@ -61,10 +61,10 @@ namespace spine {
 		static const int TRANSLATE;
 		static const int SCALE;
 		static const int SHEAR;
-        
-        Vector<float> _frames;
-        int _transformConstraintIndex;
-    };
+
+		Vector<float> _frames;
+		int _transformConstraintIndex;
+	};
 }
 
 #endif /* Spine_TransformConstraintTimeline_h */

+ 7 - 7
spine-cpp/spine-cpp/include/spine/TransformMode.h

@@ -31,13 +31,13 @@
 #define Spine_TransformMode_h
 
 namespace spine {
-    enum TransformMode {
-        TransformMode_Normal = 0,
-        TransformMode_OnlyTranslation,
-        TransformMode_NoRotationOrReflection,
-        TransformMode_NoScale,
-        TransformMode_NoScaleOrReflection
-    };
+	enum TransformMode {
+		TransformMode_Normal = 0,
+		TransformMode_OnlyTranslation,
+		TransformMode_NoRotationOrReflection,
+		TransformMode_NoScale,
+		TransformMode_NoScaleOrReflection
+	};
 }
 
 #endif /* Spine_TransformMode_h */

+ 23 - 23
spine-cpp/spine-cpp/include/spine/TranslateTimeline.h

@@ -37,36 +37,36 @@
 
 namespace spine {
 
-    class SP_API TranslateTimeline : public CurveTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        static const int ENTRIES;
+	class SP_API TranslateTimeline : public CurveTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
 
-        explicit TranslateTimeline(int frameCount);
+		RTTI_DECL
 
-        virtual ~TranslateTimeline();
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-        /// Sets the time and value of the specified keyframe.
-        void setFrame(int frameIndex, float time, float x, float y);
-        
-    protected:
+	public:
+		static const int ENTRIES;
+
+		explicit TranslateTimeline(int frameCount);
+
+		virtual ~TranslateTimeline();
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+		/// Sets the time and value of the specified keyframe.
+		void setFrame(int frameIndex, float time, float x, float y);
+
+	protected:
 		static const int PREV_TIME;
 		static const int PREV_X;
 		static const int PREV_Y;
 		static const int X;
 		static const int Y;
-        
-        Vector<float> _frames;
-        int _boneIndex;
-    };
+
+		Vector<float> _frames;
+		int _boneIndex;
+	};
 }
 
 #endif /* Spine_TranslateTimeline_h */

+ 25 - 25
spine-cpp/spine-cpp/include/spine/TwoColorTimeline.h

@@ -34,28 +34,28 @@
 
 namespace spine {
 
-    class SP_API TwoColorTimeline : public CurveTimeline {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        
-        RTTI_DECL
-        
-    public:
-        static const int ENTRIES;
+	class SP_API TwoColorTimeline : public CurveTimeline {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
 
-        explicit TwoColorTimeline(int frameCount);
-        
-        virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
-        
-        virtual int getPropertyId();
-        
-        /// Sets the time and value of the specified keyframe.
-        void setFrame(int frameIndex, float time, float r, float g, float b, float a, float r2, float g2, float b2);
-        
-        int getSlotIndex();
-        void setSlotIndex(int inValue);
-        
-    private:
+		RTTI_DECL
+
+	public:
+		static const int ENTRIES;
+
+		explicit TwoColorTimeline(int frameCount);
+
+		virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
+
+		virtual int getPropertyId();
+
+		/// Sets the time and value of the specified keyframe.
+		void setFrame(int frameIndex, float time, float r, float g, float b, float a, float r2, float g2, float b2);
+
+		int getSlotIndex();
+		void setSlotIndex(int inValue);
+
+	private:
 		static const int PREV_TIME;
 		static const int PREV_R;
 		static const int PREV_G;
@@ -71,10 +71,10 @@ namespace spine {
 		static const int R2;
 		static const int G2;
 		static const int B2;
-        
-        Vector<float> _frames; // time, r, g, b, a, r2, g2, b2, ...
-        int _slotIndex;
-    };
+
+		Vector<float> _frames; // time, r, g, b, a, r2, g2, b2, ...
+		int _slotIndex;
+	};
 }
 
 #endif /* Spine_TwoColorTimeline_h */

+ 48 - 48
spine-cpp/spine-cpp/include/spine/VertexAttachment.h

@@ -35,59 +35,59 @@
 #include <spine/Vector.h>
 
 namespace spine {
-    class Slot;
-    
-    /// An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices.
-    class SP_API VertexAttachment : public Attachment {
-        friend class SkeletonBinary;
-        friend class SkeletonJson;
-        friend class DeformTimeline;
-        
-        RTTI_DECL
-        
-    public:
-        explicit VertexAttachment(const String& name);
-
-        virtual ~VertexAttachment();
-		
+	class Slot;
+
+	/// An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices.
+	class SP_API VertexAttachment : public Attachment {
+		friend class SkeletonBinary;
+		friend class SkeletonJson;
+		friend class DeformTimeline;
+
+		RTTI_DECL
+
+	public:
+		explicit VertexAttachment(const String& name);
+
+		virtual ~VertexAttachment();
+
 		void computeWorldVertices(Slot& slot, float* worldVertices);
-        void computeWorldVertices(Slot& slot, Vector<float>& worldVertices);
-        
-        /// Transforms local vertices to world coordinates.
-        /// @param start The index of the first Vertices value to transform. Each vertex has 2 values, x and y.
-        /// @param count The number of world vertex values to output. Must be less than or equal to WorldVerticesLength - start.
-        /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + count.
-        /// @param offset The worldVertices index to begin writing values.
-        /// @param stride The number of worldVertices entries between the value pairs written.
+		void computeWorldVertices(Slot& slot, Vector<float>& worldVertices);
+
+		/// Transforms local vertices to world coordinates.
+		/// @param start The index of the first Vertices value to transform. Each vertex has 2 values, x and y.
+		/// @param count The number of world vertex values to output. Must be less than or equal to WorldVerticesLength - start.
+		/// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + count.
+		/// @param offset The worldVertices index to begin writing values.
+		/// @param stride The number of worldVertices entries between the value pairs written.
 		void computeWorldVertices(Slot& slot, size_t start, size_t count, float* worldVertices, size_t offset, size_t stride = 2);
-        void computeWorldVertices(Slot& slot, size_t start, size_t count, Vector<float>& worldVertices, size_t offset, size_t stride = 2);
-        
-        /// Gets a unique ID for this attachment.
-        int getId();
-        
-        Vector<size_t>& getBones();
-        
-        Vector<float>& getVertices();
-        
-        size_t getWorldVerticesLength();
-        void setWorldVerticesLength(size_t inValue);
-
-        VertexAttachment* getDeformAttachment();
+		void computeWorldVertices(Slot& slot, size_t start, size_t count, Vector<float>& worldVertices, size_t offset, size_t stride = 2);
+
+		/// Gets a unique ID for this attachment.
+		int getId();
+
+		Vector<size_t>& getBones();
+
+		Vector<float>& getVertices();
+
+		size_t getWorldVerticesLength();
+		void setWorldVerticesLength(size_t inValue);
+
+		VertexAttachment* getDeformAttachment();
 		void setDeformAttachment(VertexAttachment* attachment);
 
 		void copyTo(VertexAttachment* other);
-        
-    protected:
-        Vector<size_t> _bones;
-        Vector<float> _vertices;
-        size_t _worldVerticesLength;
-        VertexAttachment* _deformAttachment;
-        
-    private:
-        const int _id;
-        
-        static int getNextID();
-    };
+
+	protected:
+		Vector<size_t> _bones;
+		Vector<float> _vertices;
+		size_t _worldVerticesLength;
+		VertexAttachment* _deformAttachment;
+
+	private:
+		const int _id;
+
+		static int getNextID();
+	};
 }
 
 #endif /* Spine_VertexAttachment_h */

+ 9 - 16
spine-cpp/spine-cpp/src/spine/Animation.cpp

@@ -52,7 +52,8 @@ Animation::~Animation() {
 }
 
 void Animation::apply(Skeleton &skeleton, float lastTime, float time, bool loop, Vector<Event *> *pEvents, float alpha,
-					  MixBlend blend, MixDirection direction) {
+	MixBlend blend, MixDirection direction
+) {
 	if (loop && _duration != 0) {
 		time = MathUtil::fmod(time, _duration);
 		if (lastTime > 0) {
@@ -91,15 +92,12 @@ int Animation::binarySearch(Vector<float> &values, float target, int step) {
 
 	int current = (int) (static_cast<uint32_t>(high) >> 1);
 	while (true) {
-		if (values[(current + 1) * step] <= target) {
+		if (values[(current + 1) * step] <= target)
 			low = current + 1;
-		} else {
+		else
 			high = current;
-		}
 
-		if (low == high) {
-			return (low + 1) * step;
-		}
+		if (low == high) return (low + 1) * step;
 
 		current = (int) (static_cast<uint32_t>(low + high) >> 1);
 	}
@@ -109,21 +107,16 @@ int Animation::binarySearch(Vector<float> &values, float target) {
 	int low = 0;
 	int size = (int)values.size();
 	int high = size - 2;
-	if (high == 0) {
-		return 1;
-	}
+	if (high == 0) return 1;
 
 	int current = (int) (static_cast<uint32_t>(high) >> 1);
 	while (true) {
-		if (values[(current + 1)] <= target) {
+		if (values[(current + 1)] <= target)
 			low = current + 1;
-		} else {
+		else
 			high = current;
-		}
 
-		if (low == high) {
-			return (low + 1);
-		}
+		if (low == high) return (low + 1);
 
 		current = (int) (static_cast<uint32_t>(low + high) >> 1);
 	}

+ 75 - 128
spine-cpp/spine-cpp/src/spine/AnimationState.cpp

@@ -54,11 +54,11 @@ void dummyOnAnimationEventFunc(AnimationState *state, spine::EventType type, Tra
 }
 
 TrackEntry::TrackEntry() : _animation(NULL), _next(NULL), _mixingFrom(NULL), _mixingTo(0), _trackIndex(0), _loop(false), _holdPrevious(false),
-						   _eventThreshold(0), _attachmentThreshold(0), _drawOrderThreshold(0), _animationStart(0),
-						   _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0),
-						   _trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0),
-						   _mixDuration(0), _interruptAlpha(0), _totalAlpha(0), _mixBlend(MixBlend_Replace),
-						   _listener(dummyOnAnimationEventFunc), _listenerObject(NULL) {
+	_eventThreshold(0), _attachmentThreshold(0), _drawOrderThreshold(0), _animationStart(0),
+	_animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0),
+	_trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0),
+	_mixDuration(0), _interruptAlpha(0), _totalAlpha(0), _mixBlend(MixBlend_Replace),
+	_listener(dummyOnAnimationEventFunc), _listenerObject(NULL) {
 }
 
 TrackEntry::~TrackEntry() { }
@@ -105,10 +105,7 @@ void TrackEntry::setAnimationLast(float inValue) {
 float TrackEntry::getAnimationTime() {
 	if (_loop) {
 		float duration = _animationEnd - _animationStart;
-		if (duration == 0) {
-			return _animationStart;
-		}
-
+		if (duration == 0) return _animationStart;
 		return MathUtil::fmod(_trackTime, duration) + _animationStart;
 	}
 
@@ -202,8 +199,8 @@ EventQueueEntry EventQueue::newEventQueueEntry(EventType eventType, TrackEntry *
 }
 
 EventQueue::EventQueue(AnimationState &state, Pool<TrackEntry> &trackEntryPool) : _state(state),
-																				  _trackEntryPool(trackEntryPool),
-																				  _drainDisabled(false) {
+	_trackEntryPool(trackEntryPool),
+	_drainDisabled(false) {
 }
 
 EventQueue::~EventQueue() {
@@ -251,36 +248,35 @@ void EventQueue::drain() {
 		TrackEntry *trackEntry = queueEntry->_entry;
 
 		switch (queueEntry->_type) {
-			case EventType_Start:
-			case EventType_Interrupt:
-			case EventType_Complete:
-				if (!trackEntry->_listenerObject) trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL);
-				else trackEntry->_listenerObject->callback(&state, queueEntry->_type, trackEntry, NULL);
-				if(!state._listenerObject) state._listener(&state, queueEntry->_type, trackEntry, NULL);
-				else state._listenerObject->callback(&state, queueEntry->_type, trackEntry, NULL);
-				break;
-			case EventType_End:
-				if (!trackEntry->_listenerObject) trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL);
-				else trackEntry->_listenerObject->callback(&state, queueEntry->_type, trackEntry, NULL);
-				if (!state._listenerObject) state._listener(&state, queueEntry->_type, trackEntry, NULL);
-				else state._listenerObject->callback(&state, queueEntry->_type, trackEntry, NULL);
-				/* Yes, we want to fall through here */
-			case EventType_Dispose:
-
-				if (!trackEntry->_listenerObject) trackEntry->_listener(&state, EventType_Dispose, trackEntry, NULL);
-				else trackEntry->_listenerObject->callback(&state, EventType_Dispose, trackEntry, NULL);
-				if (!state._listenerObject) state._listener(&state, EventType_Dispose, trackEntry, NULL);
-				else state._listenerObject->callback(&state, EventType_Dispose, trackEntry, NULL);
-
-				trackEntry->reset();
-				_trackEntryPool.free(trackEntry);
-				break;
-			case EventType_Event:
-				if (!trackEntry->_listenerObject) trackEntry->_listener(&state, queueEntry->_type, trackEntry, queueEntry->_event);
-				else trackEntry->_listenerObject->callback(&state, queueEntry->_type, trackEntry, queueEntry->_event);
-				if (!state._listenerObject) state._listener(&state, queueEntry->_type, trackEntry, queueEntry->_event);
-				else state._listenerObject->callback(&state, queueEntry->_type, trackEntry, queueEntry->_event);
-				break;
+		case EventType_Start:
+		case EventType_Interrupt:
+		case EventType_Complete:
+			if (!trackEntry->_listenerObject) trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL);
+			else trackEntry->_listenerObject->callback(&state, queueEntry->_type, trackEntry, NULL);
+			if(!state._listenerObject) state._listener(&state, queueEntry->_type, trackEntry, NULL);
+			else state._listenerObject->callback(&state, queueEntry->_type, trackEntry, NULL);
+			break;
+		case EventType_End:
+			if (!trackEntry->_listenerObject) trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL);
+			else trackEntry->_listenerObject->callback(&state, queueEntry->_type, trackEntry, NULL);
+			if (!state._listenerObject) state._listener(&state, queueEntry->_type, trackEntry, NULL);
+			else state._listenerObject->callback(&state, queueEntry->_type, trackEntry, NULL);
+			/* Fall through. */
+		case EventType_Dispose:
+			if (!trackEntry->_listenerObject) trackEntry->_listener(&state, EventType_Dispose, trackEntry, NULL);
+			else trackEntry->_listenerObject->callback(&state, EventType_Dispose, trackEntry, NULL);
+			if (!state._listenerObject) state._listener(&state, EventType_Dispose, trackEntry, NULL);
+			else state._listenerObject->callback(&state, EventType_Dispose, trackEntry, NULL);
+
+			trackEntry->reset();
+			_trackEntryPool.free(trackEntry);
+			break;
+		case EventType_Event:
+			if (!trackEntry->_listenerObject) trackEntry->_listener(&state, queueEntry->_type, trackEntry, queueEntry->_event);
+			else trackEntry->_listenerObject->callback(&state, queueEntry->_type, trackEntry, queueEntry->_event);
+			if (!state._listenerObject) state._listener(&state, queueEntry->_type, trackEntry, queueEntry->_event);
+			else state._listenerObject->callback(&state, queueEntry->_type, trackEntry, queueEntry->_event);
+			break;
 		}
 	}
 	_eventQueueEntries.clear();
@@ -420,17 +416,13 @@ bool AnimationState::apply(Skeleton &skeleton) {
 		size_t timelineCount = current._animation->_timelines.size();
 		Vector<Timeline *> &timelines = current._animation->_timelines;
 		if ((i == 0 && mix == 1) || blend == MixBlend_Add) {
-			for (size_t ii = 0; ii < timelineCount; ++ii) {
-				timelines[ii]->apply(skeleton, animationLast, animationTime, &_events, mix, blend,
-									 MixDirection_In);
-			}
+			for (size_t ii = 0; ii < timelineCount; ++ii)
+				timelines[ii]->apply(skeleton, animationLast, animationTime, &_events, mix, blend, MixDirection_In);
 		} else {
 			Vector<int> &timelineMode = current._timelineMode;
 
 			bool firstFrame = current._timelinesRotation.size() == 0;
-			if (firstFrame) {
-				current._timelinesRotation.setSize(timelines.size() << 1, 0);
-			}
+			if (firstFrame) current._timelinesRotation.setSize(timelines.size() << 1, 0);
 			Vector<float> &timelinesRotation = current._timelinesRotation;
 
 			for (size_t ii = 0; ii < timelineCount; ++ii) {
@@ -440,16 +432,12 @@ bool AnimationState::apply(Skeleton &skeleton) {
 				MixBlend timelineBlend = (timelineMode[ii] & (NotLast - 1)) == Subsequent ? blend : MixBlend_Setup;
 
 				RotateTimeline *rotateTimeline = NULL;
-				if (timeline->getRTTI().isExactly(RotateTimeline::rtti)) {
-					rotateTimeline = static_cast<RotateTimeline *>(timeline);
-				}
+				if (timeline->getRTTI().isExactly(RotateTimeline::rtti)) rotateTimeline = static_cast<RotateTimeline *>(timeline);
 
-				if (rotateTimeline != NULL) {
-					applyRotateTimeline(rotateTimeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1,
-										firstFrame);
-				} else {
+				if (rotateTimeline != NULL)
+					applyRotateTimeline(rotateTimeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);
+				else
 					timeline->apply(skeleton, animationLast, animationTime, &_events, mix, timelineBlend, MixDirection_In);
-				}
 			}
 		}
 
@@ -466,23 +454,18 @@ bool AnimationState::apply(Skeleton &skeleton) {
 void AnimationState::clearTracks() {
 	bool oldDrainDisabled = _queue->_drainDisabled;
 	_queue->_drainDisabled = true;
-	for (size_t i = 0, n = _tracks.size(); i < n; ++i) {
+	for (size_t i = 0, n = _tracks.size(); i < n; ++i)
 		clearTrack(i);
-	}
 	_tracks.clear();
 	_queue->_drainDisabled = oldDrainDisabled;
 	_queue->drain();
 }
 
 void AnimationState::clearTrack(size_t trackIndex) {
-	if (trackIndex >= _tracks.size()) {
-		return;
-	}
+	if (trackIndex >= _tracks.size()) return;
 
 	TrackEntry *current = _tracks[trackIndex];
-	if (current == NULL) {
-		return;
-	}
+	if (current == NULL) return;
 
 	_queue->end(current);
 
@@ -491,9 +474,7 @@ void AnimationState::clearTrack(size_t trackIndex) {
 	TrackEntry *entry = current;
 	while (true) {
 		TrackEntry *from = entry->_mixingFrom;
-		if (from == NULL) {
-			break;
-		}
+		if (from == NULL) break;
 
 		_queue->end(from);
 		entry->_mixingFrom = NULL;
@@ -509,7 +490,6 @@ void AnimationState::clearTrack(size_t trackIndex) {
 TrackEntry *AnimationState::setAnimation(size_t trackIndex, const String &animationName, bool loop) {
 	Animation *animation = _data->_skeletonData->findAnimation(animationName);
 	assert(animation != NULL);
-
 	return setAnimation(trackIndex, animation, loop);
 }
 
@@ -542,7 +522,6 @@ TrackEntry *AnimationState::setAnimation(size_t trackIndex, Animation *animation
 TrackEntry *AnimationState::addAnimation(size_t trackIndex, const String &animationName, bool loop, float delay) {
 	Animation *animation = _data->_skeletonData->findAnimation(animationName);
 	assert(animation != NULL);
-
 	return addAnimation(trackIndex, animation, loop, delay);
 }
 
@@ -551,9 +530,8 @@ TrackEntry *AnimationState::addAnimation(size_t trackIndex, Animation *animation
 
 	TrackEntry *last = expandToIndex(trackIndex);
 	if (last != NULL) {
-		while (last->_next != NULL) {
+		while (last->_next != NULL)
 			last = last->_next;
-		}
 	}
 
 	TrackEntry *entry = newTrackEntry(trackIndex, animation, loop, last);
@@ -657,10 +635,9 @@ Animation *AnimationState::getEmptyAnimation() {
 }
 
 void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleton &skeleton, float time, float alpha,
-										 MixBlend blend, Vector<float> &timelinesRotation, size_t i, bool firstFrame) {
-	if (firstFrame) {
-		timelinesRotation[i] = 0;
-	}
+	MixBlend blend, Vector<float> &timelinesRotation, size_t i, bool firstFrame
+) {
+	if (firstFrame) timelinesRotation[i] = 0;
 
 	if (alpha == 1) {
 		rotateTimeline->apply(skeleton, 0, time, NULL, 1, blend, MixDirection_In);
@@ -673,13 +650,13 @@ void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleto
 	float r1, r2;
 	if (time < frames[0]) {
 		switch (blend) {
-			case MixBlend_Setup:
-				bone->_rotation = bone->_data._rotation;
-			default:
-				return;
-			case MixBlend_First:
-				r1 = bone->_rotation;
-				r2 = bone->_data._rotation;
+		case MixBlend_Setup:
+			bone->_rotation = bone->_data._rotation;
+		default:
+			return;
+		case MixBlend_First:
+			r1 = bone->_rotation;
+			r2 = bone->_data._rotation;
 		}
 	} else {
 		r1 = blend == MixBlend_Setup ? bone->_data._rotation : bone->_rotation;
@@ -692,9 +669,7 @@ void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleto
 			float prevRotation = frames[frame + RotateTimeline::PREV_ROTATION];
 			float frameTime = frames[frame];
 			float percent = rotateTimeline->getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame +
-																											   RotateTimeline::PREV_TIME] -
-																										frameTime));
-
+				RotateTimeline::PREV_TIME] - frameTime));
 			r2 = frames[frame + RotateTimeline::ROTATION] - prevRotation;
 			r2 -= (16384 - (int) (16384.499999999996 - r2 / 360)) * 360;
 			r2 = prevRotation + r2 * percent + bone->_data._rotation;
@@ -721,9 +696,7 @@ void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleto
 		// Detect cross at 0 (not 180).
 		if (MathUtil::sign(lastDiff) != MathUtil::sign(diff) && MathUtil::abs(lastDiff) <= 90) {
 			// A cross after a 360 rotation is a loop.
-			if (MathUtil::abs(lastTotal) > 180) {
-				lastTotal += 360 * MathUtil::sign(lastTotal);
-			}
+			if (MathUtil::abs(lastTotal) > 180) lastTotal += 360 * MathUtil::sign(lastTotal);
 			dir = current;
 		}
 
@@ -769,9 +742,7 @@ bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) {
 
 float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBlend blend) {
 	TrackEntry *from = to->_mixingFrom;
-	if (from->_mixingFrom != NULL) {
-		applyMixingFrom(from, skeleton, blend);
-	}
+	if (from->_mixingFrom != NULL) applyMixingFrom(from, skeleton, blend);
 
 	float mix;
 	if (to->_mixDuration == 0) {
@@ -801,9 +772,7 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle
 		Vector<TrackEntry *> &timelineHoldMix = from->_timelineHoldMix;
 
 		bool firstFrame = from->_timelinesRotation.size() == 0;
-		if (firstFrame) {
-			from->_timelinesRotation.setSize(timelines.size() << 1, 0);
-		}
+		if (firstFrame) from->_timelinesRotation.setSize(timelines.size() << 1, 0);
 
 		Vector<float> &timelinesRotation = from->_timelinesRotation;
 
@@ -839,8 +808,7 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle
 			}
 			from->_totalAlpha += alpha;
 			if ((timeline->getRTTI().isExactly(RotateTimeline::rtti))) {
-				applyRotateTimeline((RotateTimeline*)timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1,
-									firstFrame);
+				applyRotateTimeline((RotateTimeline*)timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);
 			} else {
 				if (timelineBlend == MixBlend_Setup) {
 					if (timeline->getRTTI().isExactly(AttachmentTimeline::rtti)) {
@@ -849,8 +817,7 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle
 						if (drawOrder) direction = MixDirection_In;
 					}
 				}
-				timeline->apply(skeleton, animationLast, animationTime, eventBuffer, alpha, timelineBlend,
-								direction);
+				timeline->apply(skeleton, animationLast, animationTime, eventBuffer, alpha, timelineBlend, direction);
 			}
 		}
 	}
@@ -875,13 +842,8 @@ void AnimationState::queueEvents(TrackEntry *entry, float animationTime) {
 	size_t i = 0, n = _events.size();
 	for (; i < n; ++i) {
 		Event *e = _events[i];
-		if (e->_time < trackLastWrapped) {
-			break;
-		}
-		if (e->_time > animationEnd) {
-			// Discard events outside animation start/end.
-			continue;
-		}
+		if (e->_time < trackLastWrapped) break;
+		if (e->_time > animationEnd) continue; // Discard events outside animation start/end.
 		_queue->event(entry, e);
 	}
 
@@ -896,10 +858,7 @@ void AnimationState::queueEvents(TrackEntry *entry, float animationTime) {
 	// Queue events after complete.
 	for (; i < n; ++i) {
 		Event *e = _events[i];
-		if (e->_time < animationStart) {
-			// Discard events outside animation start/end.
-			continue;
-		}
+		if (e->_time < animationStart) continue; // Discard events outside animation start/end.
 		_queue->event(entry, _events[i]);
 	}
 }
@@ -909,9 +868,7 @@ void AnimationState::setCurrent(size_t index, TrackEntry *current, bool interrup
 	_tracks[index] = current;
 
 	if (from != NULL) {
-		if (interrupt) {
-			_queue->interrupt(from);
-		}
+		if (interrupt) _queue->interrupt(from);
 
 		current->_mixingFrom = from;
 		from->_mixingTo = current;
@@ -929,14 +886,9 @@ void AnimationState::setCurrent(size_t index, TrackEntry *current, bool interrup
 }
 
 TrackEntry *AnimationState::expandToIndex(size_t index) {
-	if (index < _tracks.size()) {
-		return _tracks[index];
-	}
-
-	while (index >= _tracks.size()) {
+	if (index < _tracks.size()) return _tracks[index];
+	while (index >= _tracks.size())
 		_tracks.add(NULL);
-	}
-
 	return NULL;
 }
 
@@ -989,7 +941,6 @@ void AnimationState::animationsChanged() {
 
 	for (size_t i = 0, n = _tracks.size(); i < n; ++i) {
 		TrackEntry *entry = _tracks[i];
-
 		if (!entry) continue;
 
 		while (entry->_mixingFrom != NULL)
@@ -1069,21 +1020,17 @@ void AnimationState::computeNotLast(TrackEntry *entry) {
 	for (size_t i = 0; i < timelinesCount; i++) {
 		if (timelines[i]->getRTTI().isExactly(AttachmentTimeline::rtti)) {
 			AttachmentTimeline *timeline = static_cast<AttachmentTimeline *>(timelines[i]);
-			if (!_propertyIDs.contains(timeline->getSlotIndex())) {
+			if (!_propertyIDs.contains(timeline->getSlotIndex()))
 				_propertyIDs.add(timeline->getSlotIndex());
-			} else {
+			else
 				timelineMode[i] |= NotLast;
-			}
 		}
 	}
 }
 
 bool AnimationState::hasTimeline(TrackEntry* entry, int inId) {
 	Vector<Timeline *> &timelines = entry->_animation->_timelines;
-	for (size_t i = 0, n = timelines.size(); i < n; ++i) {
-		if (timelines[i]->getPropertyId() == inId) {
-			return true;
-		}
-	}
+	for (size_t i = 0, n = timelines.size(); i < n; ++i)
+		if (timelines[i]->getPropertyId() == inId) return true;
 	return false;
 }

+ 24 - 64
spine-cpp/spine-cpp/src/spine/Atlas.cpp

@@ -89,12 +89,8 @@ void Atlas::flipV() {
 }
 
 AtlasRegion *Atlas::findRegion(const String &name) {
-	for (size_t i = 0, n = _regions.size(); i < n; ++i) {
-		if (_regions[i]->name == name) {
-			return _regions[i];
-		}
-	}
-
+	for (size_t i = 0, n = _regions.size(); i < n; ++i)
+		if (_regions[i]->name == name) return _regions[i];
 	return NULL;
 }
 
@@ -103,11 +99,9 @@ Vector<AtlasPage*> &Atlas::getPages() {
 }
 
 void Atlas::load(const char *begin, int length, const char *dir, bool createTexture) {
-	static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888",
-										"RGBA8888"};
-	static const char *textureFilterNames[] = {"", "Nearest", "Linear", "MipMap", "MipMapNearestNearest",
-											   "MipMapLinearNearest",
-											   "MipMapNearestLinear", "MipMapLinearLinear"};
+	static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888", "RGBA8888"};
+	static const char *textureFilterNames[] = {"", "Nearest", "Linear", "MipMap", "MipMapNearestNearest", "MipMapLinearNearest",
+		"MipMapNearestLinear", "MipMapLinearLinear"};
 
 	int count;
 	const char *end = begin + length;
@@ -125,9 +119,7 @@ void Atlas::load(const char *begin, int length, const char *dir, bool createText
 			char *name = mallocString(&str);
 			char *path = SpineExtension::calloc<char>(dirLength + needsSlash + strlen(name) + 1, __FILE__, __LINE__);
 			memcpy(path, dir, dirLength);
-			if (needsSlash) {
-				path[dirLength] = '/';
-			}
+			if (needsSlash) path[dirLength] = '/';
 			strcpy(path + dirLength + needsSlash, name);
 
 			page = new(__FILE__, __LINE__) AtlasPage(String(name, true));
@@ -163,15 +155,11 @@ void Atlas::load(const char *begin, int length, const char *dir, bool createText
 				}
 			}
 
-			if (createTexture)
-			{
+			if (createTexture) {
 				if (_textureLoader) _textureLoader->load(*page, String(path));
 				SpineExtension::free(path, __FILE__, __LINE__);
-			}
-			else
-			{
+			} else
 				page->texturePath = String(path, true);
-			}
 
 			_pages.add(page);
 		} else {
@@ -181,13 +169,9 @@ void Atlas::load(const char *begin, int length, const char *dir, bool createText
 			region->name = String(mallocString(&str), true);
 
 			readValue(&begin, end, &str);
-			if (equals(&str, "true")) {
-				region->degrees = 90;
-			} else if (equals(&str, "false")) {
-				region->degrees = 0;
-			} else {
-				region->degrees = toInt(&str);
-			}
+			if (equals(&str, "true")) region->degrees = 90;
+			else if (equals(&str, "false")) region->degrees = 0;
+			else region->degrees = toInt(&str);
 			region->rotate = region->degrees == 90;
 
 			readTuple(&begin, end, tuple);
@@ -251,41 +235,32 @@ void Atlas::load(const char *begin, int length, const char *dir, bool createText
 }
 
 void Atlas::trim(Str *str) {
-	while (isspace((unsigned char) *str->begin) && str->begin < str->end) {
+	while (isspace((unsigned char) *str->begin) && str->begin < str->end)
 		(str->begin)++;
-	}
 
-	if (str->begin == str->end) {
-		return;
-	}
+	if (str->begin == str->end) return;
 
 	str->end--;
 
-	while (((unsigned char)*str->end == '\r') && str->end >= str->begin) {
+	while (((unsigned char)*str->end == '\r') && str->end >= str->begin)
 		str->end--;
-	}
 
 	str->end++;
 }
 
 int Atlas::readLine(const char **begin, const char *end, Str *str) {
-	if (*begin == end) {
-		return 0;
-	}
+	if (*begin == end) return 0;
 
 	str->begin = *begin;
 
 	/* Find next delimiter. */
-	while (*begin != end && **begin != '\n') {
+	while (*begin != end && **begin != '\n')
 		(*begin)++;
-	}
 
 	str->end = *begin;
 	trim(str);
 
-	if (*begin != end) {
-		(*begin)++;
-	}
+	if (*begin != end) (*begin)++;
 
 	return 1;
 }
@@ -294,13 +269,9 @@ int Atlas::beginPast(Str *str, char c) {
 	const char *begin = str->begin;
 	while (true) {
 		char lastSkippedChar = *begin;
-		if (begin == str->end) {
-			return 0;
-		}
+		if (begin == str->end) return 0;
 		begin++;
-		if (lastSkippedChar == c) {
-			break;
-		}
+		if (lastSkippedChar == c) break;
 	}
 	str->begin = begin;
 	return 1;
@@ -308,10 +279,7 @@ int Atlas::beginPast(Str *str, char c) {
 
 int Atlas::readValue(const char **begin, const char *end, Str *str) {
 	readLine(begin, end, str);
-	if (!beginPast(str, ':')) {
-		return 0;
-	}
-
+	if (!beginPast(str, ':')) return 0;
 	trim(str);
 	return 1;
 }
@@ -320,16 +288,11 @@ int Atlas::readTuple(const char **begin, const char *end, Str tuple[]) {
 	int i;
 	Str str = {NULL, NULL};
 	readLine(begin, end, &str);
-	if (!beginPast(&str, ':')) {
-		return 0;
-	}
+	if (!beginPast(&str, ':')) return 0;
 
 	for (i = 0; i < 3; ++i) {
 		tuple[i].begin = str.begin;
-		if (!beginPast(&str, ',')) {
-			break;
-		}
-
+		if (!beginPast(&str, ',')) break;
 		tuple[i].end = str.begin - 2;
 		trim(&tuple[i]);
 	}
@@ -352,11 +315,8 @@ char *Atlas::mallocString(Str *str) {
 int Atlas::indexOf(const char **array, int count, Str *str) {
 	int length = (int) (str->end - str->begin);
 	int i;
-	for (i = count - 1; i >= 0; i--) {
-		if (strncmp(array[i], str->begin, length) == 0) {
-			return i;
-		}
-	}
+	for (i = count - 1; i >= 0; i--)
+		if (strncmp(array[i], str->begin, length) == 0) return i;
 	return 0;
 }
 

+ 1 - 1
spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp

@@ -100,7 +100,7 @@ MeshAttachment *AtlasAttachmentLoader::newMeshAttachment(Skin &skin, const Strin
 
 BoundingBoxAttachment *AtlasAttachmentLoader::newBoundingBoxAttachment(Skin &skin, const String &name) {
 	SP_UNUSED(skin);
-	return new(__FILE__, __LINE__)  BoundingBoxAttachment(name);
+	return new(__FILE__, __LINE__) BoundingBoxAttachment(name);
 }
 
 PathAttachment *AtlasAttachmentLoader::newPathAttachment(Skin &skin, const String &name) {

Некоторые файлы не были показаны из-за большого количества измененных файлов