Browse Source

Merge remote-tracking branch 'upstream/master'

Conflicts:
	spine-c/include/spine/SkeletonData.h
pinguin999 10 năm trước cách đây
mục cha
commit
a9f404a7e3
100 tập tin đã thay đổi với 1129 bổ sung1111 xóa
  1. 8 2
      .gitignore
  2. 4 0
      spine-as3/README.md
  3. 3 4
      spine-as3/spine-as3-example/.actionScriptProperties
  4. 1 1
      spine-as3/spine-as3-example/src/goblins-mesh.atlas
  5. 0 0
      spine-as3/spine-as3-example/src/goblins-mesh.json
  6. 0 0
      spine-as3/spine-as3-example/src/goblins-mesh.png
  7. 4 7
      spine-as3/spine-as3-example/src/spine/Main.as
  8. 72 24
      spine-as3/spine-as3/src/spine/Bone.as
  9. 8 7
      spine-as3/spine-as3/src/spine/BoneData.as
  10. 1 2
      spine-as3/spine-as3/src/spine/Event.as
  11. 1 2
      spine-as3/spine-as3/src/spine/EventData.as
  12. 149 0
      spine-as3/spine-as3/src/spine/IkConstraint.as
  13. 54 0
      spine-as3/spine-as3/src/spine/IkConstraintData.as
  14. 116 70
      spine-as3/spine-as3/src/spine/Skeleton.as
  15. 1 1
      spine-as3/spine-as3/src/spine/SkeletonBounds.as
  16. 29 63
      spine-as3/spine-as3/src/spine/SkeletonData.as
  17. 87 34
      spine-as3/spine-as3/src/spine/SkeletonJson.as
  18. 3 5
      spine-as3/spine-as3/src/spine/Skin.as
  19. 13 19
      spine-as3/spine-as3/src/spine/Slot.as
  20. 2 4
      spine-as3/spine-as3/src/spine/SlotData.as
  21. 23 8
      spine-as3/spine-as3/src/spine/animation/Animation.as
  22. 5 10
      spine-as3/spine-as3/src/spine/animation/AnimationStateData.as
  23. 47 49
      spine-as3/spine-as3/src/spine/animation/CurveTimeline.as
  24. 1 1
      spine-as3/spine-as3/src/spine/animation/DrawOrderTimeline.as
  25. 1 1
      spine-as3/spine-as3/src/spine/animation/EventTimeline.as
  26. 3 6
      spine-as3/spine-as3/src/spine/animation/FfdTimeline.as
  27. 73 0
      spine-as3/spine-as3/src/spine/animation/FlipXTimeline.as
  28. 44 0
      spine-as3/spine-as3/src/spine/animation/FlipYTimeline.as
  29. 82 0
      spine-as3/spine-as3/src/spine/animation/IkConstraintTimeline.as
  30. 4 1
      spine-as3/spine-as3/src/spine/flash/SkeletonSprite.as
  31. 50 0
      spine-c/Makefile
  32. 0 4
      spine-c/README.md
  33. 36 10
      spine-c/include/spine/Animation.h
  34. 1 1
      spine-c/include/spine/AnimationStateData.h
  35. 1 1
      spine-c/include/spine/AtlasAttachmentLoader.h
  36. 2 5
      spine-c/include/spine/Attachment.h
  37. 2 3
      spine-c/include/spine/AttachmentLoader.h
  38. 2 0
      spine-c/include/spine/Bone.h
  39. 1 0
      spine-c/include/spine/BoneData.h
  40. 2 3
      spine-c/include/spine/BoundingBoxAttachment.h
  41. 2 3
      spine-c/include/spine/Event.h
  42. 2 3
      spine-c/include/spine/EventData.h
  43. 2 3
      spine-c/include/spine/IkConstraint.h
  44. 2 3
      spine-c/include/spine/IkConstraintData.h
  45. 2 3
      spine-c/include/spine/MeshAttachment.h
  46. 2 3
      spine-c/include/spine/RegionAttachment.h
  47. 5 5
      spine-c/include/spine/Skeleton.h
  48. 2 2
      spine-c/include/spine/SkeletonBounds.h
  49. 1 1
      spine-c/include/spine/SkeletonData.h
  50. 1 1
      spine-c/include/spine/SkeletonJson.h
  51. 1 1
      spine-c/include/spine/Skin.h
  52. 2 3
      spine-c/include/spine/SkinnedMeshAttachment.h
  53. 1 1
      spine-c/include/spine/SlotData.h
  54. 1 1
      spine-c/include/spine/extension.h
  55. 53 8
      spine-c/src/spine/Animation.c
  56. 5 5
      spine-c/src/spine/Atlas.c
  57. 10 3
      spine-c/src/spine/Bone.c
  58. 3 0
      spine-c/src/spine/SkeletonData.c
  59. 25 7
      spine-c/src/spine/SkeletonJson.c
  60. 1 1
      spine-c/src/spine/extension.c
  61. 1 1
      spine-cocos2d-iphone/2/Resources/goblins-mesh.atlas
  62. 0 0
      spine-cocos2d-iphone/2/Resources/goblins-mesh.json
  63. 0 0
      spine-cocos2d-iphone/2/Resources/goblins-mesh.png
  64. 1 1
      spine-cocos2d-iphone/2/example/GoblinsExample.m
  65. 66 19
      spine-cocos2d-iphone/2/spine-cocos2d-iphone-ios.xcodeproj/project.pbxproj
  66. 0 676
      spine-cocos2d-iphone/3.0/spine-cocos2d-iphone-osx.xcodeproj/project.pbxproj
  67. 0 7
      spine-cocos2d-iphone/3.0/spine-cocos2d-iphone-osx.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  68. 0 0
      spine-cocos2d-iphone/3/README.md
  69. 0 0
      spine-cocos2d-iphone/3/Resources-ios/AppDelegate.h
  70. 0 0
      spine-cocos2d-iphone/3/Resources-ios/AppDelegate.m
  71. 0 0
      spine-cocos2d-iphone/3/Resources-ios/[email protected]
  72. 0 0
      spine-cocos2d-iphone/3/Resources-ios/Default-Landscape~ipad.png
  73. 0 0
      spine-cocos2d-iphone/3/Resources-ios/Default.png
  74. 0 0
      spine-cocos2d-iphone/3/Resources-ios/[email protected]
  75. 0 0
      spine-cocos2d-iphone/3/Resources-ios/Icon-72.png
  76. 0 0
      spine-cocos2d-iphone/3/Resources-ios/Icon-Small-50.png
  77. 0 0
      spine-cocos2d-iphone/3/Resources-ios/Icon-Small.png
  78. 0 0
      spine-cocos2d-iphone/3/Resources-ios/[email protected]
  79. 0 0
      spine-cocos2d-iphone/3/Resources-ios/Icon.png
  80. 0 0
      spine-cocos2d-iphone/3/Resources-ios/[email protected]
  81. 0 0
      spine-cocos2d-iphone/3/Resources-ios/Info.plist
  82. 0 0
      spine-cocos2d-iphone/3/Resources-ios/Prefix.pch
  83. 0 0
      spine-cocos2d-iphone/3/Resources-ios/iTunesArtwork
  84. 0 0
      spine-cocos2d-iphone/3/Resources-ios/main.m
  85. 0 0
      spine-cocos2d-iphone/3/Resources-mac/AppDelegate.h
  86. 0 0
      spine-cocos2d-iphone/3/Resources-mac/AppDelegate.m
  87. 0 0
      spine-cocos2d-iphone/3/Resources-mac/English.lproj/InfoPlist.strings
  88. 0 0
      spine-cocos2d-iphone/3/Resources-mac/English.lproj/MainMenu.xib
  89. 0 0
      spine-cocos2d-iphone/3/Resources-mac/Info.plist
  90. 0 0
      spine-cocos2d-iphone/3/Resources-mac/Prefix.pch
  91. 0 0
      spine-cocos2d-iphone/3/Resources-mac/icon.icns
  92. 0 0
      spine-cocos2d-iphone/3/Resources-mac/main.m
  93. 1 1
      spine-cocos2d-iphone/3/Resources/goblins-mesh.atlas
  94. 0 0
      spine-cocos2d-iphone/3/Resources/goblins-mesh.json
  95. 0 0
      spine-cocos2d-iphone/3/Resources/goblins-mesh.png
  96. 0 0
      spine-cocos2d-iphone/3/Resources/spineboy.atlas
  97. 0 0
      spine-cocos2d-iphone/3/Resources/spineboy.json
  98. 0 0
      spine-cocos2d-iphone/3/Resources/spineboy.png
  99. 0 0
      spine-cocos2d-iphone/3/example/GoblinsExample.h
  100. 1 1
      spine-cocos2d-iphone/3/example/GoblinsExample.m

+ 8 - 2
.gitignore

@@ -19,8 +19,9 @@ spine-cpp/Debug/*
 spine-sfml/Debug/*
 spine-sfml/SFML
 
-spine-libgdx/bin/*
-spine-libgdx/libs/*
+spine-libgdx/spine-libgdx/bin/*
+spine-libgdx/spine-libgdx-tests/bin/*
+spine-libgdx/spine-skeletonviewer/bin/*
 
 spine-cocos2dx/2/cocos2dx/
 !spine-cocos2dx/2/cocos2dx/Place cocos2dx here.txt
@@ -32,6 +33,8 @@ xcuserdata
 
 spine-cocos2d-iphone/2/cocos2d/*
 !spine-cocos2d-iphone/2/cocos2d/Place cocos2d here.txt
+spine-cocos2d-iphone/3/cocos2d/*
+!spine-cocos2d-iphone/3/cocos2d/Place cocos2d here.txt
 
 spine-csharp/bin
 spine-csharp/obj
@@ -83,6 +86,9 @@ spine-love/love/
 spine-as3/spine-as3/bin
 spine-as3/spine-as3-example/bin-debug
 spine-as3/spine-as3-example/bin-release
+
 spine-starling/spine-starling/bin
 spine-starling/spine-starling-example/bin-debug
 spine-starling/spine-starling-example/bin-release
+
+spine-turbulenz/spine-js/spine.js

+ 4 - 0
spine-as3/README.md

@@ -13,3 +13,7 @@ Alternatively, the contents of the `spine-as3/src` directory can be copied into
 
 * [Flash Demo](http://esotericsoftware.com/spine/files/demos/as3/spineboy/index.html)
 *  [Flash Demo source](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-as3/spine-as3-example/src/Main.as#L55)
+
+## Notes
+
+- Atlas images should not use premultiplied alpha.

+ 3 - 4
spine-as3/spine-as3-example/.actionScriptProperties

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<actionScriptProperties analytics="false" mainApplicationPath="Main.as" projectUUID="98e371df-ee9f-4aef-8e4b-fdb975214a26" version="11">
-  <compiler additionalCompilerArguments="-locale en_US" advancedTelemetry="false" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" useFlashSDK="true" verifyDigests="true" warn="true">
+<actionScriptProperties analytics="false" mainApplicationPath="spine/Main.as" projectUUID="98e371df-ee9f-4aef-8e4b-fdb975214a26" version="10">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
     <compilerSourcePath/>
     <libraryPath defaultLinkType="0">
       <libraryPathEntry kind="4" path="">
@@ -33,10 +33,9 @@
     <sourceAttachmentPath/>
   </compiler>
   <applications>
-    <application path="Main.as"/>
+    <application path="spine/Main.as"/>
   </applications>
   <modules/>
-  <workers/>
   <buildCSSFiles/>
   <flashCatalyst validateFlashCatalystCompatibility="false"/>
 </actionScriptProperties>

+ 1 - 1
spine-cocos2dx/2/example/Resources/ipad-retina/goblins-ffd.atlas → spine-as3/spine-as3-example/src/goblins-mesh.atlas

@@ -1,5 +1,5 @@
 
-goblins-ffd.png
+goblins-mesh.png
 format: RGBA8888
 filter: Linear,Linear
 repeat: none

+ 0 - 0
spine-as3/spine-as3-example/src/goblins-ffd.json → spine-as3/spine-as3-example/src/goblins-mesh.json


+ 0 - 0
spine-as3/spine-as3-example/src/goblins-ffd.png → spine-as3/spine-as3-example/src/goblins-mesh.png


+ 4 - 7
spine-as3/spine-as3-example/src/Main.as → spine-as3/spine-as3-example/src/spine/Main.as

@@ -28,20 +28,17 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *****************************************************************************/
 
-package {
+package spine {
 
 import flash.display.Sprite;
 
-import spine.Event;
-import spine.SkeletonData;
-import spine.SkeletonJson;
 import spine.animation.AnimationStateData;
 import spine.atlas.Atlas;
 import spine.attachments.AtlasAttachmentLoader;
 import spine.flash.FlashTextureLoader;
 import spine.flash.SkeletonAnimation;
 
-[SWF(width = "640", height = "480", frameRate = "60", backgroundColor = "#dddddd")]
+[SWF(width = "800", height = "600", frameRate = "60", backgroundColor = "#dddddd")]
 public class Main extends Sprite {
 	[Embed(source = "spineboy.atlas", mimeType = "application/octet-stream")]
 	static public const SpineboyAtlas:Class;
@@ -66,8 +63,8 @@ public class Main extends Sprite {
 		stateData.setMixByName("jump", "jump", 0.2);
 
 		skeleton = new SkeletonAnimation(skeletonData, stateData);
-		skeleton.x = 320;
-		skeleton.y = 420;
+		skeleton.x = 400;
+		skeleton.y = 560;
 		
 		skeleton.state.onStart.add(function (trackIndex:int) : void {
 			trace(trackIndex + " start: " + skeleton.state.getCurrent(trackIndex));

+ 72 - 24
spine-as3/spine-as3/src/spine/Bone.as

@@ -34,12 +34,16 @@ public class Bone {
 	static public var yDown:Boolean;
 
 	internal var _data:BoneData;
+	internal var _skeleton:Skeleton;
 	internal var _parent:Bone;
 	public var x:Number;
 	public var y:Number;
 	public var rotation:Number;
+	public var rotationIK:Number;
 	public var scaleX:Number
 	public var scaleY:Number;
+	public var flipX:Boolean;
+	public var flipY:Boolean;
 
 	internal var _m00:Number;
 	internal var _m01:Number;
@@ -50,50 +54,61 @@ public class Bone {
 	internal var _worldRotation:Number;
 	internal var _worldScaleX:Number;
 	internal var _worldScaleY:Number;
+	internal var _worldFlipX:Boolean;
+	internal var _worldFlipY:Boolean;
 
 	/** @param parent May be null. */
-	public function Bone (data:BoneData, parent:Bone) {
-		if (data == null)
-			throw new ArgumentError("data cannot be null.");
+	public function Bone (data:BoneData, skeleton:Skeleton, parent:Bone) {
+		if (data == null) throw new ArgumentError("data cannot be null.");
+		if (skeleton == null) throw new ArgumentError("skeleton cannot be null.");
 		_data = data;
+		_skeleton = skeleton;
 		_parent = parent;
 		setToSetupPose();
 	}
 
 	/** Computes the world SRT using the parent bone and the local SRT. */
-	public function updateWorldTransform (flipX:Boolean, flipY:Boolean) : void {
-		if (_parent != null) {
-			_worldX = x * _parent._m00 + y * _parent._m01 + _parent._worldX;
-			_worldY = x * _parent._m10 + y * _parent._m11 + _parent._worldY;
+	public function updateWorldTransform () : void {
+		var parent:Bone = _parent;
+		if (parent) {
+			_worldX = x * parent._m00 + y * parent._m01 + parent._worldX;
+			_worldY = x * parent._m10 + y * parent._m11 + parent._worldY;
 			if (_data.inheritScale) {
-				_worldScaleX = _parent._worldScaleX * scaleX;
-				_worldScaleY = _parent._worldScaleY * scaleY;
+				_worldScaleX = parent._worldScaleX * scaleX;
+				_worldScaleY = parent._worldScaleY * scaleY;
 			} else {
 				_worldScaleX = scaleX;
 				_worldScaleY = scaleY;
 			}
-			_worldRotation = _data.inheritRotation ? _parent._worldRotation + rotation : rotation;
+			_worldRotation = _data.inheritRotation ? parent._worldRotation + rotationIK : rotationIK;
+			_worldFlipX = parent._worldFlipX != flipX;
+			_worldFlipY = parent._worldFlipY != flipY;
 		} else {
-			_worldX = flipX ? -x : x;
-			_worldY = flipY != yDown ? -y : y;
+			var skeletonFlipX:Boolean = _skeleton.flipX, skeletonFlipY:Boolean = _skeleton.flipY;
+			_worldX = skeletonFlipX ? -x : x;
+			_worldY = skeletonFlipY != yDown ? -y : y;
 			_worldScaleX = scaleX;
 			_worldScaleY = scaleY;
-			_worldRotation = rotation;
+			_worldRotation = rotationIK;
+			_worldFlipX = skeletonFlipX != flipX;
+			_worldFlipY = skeletonFlipY != flipY;
 		}
 		var radians:Number = _worldRotation * (Math.PI / 180);
 		var cos:Number = Math.cos(radians);
 		var sin:Number = Math.sin(radians);
-		_m00 = cos * _worldScaleX;
-		_m10 = sin * _worldScaleX;
-		_m01 = -sin * _worldScaleY;
-		_m11 = cos * _worldScaleY;
-		if (flipX) {
-			_m00 = -_m00;
-			_m01 = -_m01;
+		if (_worldFlipX) {
+			_m00 = -cos * _worldScaleX;
+			_m01 = sin * _worldScaleY;
+		} else {
+			_m00 = cos * _worldScaleX;
+			_m01 = -sin * _worldScaleY;
 		}
-		if (flipY != yDown) {
-			_m10 = -_m10;
-			_m11 = -_m11;
+		if (_worldFlipY != yDown) {
+			_m10 = -sin * _worldScaleX;
+			_m11 = -cos * _worldScaleY;
+		} else {
+			_m10 = sin * _worldScaleX;
+			_m11 = cos * _worldScaleY;
 		}
 	}
 
@@ -101,17 +116,24 @@ public class Bone {
 		x = _data.x;
 		y = _data.y;
 		rotation = _data.rotation;
+		rotationIK = rotation;
 		scaleX = _data.scaleX;
 		scaleY = _data.scaleY;
+		flipX = _data.flipX;
+		flipY = _data.flipY;
 	}
 
 	public function get data () : BoneData {
 		return _data;
 	}
-
+	
 	public function get parent () : Bone {
 		return _parent;
 	}
+	
+	public function get skeleton () : Skeleton {
+		return _skeleton;
+	}
 
 	public function get m00 () : Number {
 		return _m00;
@@ -148,6 +170,32 @@ public class Bone {
 	public function get worldScaleY () : Number {
 		return _worldScaleY;
 	}
+	
+	public function get worldFlipX () : Boolean {
+		return _worldFlipX;
+	}
+	
+	public function get worldFlipY () : Boolean {
+		return _worldFlipY;
+	}
+
+	public function worldToLocal (world:Vector.<Number>) : void {
+		var dx:Number = world[0] - _worldX, dy:Number = world[1] - _worldY;
+		var m00:Number = _m00, m10:Number = _m10, m01:Number = _m01, m11:Number = _m11;
+		if (_worldFlipX != (_worldFlipY != yDown)) {
+			m00 = -m00;
+			m11 = -m11;
+		}
+		var invDet:Number = 1 / (m00 * m11 - m01 * m10);
+		world[0] = (dx * m00 * invDet - dy * m01 * invDet);
+		world[1] = (dy * m11 * invDet - dx * m10 * invDet);
+	}
+
+	public function localToWorld (local:Vector.<Number>) : void {
+		var localX:Number = local[0], localY:Number = local[1];
+		local[0] = localX * _m00 + localY * _m01 + _worldX;
+		local[1] = localX * _m10 + localY * _m11 + _worldY;
+	}
 
 	public function toString () : String {
 		return _data._name;

+ 8 - 7
spine-as3/spine-as3/src/spine/BoneData.as

@@ -31,8 +31,8 @@
 package spine {
 
 public class BoneData {
-	internal var _parent:BoneData;
 	internal var _name:String;
+	internal var _parent:BoneData;
 	public var length:Number;
 	public var x:Number;
 	public var y:Number;
@@ -41,24 +41,25 @@ public class BoneData {
 	public var scaleY:Number = 1;
 	public var inheritScale:Boolean = true;
 	public var inheritRotation:Boolean = true;
+	public var flipX:Boolean;
+	public var flipY:Boolean;
 
 	/** @param parent May be null. */
 	public function BoneData (name:String, parent:BoneData) {
-		if (name == null)
-			throw new ArgumentError("name cannot be null.");
+		if (name == null) throw new ArgumentError("name cannot be null.");
 		_name = name;
 		_parent = parent;
 	}
 
+	public function get name () : String {
+		return _name;
+	}
+
 	/** @return May be null. */
 	public function get parent () : BoneData {
 		return _parent;
 	}
 
-	public function get name () : String {
-		return _name;
-	}
-
 	public function toString () : String {
 		return _name;
 	}

+ 1 - 2
spine-as3/spine-as3/src/spine/Event.as

@@ -37,8 +37,7 @@ public class Event {
 	public var stringValue:String;
 
 	public function Event (data:EventData) {
-		if (data == null)
-			throw new ArgumentError("data cannot be null.");
+		if (data == null) throw new ArgumentError("data cannot be null.");
 		_data = data;
 	}
 

+ 1 - 2
spine-as3/spine-as3/src/spine/EventData.as

@@ -37,8 +37,7 @@ public class EventData {
 	public var stringValue:String;
 	
 	public function EventData (name:String) {
-		if (name == null)
-			throw new ArgumentError("name cannot be null.");
+		if (name == null) throw new ArgumentError("name cannot be null.");
 		_name = name;
 	}
 

+ 149 - 0
spine-as3/spine-as3/src/spine/IkConstraint.as

@@ -0,0 +1,149 @@
+/******************************************************************************
+ * Spine Runtimes Software License
+ * Version 2.1
+ * 
+ * Copyright (c) 2013, Esoteric Software
+ * All rights reserved.
+ * 
+ * You are granted a perpetual, non-exclusive, non-sublicensable and
+ * non-transferable license to install, execute and perform the Spine Runtimes
+ * Software (the "Software") solely for internal use. Without the written
+ * permission of Esoteric Software (typically granted by licensing Spine), you
+ * may not (a) modify, translate, adapt or otherwise create derivative works,
+ * improvements of the Software or develop new applications using the Software
+ * or (b) remove, delete, alter or obscure any trademarks or any copyright,
+ * trademark, patent or other intellectual property or proprietary rights
+ * notices on or in the Software, including any copy thereof. Redistributions
+ * in binary or source form must include this license and terms.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package spine {
+
+public class IkConstraint {
+	static private const tempPosition:Vector.<Number> = new Vector.<Number>(2, true);
+	static private const radDeg:Number = 180 / Math.PI;
+
+	internal var _data:IkConstraintData;
+	public var bones:Vector.<Bone>;
+	public var target:Bone;
+	public var bendDirection:int;
+	public var mix:Number;
+
+	public function IkConstraint (data:IkConstraintData, skeleton:Skeleton) {
+		if (data == null) throw new ArgumentError("data cannot be null.");
+		if (skeleton == null) throw new ArgumentError("skeleton cannot be null.");
+		_data = data;
+		mix = data.mix;
+		bendDirection = data.bendDirection;
+
+		bones = new Vector.<Bone>();
+		for each (var boneData:BoneData in data.bones)
+			bones[bones.length] = skeleton.findBone(boneData.name);
+		target = skeleton.findBone(data.target._name);
+	}
+
+	public function apply () : void {
+		switch (bones.length) {
+		case 1:
+			apply1(bones[0], target._worldX, target._worldY, mix);
+			break;
+		case 2:
+			apply2(bones[0], bones[1], target._worldX, target._worldY, bendDirection, mix);
+			break;
+		}
+	}
+
+	public function get data () : IkConstraintData {
+		return _data;
+	}
+
+	public function toString () : String {
+		return _data._name;
+	}
+	
+	/** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world
+	 * coordinate system. */
+	static public function apply1 (bone:Bone, targetX:Number, targetY:Number, alpha:Number) : void {
+		var parentRotation:Number = (!bone._data.inheritRotation || bone._parent == null) ? 0 : bone._parent._worldRotation;
+		var rotation:Number = bone.rotation;
+		var rotationIK:Number = Math.atan2(targetY - bone._worldY, targetX - bone._worldX) * radDeg - parentRotation;
+		bone.rotationIK = rotation + (rotationIK - rotation) * alpha;
+	}
+
+	/** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The
+	 * target is specified in the world coordinate system.
+	 * @param child Any descendant bone of the parent. */
+	static public function apply2 (parent:Bone, child:Bone, targetX:Number, targetY:Number, bendDirection:int, alpha:Number) : void {
+		var childRotation:Number = child.rotation, parentRotation:Number = parent.rotation;
+		if (alpha == 0) {
+			child.rotationIK = childRotation;
+			parent.rotationIK = parentRotation;
+			return;
+		}
+		var positionX:Number, positionY:Number;
+		var parentParent:Bone = parent._parent;
+		if (parentParent) {
+			tempPosition[0] = targetX;
+			tempPosition[1] = targetY;
+			parentParent.worldToLocal(tempPosition);
+			targetX = (tempPosition[0] - parent.x) * parentParent._worldScaleX;
+			targetY = (tempPosition[1] - parent.y) * parentParent._worldScaleY;
+		} else {
+			targetX -= parent.x;
+			targetY -= parent.y;
+		}
+		if (child._parent == parent) {
+			positionX = child.x;
+			positionY = child.y;
+		} else {
+			tempPosition[0] = child.x;
+			tempPosition[1] = child.y;
+			child._parent.localToWorld(tempPosition);
+			parent.worldToLocal(tempPosition);
+			positionX = tempPosition[0];
+			positionY = tempPosition[1];
+		}
+		var childX:Number = positionX * parent._worldScaleX, childY:Number = positionY * parent._worldScaleY;
+		var offset:Number = Math.atan2(childY, childX);
+		var len1:Number = Math.sqrt(childX * childX + childY * childY), len2:Number = child.data.length * child._worldScaleX;
+		// Based on code by Ryan Juckett with permission: Copyright (c) 2008-2009 Ryan Juckett, http://www.ryanjuckett.com/
+		var cosDenom:Number = 2 * len1 * len2;
+		if (cosDenom < 0.0001) {
+			child.rotationIK = childRotation + (Math.atan2(targetY, targetX) * radDeg - parentRotation - childRotation) * alpha;
+			return;
+		}
+		var cos:Number = (targetX * targetX + targetY * targetY - len1 * len1 - len2 * len2) / cosDenom;
+		if (cos < -1)
+			cos = -1;
+		else if (cos > 1)
+			cos = 1;
+		var childAngle:Number = Math.acos(cos) * bendDirection;
+		var adjacent:Number = len1 + len2 * cos, opposite:Number = len2 * Math.sin(childAngle);
+		var parentAngle:Number = Math.atan2(targetY * adjacent - targetX * opposite, targetX * adjacent + targetY * opposite);
+		var rotation:Number = (parentAngle - offset) * radDeg - parentRotation;
+		if (rotation > 180)
+			rotation -= 360;
+		else if (rotation < -180) //
+			rotation += 360;
+		parent.rotationIK = parentRotation + rotation * alpha;
+		rotation = (childAngle + offset) * radDeg - childRotation;
+		if (rotation > 180)
+			rotation -= 360;
+		else if (rotation < -180) //
+			rotation += 360;
+		child.rotationIK = childRotation + (rotation + parent._worldRotation - child._parent._worldRotation) * alpha;
+	}
+}
+
+}

+ 54 - 0
spine-as3/spine-as3/src/spine/IkConstraintData.as

@@ -0,0 +1,54 @@
+/******************************************************************************
+ * Spine Runtimes Software License
+ * Version 2.1
+ * 
+ * Copyright (c) 2013, Esoteric Software
+ * All rights reserved.
+ * 
+ * You are granted a perpetual, non-exclusive, non-sublicensable and
+ * non-transferable license to install, execute and perform the Spine Runtimes
+ * Software (the "Software") solely for internal use. Without the written
+ * permission of Esoteric Software (typically granted by licensing Spine), you
+ * may not (a) modify, translate, adapt or otherwise create derivative works,
+ * improvements of the Software or develop new applications using the Software
+ * or (b) remove, delete, alter or obscure any trademarks or any copyright,
+ * trademark, patent or other intellectual property or proprietary rights
+ * notices on or in the Software, including any copy thereof. Redistributions
+ * in binary or source form must include this license and terms.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package spine {
+
+public class IkConstraintData {
+	internal var _name:String;
+	public var bones:Vector.<BoneData> = new Vector.<BoneData>();
+	public var target:BoneData;
+	public var bendDirection:int = 1;
+	public var mix:Number = 1;
+
+	public function IkConstraintData (name:String) {
+		if (name == null) throw new ArgumentError("name cannot be null.");
+		_name = name;
+	}
+
+	public function get name () : String {
+		return _name;
+	}
+
+	public function toString () : String {
+		return _name;
+	}
+}
+
+}

+ 116 - 70
spine-as3/spine-as3/src/spine/Skeleton.as

@@ -33,45 +33,95 @@ import spine.attachments.Attachment;
 
 public class Skeleton {
 	internal var _data:SkeletonData;
-	internal var _bones:Vector.<Bone>;
-	internal var _slots:Vector.<Slot>;
-	internal var _drawOrder:Vector.<Slot>;
-	internal var _skin:Skin;
-	public var r:Number = 1;
-	public var g:Number = 1;
-	public var b:Number = 1;
-	public var a:Number = 1;
+	public var bones:Vector.<Bone>;
+	public var slots:Vector.<Slot>;
+	public var drawOrder:Vector.<Slot>;
+	public var ikConstraints:Vector.<IkConstraint>;
+	private var _boneCache:Vector.<Vector.<Bone>> = new Vector.<Vector.<Bone>>();
+	private var _skin:Skin;
+	public var r:Number = 1, g:Number = 1, b:Number = 1, a:Number = 1;
 	public var time:Number = 0;
-	public var flipX:Boolean;
-	public var flipY:Boolean;
-	public var x:Number = 0;
-	public var y:Number = 0;
+	public var flipX:Boolean, flipY:Boolean;
+	public var x:Number = 0, y:Number = 0;
 
 	public function Skeleton (data:SkeletonData) {
 		if (data == null)
 			throw new ArgumentError("data cannot be null.");
 		_data = data;
 
-		_bones = new Vector.<Bone>();
+		bones = new Vector.<Bone>();
 		for each (var boneData:BoneData in data.bones) {
-			var parent:Bone = boneData.parent == null ? null : _bones[data.bones.indexOf(boneData.parent)];
-			_bones[_bones.length] = new Bone(boneData, parent);
+			var parent:Bone = boneData.parent == null ? null : bones[data.bones.indexOf(boneData.parent)];
+			bones[bones.length] = new Bone(boneData, this, parent);
 		}
 
-		_slots = new Vector.<Slot>();
-		_drawOrder = new Vector.<Slot>();
+		slots = new Vector.<Slot>();
+		drawOrder = new Vector.<Slot>();
 		for each (var slotData:SlotData in data.slots) {
-			var bone:Bone  = _bones[data.bones.indexOf(slotData.boneData)];
-			var slot:Slot  = new Slot(slotData, this, bone);
-			_slots[_slots.length] = slot;
-			_drawOrder[_drawOrder.length] = slot;
+			var bone:Bone = bones[data.bones.indexOf(slotData.boneData)];
+			var slot:Slot = new Slot(slotData, bone);
+			slots[slots.length] = slot;
+			drawOrder[drawOrder.length] = slot;
+		}
+		
+		ikConstraints = new Vector.<IkConstraint>()
+		for each (var ikConstraintData:IkConstraintData in data.ikConstraints)
+			ikConstraints[ikConstraints.length] = new IkConstraint(ikConstraintData, this);
+
+		updateCache();
+	}
+
+	/** Caches information about bones and IK constraints. Must be called if bones or IK constraints are added or removed. */
+	public function updateCache () : void {
+		var ikConstraintsCount:int = ikConstraints.length;
+
+		var arrayCount:int = ikConstraintsCount + 1;
+		if (_boneCache.length > arrayCount) _boneCache.splice(arrayCount, _boneCache.length - arrayCount);
+		for each (var cachedBones:Vector.<Bone> in _boneCache)
+			cachedBones.length = 0;
+		while (_boneCache.length < arrayCount)
+			_boneCache[_boneCache.length] = new Vector.<Bone>();
+
+		var nonIkBones:Vector.<Bone> = _boneCache[0];
+
+		outer:
+		for each (var bone:Bone in bones) {
+			var current:Bone = bone;
+			do {
+				var ii:int = 0;
+				for each (var ikConstraint:IkConstraint in ikConstraints) {
+					var parent:Bone = ikConstraint.bones[0];
+					var child:Bone = ikConstraint.bones[int(ikConstraint.bones.length - 1)];
+					while (true) {
+						if (current == child) {
+							_boneCache[ii].push(bone);
+							_boneCache[int(ii + 1)].push(bone);
+							continue outer;
+						}
+						if (child == parent) break;
+						child = child.parent;
+					}
+					ii++;
+				}
+				current = current.parent;
+			} while (current != null);
+			nonIkBones[nonIkBones.length] = bone;
 		}
 	}
 
-	/** Updates the world transform for each bone. */
+	/** Updates the world transform for each bone and applies IK constraints. */
 	public function updateWorldTransform () : void {
-		for each (var bone:Bone in _bones)
-			bone.updateWorldTransform(flipX, flipY);
+		var bone:Bone;
+		for each (bone in bones)
+			bone.rotationIK = bone.rotation;
+		var i:int = 0, last:int = _boneCache.length - 1;
+		while (true) {
+			for each (bone in _boneCache[i])
+				bone.updateWorldTransform();
+			if (i == last) break;
+			ikConstraints[i].apply();
+			i++;
+		}
 	}
 
 	/** Sets the bones and slots to their setup pose values. */
@@ -81,13 +131,18 @@ public class Skeleton {
 	}
 
 	public function setBonesToSetupPose () : void {
-		for each (var bone:Bone in _bones)
+		for each (var bone:Bone in bones)
 			bone.setToSetupPose();
+
+		for each (var ikConstraint:IkConstraint in ikConstraints) {
+			ikConstraint.bendDirection = ikConstraint._data.bendDirection;
+			ikConstraint.mix = ikConstraint._data.mix;
+		}
 	}
 
 	public function setSlotsToSetupPose () : void {
 		var i:int = 0;
-		for each (var slot:Slot in _slots) { 
+		for each (var slot:Slot in slots) { 
 			drawOrder[i++] = slot;
 			slot.setToSetupPose();
 		}
@@ -97,23 +152,17 @@ public class Skeleton {
 		return _data;
 	}
 
-	public function get bones () : Vector.<Bone> {
-		return _bones;
-	}
-
 	public function get rootBone () : Bone {
-		if (_bones.length == 0)
-			return null;
-		return _bones[0];
+		if (bones.length == 0) return null;
+		return bones[0];
 	}
 
 	/** @return May be null. */
 	public function findBone (boneName:String) : Bone {
 		if (boneName == null)
 			throw new ArgumentError("boneName cannot be null.");
-		for each (var bone:Bone in _bones)
-			if (bone.data.name == boneName)
-				return bone;
+		for each (var bone:Bone in bones)
+			if (bone._data._name == boneName) return bone;
 		return null;
 	}
 
@@ -122,25 +171,19 @@ public class Skeleton {
 		if (boneName == null)
 			throw new ArgumentError("boneName cannot be null.");
 		var i:int = 0;
-		for each (var bone:Bone in _bones) {
-			if (bone.data.name == boneName)
-				return i;
+		for each (var bone:Bone in bones) {
+			if (bone._data._name == boneName) return i;
 			i++;
 		}
 		return -1;
 	}
 
-	public function get slots () : Vector.<Slot> {
-		return _slots;
-	}
-
 	/** @return May be null. */
 	public function findSlot (slotName:String) : Slot {
 		if (slotName == null)
 			throw new ArgumentError("slotName cannot be null.");
-		for each (var slot:Slot in _slots)
-			if (slot.data.name == slotName)
-				return slot;
+		for each (var slot:Slot in slots)
+			if (slot._data._name == slotName) return slot;
 		return null;
 	}
 
@@ -149,32 +192,31 @@ public class Skeleton {
 		if (slotName == null)
 			throw new ArgumentError("slotName cannot be null.");
 		var i:int = 0;
-		for each (var slot:Slot in _slots) {
-			if (slot.data.name == slotName)
-				return i;
+		for each (var slot:Slot in slots) {
+			if (slot._data._name == slotName) return i;
 			i++;
 		}
 		return -1;
 	}
 
-	public function get drawOrder () : Vector.<Slot> {
-		return _drawOrder;
-	}
-
 	public function get skin () : Skin {
 		return _skin;
 	}
 
 	public function set skinName (skinName:String) : void {
 		var skin:Skin = data.findSkin(skinName);
-		if (skin == null)
-			throw new ArgumentError("Skin not found: " + skinName);
+		if (skin == null) throw new ArgumentError("Skin not found: " + skinName);
 		this.skin = skin;
 	}
 
-	/** Sets the skin used to look up attachments not found in the {@link SkeletonData#getDefaultSkin() default skin}. Attachments
-	 * from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no old skin,
-	 * each slot's setup mode attachment is attached from the new skin.
+	/** @return May be null. */
+	public function get skinName () : String {
+		return _skin == null ? null : _skin._name;
+	}
+
+	/** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. 
+	 * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was 
+	 * no old skin, each slot's setup mode attachment is attached from the new skin.
 	 * @param newSkin May be null. */
 	public function set skin (newSkin:Skin) : void {
 		if (newSkin) {
@@ -182,8 +224,8 @@ public class Skeleton {
 				newSkin.attachAll(this, skin);
 			else {
 				var i:int = 0;
-				for each (var slot:Slot in _slots) {
-					var name:String = slot.data.attachmentName;
+				for each (var slot:Slot in slots) {
+					var name:String = slot._data.attachmentName;
 					if (name) {
 						var attachment:Attachment = newSkin.getAttachment(i, name);
 						if (attachment) slot.attachment = attachment;
@@ -202,25 +244,21 @@ public class Skeleton {
 
 	/** @return May be null. */
 	public function getAttachmentForSlotIndex (slotIndex:int, attachmentName:String) : Attachment {
-		if (attachmentName == null)
-			throw new ArgumentError("attachmentName cannot be null.");
+		if (attachmentName == null) throw new ArgumentError("attachmentName cannot be null.");
 		if (skin != null) {
 			var attachment:Attachment = skin.getAttachment(slotIndex, attachmentName);
-			if (attachment != null)
-				return attachment;
+			if (attachment != null) return attachment;
 		}
-		if (data.defaultSkin != null)
-			return data.defaultSkin.getAttachment(slotIndex, attachmentName);
+		if (data.defaultSkin != null) return data.defaultSkin.getAttachment(slotIndex, attachmentName);
 		return null;
 	}
 
 	/** @param attachmentName May be null. */
 	public function setAttachment (slotName:String, attachmentName:String) : void {
-		if (slotName == null)
-			throw new ArgumentError("slotName cannot be null.");
+		if (slotName == null) throw new ArgumentError("slotName cannot be null.");
 		var i:int = 0;
-		for each (var slot:Slot in _slots) {
-			if (slot.data.name == slotName) {
+		for each (var slot:Slot in slots) {
+			if (slot._data._name == slotName) {
 				var attachment:Attachment = null;
 				if (attachmentName != null) {
 					attachment = getAttachmentForSlotIndex(i, attachmentName);
@@ -235,6 +273,14 @@ public class Skeleton {
 		throw new ArgumentError("Slot not found: " + slotName);
 	}
 
+	/** @return May be null. */
+	public function findIkConstraint (ikConstraintName:String) : IkConstraint {
+		if (ikConstraintName == null) throw new ArgumentError("ikConstraintName cannot be null.");
+		for each (var ikConstraint:IkConstraint in ikConstraints)
+			if (ikConstraint._data._name == ikConstraintName) return ikConstraint;
+		return null;
+	}
+
 	public function update (delta:Number) : void {
 		time += delta;
 	}

+ 1 - 1
spine-as3/spine-as3/src/spine/SkeletonBounds.as

@@ -43,7 +43,7 @@ public class SkeletonBounds {
 		var slots:Vector.<Slot> = skeleton.slots;
 		var slotCount:int = slots.length;
 		var x:Number = skeleton.x, y:Number = skeleton.y;
-		
+
 		boundingBoxes.length = 0;
 		for each (var polygon:Polygon in polygons)
 			polygonPool[polygonPool.length] = polygon;

+ 29 - 63
spine-as3/spine-as3/src/spine/SkeletonData.as

@@ -32,6 +32,7 @@ package spine {
 import spine.animation.Animation;
 
 public class SkeletonData {
+	/** May be null. */
 	public var name:String;
 	public var bones:Vector.<BoneData> = new Vector.<BoneData>(); // Ordered parents first.
 	public var slots:Vector.<SlotData> = new Vector.<SlotData>(); // Setup pose draw order.
@@ -39,122 +40,87 @@ public class SkeletonData {
 	public var defaultSkin:Skin;
 	public var events:Vector.<EventData> = new Vector.<EventData>();
 	public var animations:Vector.<Animation> = new Vector.<Animation>();
+	public var ikConstraints:Vector.<IkConstraintData> = new Vector.<IkConstraintData>();
+	public var width:Number, height:Number;
+	public var version:String, hash:String;
 
 	// --- Bones.
 
-	public function addBone (bone:BoneData) : void {
-		if (bone == null)
-			throw new ArgumentError("bone cannot be null.");
-		bones[bones.length] = bone;
-	}
-
 	/** @return May be null. */
 	public function findBone (boneName:String) : BoneData {
-		if (boneName == null)
-			throw new ArgumentError("boneName cannot be null.");
+		if (boneName == null) throw new ArgumentError("boneName cannot be null.");
 		for (var i:int = 0, n:int = bones.length; i < n; i++) {
 			var bone:BoneData = bones[i];
-			if (bone._name == boneName)
-				return bone;
+			if (bone._name == boneName) return bone;
 		}
 		return null;
 	}
 
 	/** @return -1 if the bone was not found. */
 	public function findBoneIndex (boneName:String) : int {
-		if (boneName == null)
-			throw new ArgumentError("boneName cannot be null.");
+		if (boneName == null) throw new ArgumentError("boneName cannot be null.");
 		for (var i:int = 0, n:int = bones.length; i < n; i++)
-			if (bones[i]._name == boneName)
-				return i;
+			if (bones[i]._name == boneName) return i;
 		return -1;
 	}
 
 	// --- Slots.
 
-	public function addSlot (slot:SlotData) : void {
-		if (slot == null)
-			throw new ArgumentError("slot cannot be null.");
-		slots[slots.length] = slot;
-	}
-
 	/** @return May be null. */
 	public function findSlot (slotName:String) : SlotData {
-		if (slotName == null)
-			throw new ArgumentError("slotName cannot be null.");
+		if (slotName == null) throw new ArgumentError("slotName cannot be null.");
 		for (var i:int = 0, n:int = slots.length; i < n; i++) {
 			var slot:SlotData = slots[i];
-			if (slot._name == slotName)
-				return slot;
+			if (slot._name == slotName) return slot;
 		}
 		return null;
 	}
 
 	/** @return -1 if the bone was not found. */
 	public function findSlotIndex (slotName:String) : int {
-		if (slotName == null)
-			throw new ArgumentError("slotName cannot be null.");
+		if (slotName == null) throw new ArgumentError("slotName cannot be null.");
 		for (var i:int = 0, n:int = slots.length; i < n; i++)
-			if (slots[i]._name == slotName)
-				return i;
+			if (slots[i]._name == slotName) return i;
 		return -1;
 	}
 
 	// --- Skins.
 
-	public function addSkin (skin:Skin) : void {
-		if (skin == null)
-			throw new ArgumentError("skin cannot be null.");
-		skins[skins.length] = skin;
-	}
-
 	/** @return May be null. */
 	public function findSkin (skinName:String) : Skin {
-		if (skinName == null)
-			throw new ArgumentError("skinName cannot be null.");
+		if (skinName == null) throw new ArgumentError("skinName cannot be null.");
 		for each (var skin:Skin in skins)
-			if (skin._name == skinName)
-				return skin;
+			if (skin._name == skinName) return skin;
 		return null;
 	}
 	
 	// --- Events.
 	
-	public function addEvent (eventData:EventData) : void {
-		if (eventData == null)
-			throw new ArgumentError("eventData cannot be null.");
-		events[events.length] = eventData;
-	}
-	
 	/** @return May be null. */
 	public function findEvent (eventName:String) : EventData {
-		if (eventName == null)
-			throw new ArgumentError("eventName cannot be null.");
-		for (var i:int = 0, n:int = events.length; i < n; i++) {
-			var eventData:EventData = events[i];
-			if (eventData.name == eventName)
-				return eventData;
-		}
+		if (eventName == null) throw new ArgumentError("eventName cannot be null.");
+		for each (var eventData:EventData in events)
+			if (eventData._name == eventName) return eventData;
 		return null;
 	}
 	
 	// --- Animations.
 	
-	public function addAnimation (animation:Animation) : void {
-		if (animation == null)
-			throw new ArgumentError("animation cannot be null.");
-		animations[animations.length] = animation;
+	/** @return May be null. */
+	public function findAnimation (animationName:String) : Animation {
+		if (animationName == null) throw new ArgumentError("animationName cannot be null.");
+		for each (var animation:Animation in animations)
+			if (animation.name == animationName) return animation;
+		return null;
 	}
 	
+	// --- IK constraints.
+
 	/** @return May be null. */
-	public function findAnimation (animationName:String) : Animation {
-		if (animationName == null)
-			throw new ArgumentError("animationName cannot be null.");
-		for (var i:int = 0, n:int = animations.length; i < n; i++) {
-			var animation:Animation = animations[i];
-			if (animation.name == animationName)
-				return animation;
-		}
+	public function findIkConstraint (ikConstraintName:String) : IkConstraintData {
+		if (ikConstraintName == null) throw new ArgumentError("ikConstraintName cannot be null.");
+		for each (var ikConstraintData:IkConstraintData in ikConstraints)
+			if (ikConstraintData._name == ikConstraintName) return ikConstraintData;
 		return null;
 	}
 

+ 87 - 34
spine-as3/spine-as3/src/spine/SkeletonJson.as

@@ -38,6 +38,9 @@ import spine.animation.CurveTimeline;
 import spine.animation.DrawOrderTimeline;
 import spine.animation.EventTimeline;
 import spine.animation.FfdTimeline;
+import spine.animation.FlipXTimeline;
+import spine.animation.FlipYTimeline;
+import spine.animation.IkConstraintTimeline;
 import spine.animation.RotateTimeline;
 import spine.animation.ScaleTimeline;
 import spine.animation.Timeline;
@@ -51,12 +54,6 @@ import spine.attachments.RegionAttachment;
 import spine.attachments.SkinnedMeshAttachment;
 
 public class SkeletonJson {
-	static public const TIMELINE_SCALE:String = "scale";
-	static public const TIMELINE_ROTATE:String = "rotate";
-	static public const TIMELINE_TRANSLATE:String = "translate";
-	static public const TIMELINE_ATTACHMENT:String = "attachment";
-	static public const TIMELINE_COLOR:String = "color";
-
 	public var attachmentLoader:AttachmentLoader;
 	public var scale:Number = 1;
 
@@ -66,8 +63,7 @@ public class SkeletonJson {
 
 	/** @param object A String or ByteArray. */
 	public function readSkeletonData (object:*, name:String = null) : SkeletonData {
-		if (object == null)
-			throw new ArgumentError("object cannot be null.");
+		if (object == null) throw new ArgumentError("object cannot be null.");
 
 		var root:Object;
 		if (object is String)
@@ -82,6 +78,15 @@ public class SkeletonJson {
 		var skeletonData:SkeletonData = new SkeletonData();
 		skeletonData.name = name;
 
+		// Skeleton.
+		var skeletonMap:Object = root["skeleton"];
+		if (skeletonMap) {
+			skeletonData.hash = skeletonMap["hash"];
+			skeletonData.version = skeletonMap["spine"];
+			skeletonData.width = skeletonMap["width"] || 0;
+			skeletonData.height = skeletonMap["height"] || 0;
+		}
+
 		// Bones.
 		var boneData:BoneData;
 		for each (var boneMap:Object in root["bones"]) {
@@ -89,8 +94,7 @@ public class SkeletonJson {
 			var parentName:String = boneMap["parent"];
 			if (parentName) {
 				parent = skeletonData.findBone(parentName);
-				if (!parent)
-					throw new Error("Parent bone not found: " + parentName);
+				if (!parent) throw new Error("Parent bone not found: " + parentName);
 			}
 			boneData = new BoneData(boneMap["name"], parent);
 			boneData.length = (boneMap["length"] || 0) * scale;
@@ -99,17 +103,37 @@ public class SkeletonJson {
 			boneData.rotation = (boneMap["rotation"] || 0);
 			boneData.scaleX = boneMap.hasOwnProperty("scaleX") ? boneMap["scaleX"] : 1;
 			boneData.scaleY = boneMap.hasOwnProperty("scaleY") ? boneMap["scaleY"] : 1;
+			boneData.flipX = boneMap["flipX"] || false;
+			boneData.flipY = boneMap["flipY"] || false;
 			boneData.inheritScale = boneMap.hasOwnProperty("inheritScale") ? boneMap["inheritScale"] : true;
 			boneData.inheritRotation = boneMap.hasOwnProperty("inheritRotation") ? boneMap["inheritRotation"] : true;
-			skeletonData.addBone(boneData);
+			skeletonData.bones[skeletonData.bones.length] = boneData;
+		}
+
+		// IK constraints.
+		for each (var ikMap:Object in root["ik"]) {
+			var ikConstraintData:IkConstraintData = new IkConstraintData(ikMap["name"]);
+
+			for each (var boneName:String in ikMap["bones"]) {
+				var bone:BoneData = skeletonData.findBone(boneName);
+				if (!bone) throw new Error("IK bone not found: " + boneName);
+				ikConstraintData.bones[ikConstraintData.bones.length] = bone;
+			}
+
+			ikConstraintData.target = skeletonData.findBone(ikMap["target"]);
+			if (!ikConstraintData.target) throw new Error("Target bone not found: " + ikMap["target"]);
+
+			ikConstraintData.bendDirection = (!ikMap.hasOwnProperty("bendPositive") || ikMap["bendPositive"]) ? 1 : -1;
+			ikConstraintData.mix = ikMap.hasOwnProperty("mix") ? ikMap["mix"] : 1;
+
+			skeletonData.ikConstraints[skeletonData.ikConstraints.length] = ikConstraintData;
 		}
 
 		// Slots.
 		for each (var slotMap:Object in root["slots"]) {
-			var boneName:String = slotMap["bone"];
+			boneName = slotMap["bone"];
 			boneData = skeletonData.findBone(boneName);
-			if (!boneData)
-				throw new Error("Slot bone not found: " + boneName);
+			if (!boneData) throw new Error("Slot bone not found: " + boneName);
 			var slotData:SlotData = new SlotData(slotMap["name"], boneData);
 
 			var color:String = slotMap["color"];
@@ -123,7 +147,7 @@ public class SkeletonJson {
 			slotData.attachmentName = slotMap["attachment"];
 			slotData.additiveBlending = slotMap["additive"];
 
-			skeletonData.addSlot(slotData);
+			skeletonData.slots[skeletonData.slots.length] = slotData;
 		}
 
 		// Skins.
@@ -140,7 +164,7 @@ public class SkeletonJson {
 						skin.addAttachment(slotIndex, attachmentName, attachment);
 				}
 			}
-			skeletonData.addSkin(skin);
+			skeletonData.skins[skeletonData.skins.length] = skin;
 			if (skin.name == "default")
 				skeletonData.defaultSkin = skin;
 		}
@@ -154,7 +178,7 @@ public class SkeletonJson {
 				eventData.intValue = eventMap["int"] || 0;
 				eventData.floatValue = eventMap["float"] || 0;
 				eventData.stringValue = eventMap["string"] || null;
-				skeletonData.addEvent(eventData);
+				skeletonData.events[skeletonData.events.length] = eventData;
 			}
 		}
 
@@ -286,7 +310,7 @@ public class SkeletonJson {
 
 			for (timelineName in slotMap) {
 				values = slotMap[timelineName];
-				if (timelineName == TIMELINE_COLOR) {
+				if (timelineName == "color") {
 					var colorTimeline:ColorTimeline = new ColorTimeline(values.length);
 					colorTimeline.slotIndex = slotIndex;
 					
@@ -304,7 +328,7 @@ public class SkeletonJson {
 					timelines[timelines.length] = colorTimeline;
 					duration = Math.max(duration, colorTimeline.frames[colorTimeline.frameCount * 5 - 5]);
 					
-				} else if (timelineName == TIMELINE_ATTACHMENT) {
+				} else if (timelineName == "attachment") {
 					var attachmentTimeline:AttachmentTimeline = new AttachmentTimeline(values.length);
 					attachmentTimeline.slotIndex = slotIndex;
 					
@@ -313,7 +337,7 @@ public class SkeletonJson {
 						attachmentTimeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]);
 					timelines[timelines.length] = attachmentTimeline;
 					duration = Math.max(duration, attachmentTimeline.frames[attachmentTimeline.frameCount - 1]);
-					
+
 				} else
 					throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")");
 			}
@@ -322,13 +346,12 @@ public class SkeletonJson {
 		var bones:Object = map["bones"];
 		for (var boneName:String in bones) {
 			var boneIndex:int = skeletonData.findBoneIndex(boneName);
-			if (boneIndex == -1)
-				throw new Error("Bone not found: " + boneName);
+			if (boneIndex == -1) throw new Error("Bone not found: " + boneName);
 			var boneMap:Object = bones[boneName];
 
 			for (timelineName in boneMap) {
 				values = boneMap[timelineName];
-				if (timelineName == TIMELINE_ROTATE) {
+				if (timelineName == "rotate") {
 					var rotateTimeline:RotateTimeline = new RotateTimeline(values.length);
 					rotateTimeline.boneIndex = boneIndex;
 
@@ -341,10 +364,10 @@ public class SkeletonJson {
 					timelines[timelines.length] = rotateTimeline;
 					duration = Math.max(duration, rotateTimeline.frames[rotateTimeline.frameCount * 2 - 2]);
 
-				} else if (timelineName == TIMELINE_TRANSLATE || timelineName == TIMELINE_SCALE) {
+				} else if (timelineName == "translate" || timelineName == "scale") {
 					var timeline:TranslateTimeline;
 					var timelineScale:Number = 1;
-					if (timelineName == TIMELINE_SCALE)
+					if (timelineName == "scale")
 						timeline = new ScaleTimeline(values.length);
 					else {
 						timeline = new TranslateTimeline(values.length);
@@ -363,11 +386,43 @@ public class SkeletonJson {
 					timelines[timelines.length] = timeline;
 					duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]);
 
+				} else if (timelineName == "flipX" || timelineName == "flipY") {
+					var flipX:Boolean = timelineName == "flipX";
+					var flipTimeline:FlipXTimeline = flipX ? new FlipXTimeline(values.length) : new FlipYTimeline(values.length);
+					flipTimeline.boneIndex = boneIndex;
+					
+					var field:String = flipX ? "x" : "y";
+					frameIndex = 0;
+					for each (valueMap in values) {
+						flipTimeline.setFrame(frameIndex, valueMap["time"], valueMap[field] || false);
+						frameIndex++;
+					}
+					timelines[timelines.length] = flipTimeline;
+					duration = Math.max(duration, flipTimeline.frames[flipTimeline.frameCount * 3 - 3]);
+
 				} else
 					throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")");
 			}
 		}
 
+		var ikMap:Object = map["ik"];
+		for (var ikConstraintName:String in ikMap) {
+			var ikConstraint:IkConstraintData = skeletonData.findIkConstraint(ikConstraintName);
+			values = ikMap[ikConstraintName];
+			var ikTimeline:IkConstraintTimeline = new IkConstraintTimeline(values.length);
+			ikTimeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(ikConstraint);
+			frameIndex = 0;
+			for each (valueMap in values) {
+				var mix:Number = valueMap.hasOwnProperty("mix") ? valueMap["mix"] : 1;
+				var bendDirection:int = (!valueMap.hasOwnProperty("bendPositive") || valueMap["bendPositive"]) ? 1 : -1;
+				ikTimeline.setFrame(frameIndex, valueMap["time"], mix, bendDirection);
+				readCurve(ikTimeline, frameIndex, valueMap);
+				frameIndex++;
+			}
+			timelines[timelines.length] = ikTimeline;
+			duration = Math.max(duration, ikTimeline.frames[ikTimeline.frameCount * 3 - 3]);
+		}
+
 		var ffd:Object = map["ffd"];
 		for (var skinName:String in ffd) {
 			var skin:Skin = skeletonData.findSkin(skinName);
@@ -426,7 +481,8 @@ public class SkeletonJson {
 			}
 		}
 
-		var drawOrderValues:Object = map["draworder"];
+		var drawOrderValues:Object = map["drawOrder"];
+		if (!drawOrderValues) drawOrderValues = map["draworder"];
 		if (drawOrderValues) {
 			var drawOrderTimeline:DrawOrderTimeline = new DrawOrderTimeline(drawOrderValues.length);
 			var slotCount:int = skeletonData.slots.length;
@@ -468,7 +524,7 @@ public class SkeletonJson {
 			frameIndex = 0;
 			for each (var eventMap:Object in eventsMap) {
 				var eventData:EventData = skeletonData.findEvent(eventMap["name"]);
-				if (eventData == null) throw new Error("Event not found: " + eventMap["name"]);
+				if (!eventData) throw new Error("Event not found: " + eventMap["name"]);
 				var event:Event = new Event(eventData);
 				event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue;
 				event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue;
@@ -479,23 +535,20 @@ public class SkeletonJson {
 			duration = Math.max(duration, eventTimeline.frames[eventTimeline.frameCount - 1]);
 		}
 
-		skeletonData.addAnimation(new Animation(name, timelines, duration));
+		skeletonData.animations[skeletonData.animations.length] = new Animation(name, timelines, duration);
 	}
 
 	static private function readCurve (timeline:CurveTimeline, frameIndex:int, valueMap:Object) : void {
 		var curve:Object = valueMap["curve"];
-		if (curve == null)
-			return;
+		if (!curve) return;
 		if (curve == "stepped")
 			timeline.setStepped(frameIndex);
-		else if (curve is Array) {
+		else if (curve is Array)
 			timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);
-		}
 	}
 
 	static private function toColor (hexString:String, colorIndex:int) : Number {
-		if (hexString.length != 8)
-			throw new ArgumentError("Color hexidecimal length must be 8, recieved: " + hexString);
+		if (hexString.length != 8) throw new ArgumentError("Color hexidecimal length must be 8, recieved: " + hexString);
 		return parseInt(hexString.substring(colorIndex * 2, colorIndex * 2 + 2), 16) / 255;
 	}
 

+ 3 - 5
spine-as3/spine-as3/src/spine/Skin.as

@@ -39,14 +39,12 @@ public class Skin {
 	private var _attachments:Vector.<Dictionary> = new Vector.<Dictionary>();
 
 	public function Skin (name:String) {
-		if (name == null)
-			throw new ArgumentError("name cannot be null.");
+		if (name == null) throw new ArgumentError("name cannot be null.");
 		_name = name;
 	}
 
 	public function addAttachment (slotIndex:int, name:String, attachment:Attachment) : void {
-		if (attachment == null)
-			throw new ArgumentError("attachment cannot be null.");
+		if (attachment == null) throw new ArgumentError("attachment cannot be null.");
 		if (slotIndex >= attachments.length) attachments.length = slotIndex + 1;
 		if (!attachments[slotIndex]) attachments[slotIndex] = new Dictionary();
 		attachments[slotIndex][name] = attachment;
@@ -74,7 +72,7 @@ public class Skin {
 	/** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */
 	public function attachAll (skeleton:Skeleton, oldSkin:Skin) : void {
 		var slotIndex:int = 0;
-		for each (var slot:Slot in skeleton._slots) {
+		for each (var slot:Slot in skeleton.slots) {
 			var slotAttachment:Attachment = slot.attachment;
 			if (slotAttachment && slotIndex < oldSkin.attachments.length) {
 				var dictionary:Dictionary = oldSkin.attachments[slotIndex];

+ 13 - 19
spine-as3/spine-as3/src/spine/Slot.as

@@ -34,7 +34,6 @@ import spine.attachments.Attachment;
 public class Slot {
 	internal var _data:SlotData;
 	internal var _bone:Bone;
-	internal var _skeleton:Skeleton;
 	public var r:Number;
 	public var g:Number;
 	public var b:Number;
@@ -43,15 +42,10 @@ public class Slot {
 	private var _attachmentTime:Number;
 	public var attachmentVertices:Vector.<Number> = new Vector.<Number>();
 
-	public function Slot (data:SlotData, skeleton:Skeleton, bone:Bone) {
-		if (data == null)
-			throw new ArgumentError("data cannot be null.");
-		if (skeleton == null)
-			throw new ArgumentError("skeleton cannot be null.");
-		if (bone == null)
-			throw new ArgumentError("bone cannot be null.");
+	public function Slot (data:SlotData, bone:Bone) {
+		if (data == null) throw new ArgumentError("data cannot be null.");
+		if (bone == null) throw new ArgumentError("bone cannot be null.");
 		_data = data;
-		_skeleton = skeleton;
 		_bone = bone;
 		setToSetupPose();
 	}
@@ -59,14 +53,14 @@ public class Slot {
 	public function get data () : SlotData {
 		return _data;
 	}
-
-	public function get skeleton () : Skeleton {
-		return _skeleton;
-	}
-
+	
 	public function get bone () : Bone {
 		return _bone;
 	}
+	
+	public function get skeleton () : Skeleton {
+		return _bone._skeleton;
+	}
 
 	/** @return May be null. */
 	public function get attachment () : Attachment {
@@ -77,26 +71,26 @@ public class Slot {
 	 * @param attachment May be null. */
 	public function set attachment (attachment:Attachment) : void {
 		_attachment = attachment;
-		_attachmentTime = _skeleton.time;
+		_attachmentTime = _bone._skeleton.time;
 		attachmentVertices.length = 0;
 	}
 
 	public function set attachmentTime (time:Number) : void {
-		_attachmentTime = skeleton.time - time;
+		_attachmentTime = _bone._skeleton.time - time;
 	}
 
 	/** Returns the time since the attachment was set. */
 	public function get attachmentTime () : Number {
-		return skeleton.time - _attachmentTime;
+		return _bone._skeleton.time - _attachmentTime;
 	}
 
 	public function setToSetupPose () : void {
-		var slotIndex:int = skeleton.data.slots.indexOf(data);
+		var slotIndex:int = _bone._skeleton.data.slots.indexOf(data);
 		r = _data.r;
 		g = _data.g;
 		b = _data.b;
 		a = _data.a;
-		attachment = _data.attachmentName == null ? null : skeleton.getAttachmentForSlotIndex(slotIndex, data.attachmentName);
+		attachment = _data.attachmentName == null ? null : _bone._skeleton.getAttachmentForSlotIndex(slotIndex, data.attachmentName);
 	}
 
 	public function toString () : String {

+ 2 - 4
spine-as3/spine-as3/src/spine/SlotData.as

@@ -41,10 +41,8 @@ public class SlotData {
 	public var additiveBlending:Boolean;
 
 	public function SlotData (name:String, boneData:BoneData) {
-		if (name == null)
-			throw new ArgumentError("name cannot be null.");
-		if (boneData == null)
-			throw new ArgumentError("boneData cannot be null.");
+		if (name == null) throw new ArgumentError("name cannot be null.");
+		if (boneData == null) throw new ArgumentError("boneData cannot be null.");
 		_name = name;
 		_boneData = boneData;
 	}

+ 23 - 8
spine-as3/spine-as3/src/spine/animation/Animation.as

@@ -38,10 +38,8 @@ public class Animation {
 	public var duration:Number;
 
 	public function Animation (name:String, timelines:Vector.<Timeline>, duration:Number) {
-		if (name == null)
-			throw new ArgumentError("name cannot be null.");
-		if (timelines == null)
-			throw new ArgumentError("timelines cannot be null.");
+		if (name == null) throw new ArgumentError("name cannot be null.");
+		if (timelines == null) throw new ArgumentError("timelines cannot be null.");
 		_name = name;
 		_timelines = timelines;
 		this.duration = duration;
@@ -53,8 +51,7 @@ public class Animation {
 
 	/** Poses the skeleton at the specified time for this animation. */
 	public function apply (skeleton:Skeleton, lastTime:Number, time:Number, loop:Boolean, events:Vector.<Event>) : void {
-		if (skeleton == null)
-			throw new ArgumentError("skeleton cannot be null.");
+		if (skeleton == null) throw new ArgumentError("skeleton cannot be null.");
 
 		if (loop && duration != 0) {
 			time %= duration;
@@ -68,8 +65,7 @@ public class Animation {
 	/** Poses the skeleton at the specified time for this animation mixed with the current pose.
 	 * @param alpha The amount of this animation that affects the current pose. */
 	public function mix (skeleton:Skeleton, lastTime:Number, time:Number, loop:Boolean, events:Vector.<Event>, alpha:Number) : void {
-		if (skeleton == null)
-			throw new ArgumentError("skeleton cannot be null.");
+		if (skeleton == null) throw new ArgumentError("skeleton cannot be null.");
 
 		if (loop && duration != 0) {
 			time %= duration;
@@ -107,6 +103,25 @@ public class Animation {
 		return 0; // Can't happen.
 	}
 
+	/** @param target After the first and before the last entry. */
+	static public function binarySearch1 (values:Vector.<Number>, target:Number) : int {
+		var low:int = 0;
+		var high:int = values.length - 2;
+		if (high == 0)
+			return 1;
+		var current:int = high >>> 1;
+		while (true) {
+			if (values[int(current + 1)] <= target)
+				low = current + 1;
+			else
+				high = current;
+			if (low == high)
+				return low + 1;
+			current = (low + high) >>> 1;
+		}
+		return 0; // Can't happen.
+	}
+	
 	static public function linearSearch (values:Vector.<Number>, target:Number, step:int) : int {
 		for (var i:int = 0, last:int = values.length - step; i <= last; i += step)
 			if (values[i] > target)

+ 5 - 10
spine-as3/spine-as3/src/spine/animation/AnimationStateData.as

@@ -46,26 +46,21 @@ public class AnimationStateData {
 
 	public function setMixByName (fromName:String, toName:String, duration:Number) : void {
 		var from:Animation = _skeletonData.findAnimation(fromName);
-		if (from == null)
-			throw new ArgumentError("Animation not found: " + fromName);
+		if (from == null) throw new ArgumentError("Animation not found: " + fromName);
 		var to:Animation = _skeletonData.findAnimation(toName);
-		if (to == null)
-			throw new ArgumentError("Animation not found: " + toName);
+		if (to == null) throw new ArgumentError("Animation not found: " + toName);
 		setMix(from, to, duration);
 	}
 
 	public function setMix (from:Animation, to:Animation, duration:Number) : void {
-		if (from == null)
-			throw new ArgumentError("from cannot be null.");
-		if (to == null)
-			throw new ArgumentError("to cannot be null.");
+		if (from == null) throw new ArgumentError("from cannot be null.");
+		if (to == null) throw new ArgumentError("to cannot be null.");
 		animationToMixTime[from.name + ":" + to.name] = duration;
 	}
 
 	public function getMix (from:Animation, to:Animation) : Number {
 		var time:Object = animationToMixTime[from.name + ":" + to.name];
-		if (time == null)
-			return defaultMix;
+		if (time == null) return defaultMix;
 		return time as Number;
 	}
 }

+ 47 - 49
spine-as3/spine-as3/src/spine/animation/CurveTimeline.as

@@ -35,78 +35,51 @@ import spine.Skeleton;
 /** Base class for frames that use an interpolation bezier curve. */
 public class CurveTimeline implements Timeline {
 	static private const LINEAR:Number = 0;
-	static private const STEPPED:Number = -1;
+	static private const STEPPED:Number = 1;
+	static private const BEZIER:Number = 2;
 	static private const BEZIER_SEGMENTS:int = 10;
+	static private const BEZIER_SIZE:int = BEZIER_SEGMENTS * 2 - 1;
 
-	private var curves:Vector.<Number>; // dfx, dfy, ddfx, ddfy, dddfx, dddfy, ...
+	private var curves:Vector.<Number>; // type, x, y, ...
 
 	public function CurveTimeline (frameCount:int) {
-		curves = new Vector.<Number>(frameCount * 6, true)
+		curves = new Vector.<Number>((frameCount - 1) * BEZIER_SIZE, true)
 	}
 
 	public function apply (skeleton:Skeleton, lastTime:Number, time:Number, firedEvents:Vector.<Event>, alpha:Number) : void {
 	}
 
 	public function get frameCount () : int {
-		return curves.length / 6;
+		return curves.length / BEZIER_SIZE + 1;
 	}
 
 	public function setLinear (frameIndex:int) : void {
-		curves[int(frameIndex * 6)] = LINEAR;
+		curves[int(frameIndex * BEZIER_SIZE)] = LINEAR;
 	}
 
 	public function setStepped (frameIndex:int) : void {
-		curves[int(frameIndex * 6)] = STEPPED;
+		curves[int(frameIndex * BEZIER_SIZE)] = STEPPED;
 	}
 
 	/** 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. */
 	public function setCurve (frameIndex:int, cx1:Number, cy1:Number, cx2:Number, cy2:Number) : void {
-		var subdiv_step:Number = 1 / BEZIER_SEGMENTS;
-		var subdiv_step2:Number = subdiv_step * subdiv_step;
-		var subdiv_step3:Number = subdiv_step2 * subdiv_step;
-		var pre1:Number = 3 * subdiv_step;
-		var pre2:Number = 3 * subdiv_step2;
-		var pre4:Number = 6 * subdiv_step2;
-		var pre5:Number = 6 * subdiv_step3;
-		var tmp1x:Number = -cx1 * 2 + cx2;
-		var tmp1y:Number = -cy1 * 2 + cy2;
-		var tmp2x:Number = (cx1 - cx2) * 3 + 1;
-		var tmp2y:Number = (cy1 - cy2) * 3 + 1;
-		var i:int = frameIndex * 6;
-		curves[i] = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;
-		curves[int(i + 1)] = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;
-		curves[int(i + 2)] = tmp1x * pre4 + tmp2x * pre5;
-		curves[int(i + 3)] = tmp1y * pre4 + tmp2y * pre5;
-		curves[int(i + 4)] = tmp2x * pre5;
-		curves[int(i + 5)] = tmp2y * pre5;
-	}
+		var subdiv1:Number = 1 / BEZIER_SEGMENTS, subdiv2:Number = subdiv1 * subdiv1, subdiv3:Number = subdiv2 * subdiv1;
+		var pre1:Number = 3 * subdiv1, pre2:Number = 3 * subdiv2, pre4:Number = 6 * subdiv2, pre5:Number = 6 * subdiv3;
+		var tmp1x:Number = -cx1 * 2 + cx2, tmp1y:Number = -cy1 * 2 + cy2, tmp2x:Number = (cx1 - cx2) * 3 + 1, tmp2y:Number = (cy1 - cy2) * 3 + 1;
+		var dfx:Number = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv3, dfy:Number = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv3;
+		var ddfx:Number = tmp1x * pre4 + tmp2x * pre5, ddfy:Number = tmp1y * pre4 + tmp2y * pre5;
+		var dddfx:Number = tmp2x * pre5, dddfy:Number = tmp2y * pre5;
 
-	public function getCurvePercent (frameIndex:int, percent:Number) : Number {
-		var curveIndex:int = frameIndex * 6;
-		var dfx:Number = curves[curveIndex];
-		if (dfx == LINEAR)
-			return percent;
-		if (dfx == STEPPED)
-			return 0;
-		var dfy:Number = curves[int(curveIndex + 1)];
-		var ddfx:Number = curves[int(curveIndex + 2)];
-		var ddfy:Number = curves[int(curveIndex + 3)];
-		var dddfx:Number = curves[int(curveIndex + 4)];
-		var dddfy:Number = curves[int(curveIndex + 5)];
-		var x:Number = dfx;
-		var y:Number = dfy;
-		var i:int = BEZIER_SEGMENTS - 2;
-		while (true) {
-			if (x >= percent) {
-				var prevX:Number = x - dfx;
-				var prevY:Number = y - dfy;
-				return prevY + (y - prevY) * (percent - prevX) / (x - prevX);
-			}
-			if (i == 0)
-				break;
-			i--;
+		var i:int = frameIndex * BEZIER_SIZE;
+		var curves:Vector.<Number> = this.curves;
+		curves[int(i++)] = BEZIER;
+
+		var x:Number = dfx, y:Number = dfy;
+		for (var n:int = i + BEZIER_SIZE - 1; i < n; i += 2) {
+			curves[i] = x;
+			curves[int(i + 1)] = y;
 			dfx += ddfx;
 			dfy += ddfy;
 			ddfx += dddfx;
@@ -114,6 +87,31 @@ public class CurveTimeline implements Timeline {
 			x += dfx;
 			y += dfy;
 		}
+	}
+
+	public function getCurvePercent (frameIndex:int, percent:Number) : Number {
+		var curves:Vector.<Number> = this.curves;
+		var i:int = frameIndex * BEZIER_SIZE;
+		var type:Number = curves[i];
+		if (type == LINEAR) return percent;
+		if (type == STEPPED) return 0;
+		i++;
+		var x:Number = 0;
+		for (var start:int = i, n:int = i + BEZIER_SIZE - 1; i < n; i += 2) {
+			x = curves[i];
+			if (x >= percent) {
+				var prevX:Number, prevY:Number;
+				if (i == start) {
+					prevX = 0;
+					prevY = 0;
+				} else {
+					prevX = curves[int(i - 2)];
+					prevY = curves[int(i - 1)];
+				}
+				return prevY + (curves[int(i + 1)] - prevY) * (percent - prevX) / (x - prevX);
+			}
+		}
+		var y:Number = curves[int(i - 1)];
 		return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.
 	}
 }

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

@@ -60,7 +60,7 @@ public class DrawOrderTimeline implements Timeline {
 		if (time >= frames[int(frames.length - 1)]) // Time is after last frame.
 			frameIndex = frames.length - 1;
 		else
-			frameIndex = Animation.binarySearch(frames, time, 1) - 1;
+			frameIndex = Animation.binarySearch1(frames, time) - 1;
 
 		var drawOrder:Vector.<Slot> = skeleton.drawOrder;
 		var slots:Vector.<Slot> = skeleton.slots;

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

@@ -67,7 +67,7 @@ public class EventTimeline implements Timeline {
 		if (lastTime < frames[0])
 			frameIndex = 0;
 		else {
-			frameIndex = Animation.binarySearch(frames, lastTime, 1);
+			frameIndex = Animation.binarySearch1(frames, lastTime);
 			var frame:Number = frames[frameIndex];
 			while (frameIndex > 0) { // Fire multiple events with the same frame.
 				if (frames[int(frameIndex - 1)] != frame) break;

+ 3 - 6
spine-as3/spine-as3/src/spine/animation/FfdTimeline.as

@@ -57,16 +57,13 @@ public class FfdTimeline extends CurveTimeline {
 		if (slot.attachment != attachment) return;
 
 		var frames:Vector.<Number> = this.frames;
-		if (time < frames[0]) {
-			slot.attachmentVertices.length = 0;
-			return; // Time is before first frame.
-		}
+		if (time < frames[0]) return; // Time is before first frame.
 
 		var frameVertices:Vector.<Vector.<Number>> = this.frameVertices;
 		var vertexCount:int = frameVertices[0].length;
 
 		var vertices:Vector.<Number> = slot.attachmentVertices;
-		if (vertices.length != vertexCount) alpha = 1;
+		if (vertices.length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.
 		vertices.length = vertexCount;
 
 		var i:int;
@@ -83,7 +80,7 @@ public class FfdTimeline extends CurveTimeline {
 		}
 
 		// Interpolate between the previous frame and the current frame.
-		var frameIndex:int = Animation.binarySearch(frames, time, 1);
+		var frameIndex:int = Animation.binarySearch1(frames, time);
 		var frameTime:Number = frames[frameIndex];
 		var percent:Number = 1 - (time - frameTime) / (frames[int(frameIndex - 1)] - frameTime);
 		percent = getCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));

+ 73 - 0
spine-as3/spine-as3/src/spine/animation/FlipXTimeline.as

@@ -0,0 +1,73 @@
+/******************************************************************************
+ * Spine Runtimes Software License
+ * Version 2.1
+ * 
+ * Copyright (c) 2013, Esoteric Software
+ * All rights reserved.
+ * 
+ * You are granted a perpetual, non-exclusive, non-sublicensable and
+ * non-transferable license to install, execute and perform the Spine Runtimes
+ * Software (the "Software") solely for internal use. Without the written
+ * permission of Esoteric Software (typically granted by licensing Spine), you
+ * may not (a) modify, translate, adapt or otherwise create derivative works,
+ * improvements of the Software or develop new applications using the Software
+ * or (b) remove, delete, alter or obscure any trademarks or any copyright,
+ * trademark, patent or other intellectual property or proprietary rights
+ * notices on or in the Software, including any copy thereof. Redistributions
+ * in binary or source form must include this license and terms.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package spine.animation {
+import spine.Bone;
+import spine.Event;
+import spine.Skeleton;
+
+public class FlipXTimeline implements Timeline {
+	public var boneIndex:int;
+	public var frames:Vector.<Number>; // time, flip, ...
+
+	public function FlipXTimeline (frameCount:int) {
+		frames = new Vector.<Number>(frameCount * 2, true);
+	}
+
+	public function get frameCount () : int {
+		return frames.length / 2;
+	}
+
+	/** Sets the time and angle of the specified keyframe. */
+	public function setFrame (frameIndex:int, time:Number, flip:Boolean) : void {
+		frameIndex *= 2;
+		frames[frameIndex] = time;
+		frames[int(frameIndex + 1)] = flip ? 1 : 0;
+	}
+
+	public function apply (skeleton:Skeleton, lastTime:Number, time:Number, firedEvents:Vector.<Event>, alpha:Number) : void {
+		if (time < frames[0]) {
+			if (lastTime > time) apply(skeleton, lastTime, int.MAX_VALUE, null, 0);
+			return;
+		} else if (lastTime > time) //
+			lastTime = -1;
+
+		var frameIndex:int = (time >= frames[frames.length - 2] ? frames.length : Animation.binarySearch(frames, time, 2)) - 2;
+		if (frames[frameIndex] < lastTime) return;
+
+		setFlip(skeleton.bones[boneIndex], frames[frameIndex + 1] != 0);
+	}
+
+	protected function setFlip (bone:Bone, flip:Boolean) : void {
+		bone.flipX = flip;
+	}
+}
+
+}

+ 44 - 0
spine-as3/spine-as3/src/spine/animation/FlipYTimeline.as

@@ -0,0 +1,44 @@
+/******************************************************************************
+ * Spine Runtimes Software License
+ * Version 2.1
+ * 
+ * Copyright (c) 2013, Esoteric Software
+ * All rights reserved.
+ * 
+ * You are granted a perpetual, non-exclusive, non-sublicensable and
+ * non-transferable license to install, execute and perform the Spine Runtimes
+ * Software (the "Software") solely for internal use. Without the written
+ * permission of Esoteric Software (typically granted by licensing Spine), you
+ * may not (a) modify, translate, adapt or otherwise create derivative works,
+ * improvements of the Software or develop new applications using the Software
+ * or (b) remove, delete, alter or obscure any trademarks or any copyright,
+ * trademark, patent or other intellectual property or proprietary rights
+ * notices on or in the Software, including any copy thereof. Redistributions
+ * in binary or source form must include this license and terms.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package spine.animation {
+import spine.Bone;
+
+public class FlipYTimeline extends FlipXTimeline {
+	public function FlipYTimeline (frameCount:int) {
+		super(frameCount);
+	}
+
+	override protected function setFlip (bone:Bone, flip:Boolean) : void {
+		bone.flipY = flip;
+	}
+}
+
+}

+ 82 - 0
spine-as3/spine-as3/src/spine/animation/IkConstraintTimeline.as

@@ -0,0 +1,82 @@
+/******************************************************************************
+ * Spine Runtimes Software License
+ * Version 2.1
+ * 
+ * Copyright (c) 2013, Esoteric Software
+ * All rights reserved.
+ * 
+ * You are granted a perpetual, non-exclusive, non-sublicensable and
+ * non-transferable license to install, execute and perform the Spine Runtimes
+ * Software (the "Software") solely for internal use. Without the written
+ * permission of Esoteric Software (typically granted by licensing Spine), you
+ * may not (a) modify, translate, adapt or otherwise create derivative works,
+ * improvements of the Software or develop new applications using the Software
+ * or (b) remove, delete, alter or obscure any trademarks or any copyright,
+ * trademark, patent or other intellectual property or proprietary rights
+ * notices on or in the Software, including any copy thereof. Redistributions
+ * in binary or source form must include this license and terms.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ * EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
+
+package spine.animation {
+import spine.Event;
+import spine.IkConstraint;
+import spine.Skeleton;
+
+public class IkConstraintTimeline extends CurveTimeline {
+	static private const PREV_FRAME_TIME:int = -3;
+	static private const PREV_FRAME_MIX:int = -2;
+	static private const PREV_FRAME_BEND_DIRECTION:int = -1;
+	static private const FRAME_MIX:int = 1;
+
+	public var ikConstraintIndex:int;
+	public var frames:Vector.<Number>; // time, mix, bendDirection, ...
+
+	public function IkConstraintTimeline (frameCount:int) {
+		super(frameCount);
+		frames = new Vector.<Number>(frameCount * 3, true);
+	}
+
+	/** Sets the time, mix and bend direction of the specified keyframe. */
+	public function setFrame (frameIndex:int, time:Number, mix:Number, bendDirection:int) : void {
+		frameIndex *= 3;
+		frames[frameIndex] = time;
+		frames[int(frameIndex + 1)] = mix;
+		frames[int(frameIndex + 2)] = bendDirection;
+	}
+
+	override public function apply (skeleton:Skeleton, lastTime:Number, time:Number, firedEvents:Vector.<Event>, alpha:Number) : void {
+		if (time < frames[0]) return; // Time is before first frame.
+
+		var ikConstraint:IkConstraint = skeleton.ikConstraints[ikConstraintIndex];
+
+		if (time >= frames[int(frames.length - 3)]) { // Time is after last frame.
+			ikConstraint.mix += (frames[int(frames.length - 2)] - ikConstraint.mix) * alpha;
+			ikConstraint.bendDirection = int(frames[int(frames.length - 1)]);
+			return;
+		}
+
+		// Interpolate between the previous frame and the current frame.
+		var frameIndex:int = Animation.binarySearch(frames, time, 3);
+		var prevFrameMix:Number = frames[int(frameIndex + PREV_FRAME_MIX)];
+		var frameTime:Number = frames[frameIndex];
+		var percent:Number = 1 - (time - frameTime) / (frames[int(frameIndex + PREV_FRAME_TIME)] - frameTime);
+		percent = getCurvePercent(frameIndex / 3 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
+
+		var mix:Number = prevFrameMix + (frames[int(frameIndex + FRAME_MIX)] - prevFrameMix) * percent;
+		ikConstraint.mix += (mix - ikConstraint.mix) * alpha;
+		ikConstraint.bendDirection = int(frames[int(frameIndex + PREV_FRAME_BEND_DIRECTION)]);
+	}
+}
+
+}

+ 4 - 1
spine-as3/spine-as3/src/spine/flash/SkeletonSprite.as

@@ -97,6 +97,7 @@ public class SkeletonSprite extends Sprite {
 					bitmap.rotation = -regionAttachment.rotation;
 					bitmap.scaleX = regionAttachment.scaleX * (regionAttachment.width / region.width);
 					bitmap.scaleY = regionAttachment.scaleY * (regionAttachment.height / region.height);
+					
 
 					// Position using attachment translation, shifted as if scale and rotation were at image center.
 					var radians:Number = -regionAttachment.rotation * Math.PI / 180;
@@ -127,10 +128,12 @@ public class SkeletonSprite extends Sprite {
 				colorTransform.alphaMultiplier = skeleton.a * slot.a * regionAttachment.a;
 				wrapper.transform.colorTransform = colorTransform;
 
+				var bone:Bone = slot.bone;
 				var flipX:int = skeleton.flipX ? -1 : 1;
 				var flipY:int = skeleton.flipY ? -1 : 1;
+				if (bone.worldFlipX) flipX = -flipX;
+				if (bone.worldFlipY) flipY = -flipY;
 
-				var bone:Bone = slot.bone;
 				wrapper.x = bone.worldX;
 				wrapper.y = bone.worldY;
 				wrapper.rotation = -bone.worldRotation * flipX * flipY;

+ 50 - 0
spine-c/Makefile

@@ -0,0 +1,50 @@
+LIBS = -lm
+CFLAGS = -Wall -I./include/
+
+SRC=$(wildcard src/spine/*.c)
+OBJ_FILES := $(addprefix obj/,$(notdir $(SRC:.c=.o)))
+STATIC_OBJ_FILES := $(addprefix obj/,$(notdir $(SRC:.c=-s.o)))
+DEBUG_OBJ_FILES := $(addprefix obj/,$(notdir $(SRC:.c=-d.o)))
+
+default:
+	@echo
+	@echo "- Options are (debug|release)-dynamic and release-static."
+	@echo "- Ex: release-static"
+	@echo
+
+release-dynamic: $(OBJ_FILES)
+	@mkdir -p dist
+	gcc -s -shared -Wl,-soname,libspine.so -o dist/libspine.so $(OBJ_FILES)
+	@echo
+	@echo - /dist/libspine.so
+	@echo
+
+debug-dynamic: $(DEBUG_OBJ_FILES)
+	@mkdir -p dist
+	gcc -g3 -shared -Wl,-soname,libspine.so -o dist/libspine-d.so $(DEBUG_OBJ_FILES)
+	@echo
+	@echo - /dist/libspine-d.so
+	@echo
+
+obj/%.o: src/spine/%.c
+	@mkdir -p obj
+	gcc -fPIC -c -o $@ $< $(CFLAGS) $(LIBS)
+
+obj/%-d.o: src/spine/%.c
+	@mkdir -p obj
+	gcc -fPIC -c -o $@ $< $(CFLAGS)
+
+release-static: $(STATIC_OBJ_FILES)
+	@mkdir -p dist
+	ar rcs dist/libspine-s.a $(STATIC_OBJ_FILES)
+	@echo
+	@echo - /dist/libspine-s.a
+	@echo
+
+obj/%-s.o: src/spine/%.c
+	@mkdir -p obj
+	gcc -c -o $@ $< $(CFLAGS) $(LIBS)
+
+clean:
+	rm -rf obj/*
+	rm -rf dist/*

+ 0 - 4
spine-c/README.md

@@ -11,10 +11,6 @@ Alternatively, the contents of the `spine-c/src` and `spine-c/include` directori
 
 If `SPINE_SHORT_NAMES` is defined, the `sp` prefix for all structs and functions is optional. Only use this if the spine-c names won't cause a conflict.
 
-## Examples
-
-[Loading data](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-c/example/main.c)
-
 ## Extension
 
 Extending spine-c requires implementing three methods:

+ 36 - 10
spine-c/include/spine/Animation.h

@@ -41,7 +41,7 @@ extern "C" {
 typedef struct spTimeline spTimeline;
 struct spSkeleton;
 
-typedef struct {
+typedef struct spAnimation {
 	const char* const name;
 	float duration;
 
@@ -84,7 +84,9 @@ typedef enum {
 	SP_TIMELINE_EVENT,
 	SP_TIMELINE_DRAWORDER,
 	SP_TIMELINE_FFD,
-	SP_TIMELINE_IKCONSTRAINT
+	SP_TIMELINE_IKCONSTRAINT,
+	SP_TIMELINE_FLIPX,
+	SP_TIMELINE_FLIPY
 } spTimelineType;
 
 struct spTimeline {
@@ -112,7 +114,7 @@ typedef spTimeline Timeline;
 
 /**/
 
-typedef struct {
+typedef struct spCurveTimeline {
 	spTimeline super;
 	float* curves; /* type, x, y, ... */
 } spCurveTimeline;
@@ -141,7 +143,11 @@ typedef struct spBaseTimeline {
 	int const framesCount;
 	float* const frames; /* time, angle, ... for rotate. time, x, y, ... for translate and scale. */
 	int boneIndex;
-} spRotateTimeline;
+} spBaseTimeline;
+
+/**/
+
+typedef struct spBaseTimeline spRotateTimeline;
 
 spRotateTimeline* spRotateTimeline_create (int framesCount);
 
@@ -183,7 +189,7 @@ typedef spScaleTimeline ScaleTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spColorTimeline {
 	spCurveTimeline super;
 	int const framesCount;
 	float* const frames; /* time, r, g, b, a, ... */
@@ -202,7 +208,7 @@ typedef spColorTimeline ColorTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spAttachmentTimeline {
 	spTimeline super;
 	int const framesCount;
 	float* const frames; /* time, ... */
@@ -223,7 +229,7 @@ typedef spAttachmentTimeline AttachmentTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spEventTimeline {
 	spTimeline super;
 	int const framesCount;
 	float* const frames; /* time, ... */
@@ -242,7 +248,7 @@ typedef spEventTimeline EventTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spDrawOrderTimeline {
 	spTimeline super;
 	int const framesCount;
 	float* const frames; /* time, ... */
@@ -262,7 +268,7 @@ typedef spDrawOrderTimeline DrawOrderTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spFFDTimeline {
 	spCurveTimeline super;
 	int const framesCount;
 	float* const frames; /* time, ... */
@@ -284,7 +290,7 @@ typedef spFFDTimeline FFDTimeline;
 
 /**/
 
-typedef struct {
+typedef struct spIkConstraintTimeline {
 	spCurveTimeline super;
 	int const framesCount;
 	float* const frames; /* time, mix, bendDirection, ... */
@@ -304,6 +310,26 @@ typedef spIkConstraintTimeline IkConstraintTimeline;
 
 /**/
 
+typedef struct spFlipTimeline {
+	spTimeline super;
+	int const x;
+	int const framesCount;
+	float* const frames; /* time, flip, ... */
+	int boneIndex;
+} spFlipTimeline;
+
+spFlipTimeline* spFlipTimeline_create (int framesCount, int/*bool*/x);
+
+void spFlipTimeline_setFrame (spFlipTimeline* self, int frameIndex, float time, int/*bool*/flip);
+
+#ifdef SPINE_SHORT_NAMES
+typedef spFlipTimeline FlipTimeline;
+#define FlipTimeline_create(...) spFlipTimeline_create(__VA_ARGS__)
+#define FlipTimeline_setFrame(...) spFlipTimeline_setFrame(__VA_ARGS__)
+#endif
+
+/**/
+
 #ifdef __cplusplus
 }
 #endif

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

@@ -38,7 +38,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spAnimationStateData {
 	spSkeletonData* const skeletonData;
 	float defaultMix;
 	const void* const entries;

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

@@ -38,7 +38,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spAtlasAttachmentLoader {
 	spAttachmentLoader super;
 	spAtlas* atlas;
 } spAtlasAttachmentLoader;

+ 2 - 5
spine-c/include/spine/Attachment.h

@@ -35,19 +35,16 @@
 extern "C" {
 #endif
 
-struct spSlot;
-
 typedef enum {
 	SP_ATTACHMENT_REGION, SP_ATTACHMENT_BOUNDING_BOX, SP_ATTACHMENT_MESH, SP_ATTACHMENT_SKINNED_MESH
 } spAttachmentType;
 
-typedef struct spAttachment spAttachment;
-struct spAttachment {
+typedef struct spAttachment {
 	const char* const name;
 	const spAttachmentType type;
 
 	const void* const vtable;
-};
+} spAttachment;
 
 void spAttachment_dispose (spAttachment* self);
 

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

@@ -38,8 +38,7 @@
 extern "C" {
 #endif
 
-typedef struct spAttachmentLoader spAttachmentLoader;
-struct spAttachmentLoader {
+typedef struct spAttachmentLoader {
 	const char* error1;
 	const char* error2;
 
@@ -51,7 +50,7 @@ struct spAttachmentLoader {
 					vtable(0) {
 	}
 #endif
-};
+} spAttachmentLoader;
 
 void spAttachmentLoader_dispose (spAttachmentLoader* self);
 

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

@@ -47,11 +47,13 @@ struct spBone {
 	float x, y;
 	float rotation, rotationIK;
 	float scaleX, scaleY;
+	int/*bool*/flipX, flipY;
 
 	float const m00, m01, worldX; /* a b x */
 	float const m10, m11, worldY; /* c d y */
 	float const worldRotation;
 	float const worldScaleX, worldScaleY;
+	int/*bool*/const worldFlipX, worldFlipY;
 };
 
 void spBone_setYDown (int/*bool*/yDown);

+ 1 - 0
spine-c/include/spine/BoneData.h

@@ -43,6 +43,7 @@ struct spBoneData {
 	float x, y;
 	float rotation;
 	float scaleX, scaleY;
+	int/*bool*/flipX, flipY;
 	int/*bool*/inheritScale, inheritRotation;
 };
 

+ 2 - 3
spine-c/include/spine/BoundingBoxAttachment.h

@@ -39,12 +39,11 @@
 extern "C" {
 #endif
 
-typedef struct spBoundingBoxAttachment spBoundingBoxAttachment;
-struct spBoundingBoxAttachment {
+typedef struct spBoundingBoxAttachment {
 	spAttachment super;
 	int verticesCount;
 	float* vertices;
-};
+} spBoundingBoxAttachment;
 
 spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name);
 void spBoundingBoxAttachment_computeWorldVertices (spBoundingBoxAttachment* self, spBone* bone, float* vertices);

+ 2 - 3
spine-c/include/spine/Event.h

@@ -37,13 +37,12 @@
 extern "C" {
 #endif
 
-typedef struct spEvent spEvent;
-struct spEvent {
+typedef struct spEvent {
 	spEventData* const data;
 	int intValue;
 	float floatValue;
 	const char* stringValue;
-};
+} spEvent;
 
 spEvent* spEvent_create (spEventData* data);
 void spEvent_dispose (spEvent* self);

+ 2 - 3
spine-c/include/spine/EventData.h

@@ -35,13 +35,12 @@
 extern "C" {
 #endif
 
-typedef struct spEventData spEventData;
-struct spEventData {
+typedef struct spEventData {
 	const char* const name;
 	int intValue;
 	float floatValue;
 	const char* stringValue;
-};
+} spEventData;
 
 spEventData* spEventData_create (const char* name);
 void spEventData_dispose (spEventData* self);

+ 2 - 3
spine-c/include/spine/IkConstraint.h

@@ -40,8 +40,7 @@ extern "C" {
 
 struct spSkeleton;
 
-typedef struct spIkConstraint spIkConstraint;
-struct spIkConstraint {
+typedef struct spIkConstraint {
 	spIkConstraintData* const data;
 	
 	int bonesCount;
@@ -50,7 +49,7 @@ struct spIkConstraint {
 	spBone* target;
 	int bendDirection;
 	float mix;
-};
+} spIkConstraint;
 
 spIkConstraint* spIkConstraint_create (spIkConstraintData* data, const struct spSkeleton* skeleton);
 void spIkConstraint_dispose (spIkConstraint* self);

+ 2 - 3
spine-c/include/spine/IkConstraintData.h

@@ -37,8 +37,7 @@
 extern "C" {
 #endif
 
-typedef struct spIkConstraintData spIkConstraintData;
-struct spIkConstraintData {
+typedef struct spIkConstraintData {
 	const char* const name;
 	
 	int bonesCount;
@@ -47,7 +46,7 @@ struct spIkConstraintData {
 	spBoneData* target;
 	int bendDirection;
 	float mix;
-};
+} spIkConstraintData;
 
 spIkConstraintData* spIkConstraintData_create (const char* name);
 void spIkConstraintData_dispose (spIkConstraintData* self);

+ 2 - 3
spine-c/include/spine/MeshAttachment.h

@@ -39,8 +39,7 @@
 extern "C" {
 #endif
 
-typedef struct spMeshAttachment spMeshAttachment;
-struct spMeshAttachment {
+typedef struct spMeshAttachment {
 	spAttachment super;
 	const char* path;
 
@@ -67,7 +66,7 @@ struct spMeshAttachment {
 	int edgesCount;
 	int* edges;
 	float width, height;
-};
+} spMeshAttachment;
 
 spMeshAttachment* spMeshAttachment_create (const char* name);
 void spMeshAttachment_updateUVs (spMeshAttachment* self);

+ 2 - 3
spine-c/include/spine/RegionAttachment.h

@@ -43,8 +43,7 @@ typedef enum {
 	SP_VERTEX_X1 = 0, SP_VERTEX_Y1, SP_VERTEX_X2, SP_VERTEX_Y2, SP_VERTEX_X3, SP_VERTEX_Y3, SP_VERTEX_X4, SP_VERTEX_Y4
 } spVertexIndex;
 
-typedef struct spRegionAttachment spRegionAttachment;
-struct spRegionAttachment {
+typedef struct spRegionAttachment {
 	spAttachment super;
 	const char* path;
 	float x, y, scaleX, scaleY, rotation, width, height;
@@ -57,7 +56,7 @@ struct spRegionAttachment {
 
 	float offset[8];
 	float uvs[8];
-};
+} spRegionAttachment;
 
 spRegionAttachment* spRegionAttachment_create (const char* name);
 void spRegionAttachment_setUVs (spRegionAttachment* self, float u, float v, float u2, float v2, int/*bool*/rotate);

+ 5 - 5
spine-c/include/spine/Skeleton.h

@@ -40,8 +40,7 @@
 extern "C" {
 #endif
 
-typedef struct spSkeleton spSkeleton;
-struct spSkeleton {
+typedef struct spSkeleton {
 	spSkeletonData* const data;
 
 	int bonesCount;
@@ -60,7 +59,7 @@ struct spSkeleton {
 	float time;
 	int/*bool*/flipX, flipY;
 	float x, y;
-};
+} spSkeleton;
 
 spSkeleton* spSkeleton_create (spSkeletonData* data);
 void spSkeleton_dispose (spSkeleton* self);
@@ -83,8 +82,9 @@ spSlot* spSkeleton_findSlot (const spSkeleton* self, const char* slotName);
 /* Returns -1 if the slot was not found. */
 int spSkeleton_findSlotIndex (const spSkeleton* self, const char* slotName);
 
-/* 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.
+/* Sets the skin used to look up attachments before looking in the SkeletonData defaultSkin. Attachments from the new skin are
+ * attached if the corresponding attachment from the old skin was attached. If there was no old skin, each slot's setup mode
+ * attachment is attached from the new skin.
  * @param skin May be 0.*/
 void spSkeleton_setSkin (spSkeleton* self, spSkin* skin);
 /* Returns 0 if the skin was not found. See spSkeleton_setSkin.

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

@@ -38,7 +38,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spPolygon {
 	float* const vertices;
 	int count;
 	int capacity;
@@ -60,7 +60,7 @@ typedef spPolygon Polygon;
 
 /**/
 
-typedef struct {
+typedef struct spSkeletonBounds {
 	int count;
 	spBoundingBoxAttachment** boundingBoxes;
 	spPolygon** polygons;

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

@@ -42,7 +42,7 @@
 extern "C" {
 #endif
 
-typedef struct spSkeletonData{
+typedef struct spSkeletonData {
 	const char* version;
 	const char* hash;
 	float width, height;

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

@@ -41,7 +41,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spSkeletonJson {
 	float scale;
 	spAttachmentLoader* attachmentLoader;
 	const char* const error;

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

@@ -39,7 +39,7 @@ extern "C" {
 
 struct spSkeleton;
 
-typedef struct {
+typedef struct spSkin {
 	const char* const name;
 } spSkin;
 

+ 2 - 3
spine-c/include/spine/SkinnedMeshAttachment.h

@@ -38,8 +38,7 @@
 extern "C" {
 #endif
 
-typedef struct spSkinnedMeshAttachment spSkinnedMeshAttachment;
-struct spSkinnedMeshAttachment {
+typedef struct spSkinnedMeshAttachment {
 	spAttachment super;
 	const char* path;
 
@@ -70,7 +69,7 @@ struct spSkinnedMeshAttachment {
 	int edgesCount;
 	int* edges;
 	float width, height;
-};
+} spSkinnedMeshAttachment;
 
 spSkinnedMeshAttachment* spSkinnedMeshAttachment_create (const char* name);
 void spSkinnedMeshAttachment_updateUVs (spSkinnedMeshAttachment* self);

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

@@ -37,7 +37,7 @@
 extern "C" {
 #endif
 
-typedef struct {
+typedef struct spSlotData {
 	const char* const name;
 	const spBoneData* const boneData;
 	const char* attachmentName;

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

@@ -124,7 +124,7 @@ char* _readFile (const char* path, int* length);
 
 /**/
 
-typedef struct {
+typedef struct _spAnimationState {
 	spAnimationState super;
 	spEvent** events;
 

+ 53 - 8
spine-c/src/spine/Animation.c

@@ -602,7 +602,7 @@ void _spDrawOrderTimeline_apply (const spTimeline* timeline, spSkeleton* skeleto
 
 	drawOrderToSetupIndex = self->drawOrders[frameIndex];
 	if (!drawOrderToSetupIndex)
-		memcpy(skeleton->drawOrder, skeleton->slots, self->slotsCount * sizeof(int));
+		memcpy(skeleton->drawOrder, skeleton->slots, self->slotsCount * sizeof(spSlot*));
 	else {
 		for (i = 0; i < self->slotsCount; ++i)
 			skeleton->drawOrder[i] = skeleton->slots[drawOrderToSetupIndex[i]];
@@ -659,20 +659,17 @@ void _spFFDTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, flo
 	spSlot *slot = skeleton->slots[self->slotIndex];
 	if (slot->attachment != self->attachment) return;
 
-	if (time < self->frames[0]) {
-		slot->attachmentVerticesCount = 0;
-		return; /* Time is before first frame. */
-	}
+	if (time < self->frames[0]) return; /* Time is before first frame. */
 
-	if (slot->attachmentVerticesCount == 0) alpha = 1;
 	if (slot->attachmentVerticesCount < self->frameVerticesCount) {
 		if (slot->attachmentVerticesCapacity < self->frameVerticesCount) {
 			FREE(slot->attachmentVertices);
 			slot->attachmentVertices = MALLOC(float, self->frameVerticesCount);
 			slot->attachmentVerticesCapacity = self->frameVerticesCount;
 		}
-		slot->attachmentVerticesCount = self->frameVerticesCount;
-	}
+	} else if (slot->attachmentVerticesCount > self->frameVerticesCount)
+		alpha = 1; /* Don't mix from uninitialized slot vertices. */
+	slot->attachmentVerticesCount = self->frameVerticesCount;
 
 	if (time >= self->frames[self->framesCount - 1]) {
 		/* Time is after last frame. */
@@ -789,3 +786,51 @@ void spIkConstraintTimeline_setFrame (spIkConstraintTimeline* self, int frameInd
 	self->frames[frameIndex + 1] = mix;
 	self->frames[frameIndex + 2] = (float)bendDirection;
 }
+
+/**/
+
+void _spFlipTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,
+		spEvent** firedEvents, int* eventsCount, float alpha) {
+	int frameIndex;
+	spFlipTimeline* self = (spFlipTimeline*)timeline;
+
+	if (time < self->frames[0]) {
+		if (lastTime > time) _spFlipTimeline_apply(timeline, skeleton, lastTime, (float)INT_MAX, 0, 0, 0);
+		return;
+	} else if (lastTime > time) /**/
+		lastTime = -1;
+
+	frameIndex = (time >= self->frames[self->framesCount - 2] ?
+		self->framesCount : binarySearch(self->frames, self->framesCount, time, 2)) - 2;
+	if (self->frames[frameIndex] < lastTime) return;
+
+	if (self->x)
+		skeleton->bones[self->boneIndex]->flipX = (int)self->frames[frameIndex + 1];
+	else
+		skeleton->bones[self->boneIndex]->flipY = (int)self->frames[frameIndex + 1];
+}
+
+void _spFlipTimeline_dispose (spTimeline* timeline) {
+	spFlipTimeline* self = SUB_CAST(spFlipTimeline, timeline);
+	_spTimeline_deinit(SUPER(self));
+	FREE(self->frames);
+	FREE(self);
+}
+
+spFlipTimeline* spFlipTimeline_create (int framesCount, int/*bool*/x) {
+	spFlipTimeline* self = NEW(spFlipTimeline);
+	_spTimeline_init(SUPER(self), x ? SP_TIMELINE_FLIPX : SP_TIMELINE_FLIPY, _spFlipTimeline_dispose, _spFlipTimeline_apply);
+	CONST_CAST(int, self->x) = x;
+	CONST_CAST(int, self->framesCount) = framesCount << 1;
+	CONST_CAST(float*, self->frames) = CALLOC(float, self->framesCount);
+	return self;
+}
+
+void spFlipTimeline_setFrame (spFlipTimeline* self, int frameIndex, float time, int/*bool*/flip) {
+	frameIndex <<= 1;
+	self->frames[frameIndex] = time;
+	self->frames[frameIndex + 1] = (float)flip;
+}
+
+/**/
+

+ 5 - 5
spine-c/src/spine/Atlas.c

@@ -137,7 +137,7 @@ static int readTuple (const char* end, Str tuple[]) {
 }
 
 static char* mallocString (Str* str) {
-	int length = str->end - str->begin;
+	int length = (int)(str->end - str->begin);
 	char* string = MALLOC(char, length + 1);
 	memcpy(string, str->begin, length);
 	string[length] = '\0';
@@ -145,7 +145,7 @@ static char* mallocString (Str* str) {
 }
 
 static int indexOf (const char** array, int count, Str* str) {
-	int length = str->end - str->begin;
+	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;
@@ -157,7 +157,7 @@ static int equals (Str* str, const char* other) {
 }
 
 static int toInt (Str* str) {
-	return strtol(str->begin, (char**)&str->end, 10);
+	return (int)strtol(str->begin, (char**)&str->end, 10);
 }
 
 static spAtlas* abortAtlas (spAtlas* self) {
@@ -174,7 +174,7 @@ spAtlas* spAtlas_create (const char* begin, int length, const char* dir, void* r
 
 	int count;
 	const char* end = begin + length;
-	int dirLength = strlen(dir);
+	int dirLength = (int)strlen(dir);
 	int needsSlash = dirLength > 0 && dir[dirLength - 1] != '/' && dir[dirLength - 1] != '\\';
 
 	spAtlasPage *page = 0;
@@ -307,7 +307,7 @@ spAtlas* spAtlas_createFromFile (const char* path, void* rendererObject) {
 	const char* lastBackwardSlash = strrchr(path, '\\');
 	const char* lastSlash = lastForwardSlash > lastBackwardSlash ? lastForwardSlash : lastBackwardSlash;
 	if (lastSlash == path) lastSlash++; /* Never drop starting slash. */
-	dirLength = lastSlash ? lastSlash - path : 0;
+	dirLength = (int)(lastSlash ? lastSlash - path : 0);
 	dir = MALLOC(char, dirLength + 1);
 	memcpy(dir, path, dirLength);
 	dir[dirLength] = '\0';

+ 10 - 3
spine-c/src/spine/Bone.c

@@ -64,24 +64,29 @@ void spBone_updateWorldTransform (spBone* self) {
 		}
 		CONST_CAST(float, self->worldRotation) =
 				self->data->inheritRotation ? self->parent->worldRotation + self->rotationIK : self->rotationIK;
+		CONST_CAST(int, self->worldFlipX) = self->parent->worldFlipX ^ self->flipX;
+		CONST_CAST(int, self->worldFlipY) = self->parent->worldFlipY ^ self->flipY;
 	} else {
+		int skeletonFlipX = self->skeleton->flipX, skeletonFlipY = self->skeleton->flipY;
 		CONST_CAST(float, self->worldX) = self->skeleton->flipX ? -self->x : self->x;
 		CONST_CAST(float, self->worldY) = self->skeleton->flipY != yDown ? -self->y : self->y;
 		CONST_CAST(float, self->worldScaleX) = self->scaleX;
 		CONST_CAST(float, self->worldScaleY) = self->scaleY;
 		CONST_CAST(float, self->worldRotation) = self->rotationIK;
+		CONST_CAST(int, self->worldFlipX) = skeletonFlipX ^ self->flipX;
+		CONST_CAST(int, self->worldFlipY) = skeletonFlipY ^ self->flipY;
 	}
 	radians = self->worldRotation * DEG_RAD;
 	cosine = COS(radians);
 	sine = SIN(radians);
-	if (self->skeleton->flipX) {
+	if (self->worldFlipX) {
 		CONST_CAST(float, self->m00) = -cosine * self->worldScaleX;
 		CONST_CAST(float, self->m01) = sine * self->worldScaleY;
 	} else {
 		CONST_CAST(float, self->m00) = cosine * self->worldScaleX;
 		CONST_CAST(float, self->m01) = -sine * self->worldScaleY;
 	}
-	if (self->skeleton->flipY != yDown) {
+	if (self->worldFlipY != yDown) {
 		CONST_CAST(float, self->m10) = -sine * self->worldScaleX;
 		CONST_CAST(float, self->m11) = -cosine * self->worldScaleY;
 	} else {
@@ -97,13 +102,15 @@ void spBone_setToSetupPose (spBone* self) {
 	self->rotationIK = self->rotation;
 	self->scaleX = self->data->scaleX;
 	self->scaleY = self->data->scaleY;
+	self->flipX = self->data->flipX;
+	self->flipY = self->data->flipY;
 }
 
 void spBone_worldToLocal (spBone* self, float worldX, float worldY, float* localX, float* localY) {
 	float invDet;
 	float dx = worldX - self->worldX, dy = worldY - self->worldY;
 	float m00 = self->m00, m11 = self->m11;
-	if (self->skeleton->flipX != (self->skeleton->flipY != yDown)) {
+	if (self->worldFlipX != (self->worldFlipY != yDown)) {
 		m00 *= -1;
 		m11 *= -1;
 	}

+ 3 - 0
spine-c/src/spine/SkeletonData.c

@@ -62,6 +62,9 @@ void spSkeletonData_dispose (spSkeletonData* self) {
 		spIkConstraintData_dispose(self->ikConstraints[i]);
 	FREE(self->ikConstraints);
 
+	FREE(self->hash);
+	FREE(self->version);
+
 	FREE(self);
 }
 

+ 25 - 7
spine-c/src/spine/SkeletonJson.c

@@ -64,7 +64,7 @@ void _spSkeletonJson_setError (spSkeletonJson* self, Json* root, const char* val
 	int length;
 	FREE(self->error);
 	strcpy(message, value1);
-	length = strlen(value1);
+	length = (int)strlen(value1);
 	if (value2) strncat(message + length, value2, 256 - length);
 	MALLOC_STR(self->error, message);
 	if (root) Json_dispose(root);
@@ -81,7 +81,7 @@ static float toColor (const char* value, int index) {
 	digits[0] = *value;
 	digits[1] = *(value + 1);
 	digits[2] = '\0';
-	color = strtoul(digits, &error, 16);
+	color = (int)strtoul(digits, &error, 16);
 	if (*error != 0) return -1;
 	return color / (float)255;
 }
@@ -106,16 +106,19 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
 	spAnimation* animation;
 	Json* frame;
 	float duration;
+	int timelinesCount = 0;
 
 	Json* bones = Json_getItem(root, "bones");
 	Json* slots = Json_getItem(root, "slots");
 	Json* ik = Json_getItem(root, "ik");
 	Json* ffd = Json_getItem(root, "ffd");
-	Json* drawOrder = Json_getItem(root, "draworder");
+	Json* drawOrder = Json_getItem(root, "drawOrder");
 	Json* events = Json_getItem(root, "events");
+	Json* flipX = Json_getItem(root, "flipx");
+	Json* flipY = Json_getItem(root, "flipy");
 	Json *boneMap, *slotMap, *ikMap, *ffdMap;
+	if (!drawOrder) drawOrder = Json_getItem(root, "draworder");
 
-	int timelinesCount = 0;
 	for (boneMap = bones ? bones->child : 0; boneMap; boneMap = boneMap->next)
 		timelinesCount += boneMap->size;
 	for (slotMap = slots ? slots->child : 0; slotMap; slotMap = slotMap->next)
@@ -124,8 +127,10 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
 	for (ffdMap = ffd ? ffd->child : 0; ffdMap; ffdMap = ffdMap->next)
 		for (slotMap = ffdMap->child; slotMap; slotMap = slotMap->next)
 			timelinesCount += slotMap->size;
-	if (events) ++timelinesCount;
 	if (drawOrder) ++timelinesCount;
+	if (events) ++timelinesCount;
+	if (flipX) ++timelinesCount;
+	if (flipY) ++timelinesCount;
 
 	animation = spAnimation_create(root->name, timelinesCount);
 	animation->timelinesCount = 0;
@@ -214,6 +219,17 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
 					animation->timelines[animation->timelinesCount++] = SUPER_CAST(spTimeline, timeline);
 					duration = timeline->frames[timelineArray->size * 3 - 3];
 					if (duration > animation->duration) animation->duration = duration;
+				} else if (strcmp(timelineArray->name, "flipX") == 0 || strcmp(timelineArray->name, "flipY") == 0) {
+					int x = strcmp(timelineArray->name, "flipX") == 0;
+					const char* field = x ? "x" : "y";
+					spFlipTimeline *timeline = spFlipTimeline_create(timelineArray->size, x);
+					timeline->boneIndex = boneIndex;
+					for (frame = timelineArray->child, i = 0; frame; frame = frame->next, ++i)
+						spFlipTimeline_setFrame(timeline, i, Json_getFloat(frame, "time", 0), Json_getInt(frame, field, 0));
+					animation->timelines[animation->timelinesCount++] = SUPER_CAST(spTimeline, timeline);
+					duration = timeline->frames[timelineArray->size * 2 - 2];
+					if (duration > animation->duration) animation->duration = duration;
+
 				} else {
 					spAnimation_dispose(animation);
 					_spSkeletonJson_setError(self, 0, "Invalid timeline type for a bone: ", timelineArray->name);
@@ -418,8 +434,8 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 
 	skeleton = Json_getItem(root, "skeleton");
 	if (skeleton) {
-		skeletonData->hash = Json_getString(skeleton, "hash", 0);
-		skeletonData->version = Json_getString(skeleton, "spine", 0);
+		MALLOC_STR(skeletonData->hash, Json_getString(skeleton, "hash", 0));
+		MALLOC_STR(skeletonData->version,  Json_getString(skeleton, "spine", 0));
 		skeletonData->width = Json_getFloat(skeleton, "width", 0);
 		skeletonData->height = Json_getFloat(skeleton, "height", 0);
 	}
@@ -450,6 +466,8 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 		boneData->scaleY = Json_getFloat(boneMap, "scaleY", 1);
 		boneData->inheritScale = Json_getInt(boneMap, "inheritScale", 1);
 		boneData->inheritRotation = Json_getInt(boneMap, "inheritRotation", 1);
+		boneData->flipX = Json_getInt(boneMap, "flipX", 0);
+		boneData->flipY = Json_getInt(boneMap, "flipY", 0);
 
 		skeletonData->bones[i] = boneData;
 		skeletonData->bonesCount++;

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

@@ -67,7 +67,7 @@ char* _readFile (const char* path, int* length) {
 	if (!file) return 0;
 
 	fseek(file, 0, SEEK_END);
-	*length = ftell(file);
+	*length = (int)ftell(file);
 	fseek(file, 0, SEEK_SET);
 
 	data = MALLOC(char, *length);

+ 1 - 1
spine-as3/spine-as3-example/src/goblins-ffd.atlas → spine-cocos2d-iphone/2/Resources/goblins-mesh.atlas

@@ -1,5 +1,5 @@
 
-goblins-ffd.png
+goblins-mesh.png
 format: RGBA8888
 filter: Linear,Linear
 repeat: none

+ 0 - 0
spine-cocos2d-iphone/2/Resources/goblins-ffd.json → spine-cocos2d-iphone/2/Resources/goblins-mesh.json


+ 0 - 0
spine-cocos2d-iphone/2/Resources/goblins-ffd.png → spine-cocos2d-iphone/2/Resources/goblins-mesh.png


+ 1 - 1
spine-cocos2d-iphone/2/example/GoblinsExample.m

@@ -14,7 +14,7 @@
 	self = [super initWithColor:ccc4(128, 128, 128, 255)];
 	if (!self) return nil;
 
-	skeletonNode = [SkeletonAnimation skeletonWithFile:@"goblins-ffd.json" atlasFile:@"goblins-ffd.atlas" scale:1];
+	skeletonNode = [SkeletonAnimation skeletonWithFile:@"goblins-mesh.json" atlasFile:@"goblins-mesh.atlas" scale:1];
 	[skeletonNode setSkin:@"goblin"];
 	[skeletonNode setAnimationForTrack:0 name:@"walk" loop:YES];
 

+ 66 - 19
spine-cocos2d-iphone/2/spine-cocos2d-iphone-ios.xcodeproj/project.pbxproj

@@ -7,7 +7,12 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
-		434D47F1192A2480003127B5 /* libcocos2d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 434D47E2192A246B003127B5 /* libcocos2d.a */; };
+		4327E30419E9879C007E7FB7 /* IkConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 4327E30219E9879C007E7FB7 /* IkConstraint.c */; };
+		4327E30519E9879C007E7FB7 /* IkConstraintData.c in Sources */ = {isa = PBXBuildFile; fileRef = 4327E30319E9879C007E7FB7 /* IkConstraintData.c */; };
+		4327E30619E98913007E7FB7 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 652107951895250000B1FF07 /* CoreText.framework */; };
+		4327E30919E98977007E7FB7 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4327E30819E98977007E7FB7 /* GLKit.framework */; };
+		4327E30A19E989A3007E7FB7 /* libcocos2d_chipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 434D47E6192A246B003127B5 /* libcocos2d_chipmunk.a */; };
+		4327E30B19E98A32007E7FB7 /* libChipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 434D47E0192A246B003127B5 /* libChipmunk.a */; };
 		43C3282F170B0C19004A9460 /* spine-cocos2d-iphone.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C3282D170B0C19004A9460 /* spine-cocos2d-iphone.m */; };
 		43C3286C170B0DA6004A9460 /* spineboy.json in Resources */ = {isa = PBXBuildFile; fileRef = 43C32868170B0DA6004A9460 /* spineboy.json */; };
 		43C3286E170B0DA6004A9460 /* spineboy.atlas in Resources */ = {isa = PBXBuildFile; fileRef = 43C3286A170B0DA6004A9460 /* spineboy.atlas */; };
@@ -25,9 +30,9 @@
 		43C32888170B0DBE004A9460 /* iTunesArtwork in Resources */ = {isa = PBXBuildFile; fileRef = 43C3287C170B0DBE004A9460 /* iTunesArtwork */; };
 		43C32A06170B0F93004A9460 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C32A05170B0F93004A9460 /* main.m */; };
 		43C32A09170B10FF004A9460 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C32A08170B10FF004A9460 /* AppDelegate.m */; };
-		43F7010F1927FBC700CA4038 /* goblins-ffd.atlas in Resources */ = {isa = PBXBuildFile; fileRef = 43F7010C1927FBC700CA4038 /* goblins-ffd.atlas */; };
-		43F701101927FBC700CA4038 /* goblins-ffd.json in Resources */ = {isa = PBXBuildFile; fileRef = 43F7010D1927FBC700CA4038 /* goblins-ffd.json */; };
-		43F701111927FBC700CA4038 /* goblins-ffd.png in Resources */ = {isa = PBXBuildFile; fileRef = 43F7010E1927FBC700CA4038 /* goblins-ffd.png */; };
+		43F7010F1927FBC700CA4038 /* goblins-mesh.atlas in Resources */ = {isa = PBXBuildFile; fileRef = 43F7010C1927FBC700CA4038 /* goblins-mesh.atlas */; };
+		43F701101927FBC700CA4038 /* goblins-mesh.json in Resources */ = {isa = PBXBuildFile; fileRef = 43F7010D1927FBC700CA4038 /* goblins-mesh.json */; };
+		43F701111927FBC700CA4038 /* goblins-mesh.png in Resources */ = {isa = PBXBuildFile; fileRef = 43F7010E1927FBC700CA4038 /* goblins-mesh.png */; };
 		43F7FF511927F91900CA4038 /* Animation.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FF381927F91900CA4038 /* Animation.c */; };
 		43F7FF521927F91900CA4038 /* AnimationState.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FF391927F91900CA4038 /* AnimationState.c */; };
 		43F7FF531927F91900CA4038 /* AnimationStateData.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FF3A1927F91900CA4038 /* AnimationStateData.c */; };
@@ -57,7 +62,6 @@
 		43F7FF891927F94800CA4038 /* SkeletonRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FF861927F94800CA4038 /* SkeletonRenderer.m */; };
 		43F7FF8E1927F96700CA4038 /* GoblinsExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FF8B1927F96700CA4038 /* GoblinsExample.m */; };
 		43F7FF8F1927F96700CA4038 /* SpineboyExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FF8D1927F96700CA4038 /* SpineboyExample.m */; };
-		652107961895250000B1FF07 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 652107951895250000B1FF07 /* CoreText.framework */; };
 		9A5D2499170A94DA0030D4DD /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A5D2498170A94DA0030D4DD /* QuartzCore.framework */; };
 		9A5D249B170A94DA0030D4DD /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A5D249A170A94DA0030D4DD /* OpenGLES.framework */; };
 		9A5D249D170A94DA0030D4DD /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A5D249C170A94DA0030D4DD /* OpenAL.framework */; };
@@ -150,6 +154,11 @@
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
+		4327E30019E9879C007E7FB7 /* IkConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IkConstraint.h; path = "../../spine-c/include/spine/IkConstraint.h"; sourceTree = "<group>"; };
+		4327E30119E9879C007E7FB7 /* IkConstraintData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IkConstraintData.h; path = "../../spine-c/include/spine/IkConstraintData.h"; sourceTree = "<group>"; };
+		4327E30219E9879C007E7FB7 /* IkConstraint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = IkConstraint.c; path = "../../spine-c/src/spine/IkConstraint.c"; sourceTree = "<group>"; };
+		4327E30319E9879C007E7FB7 /* IkConstraintData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = IkConstraintData.c; path = "../../spine-c/src/spine/IkConstraintData.c"; sourceTree = "<group>"; };
+		4327E30819E98977007E7FB7 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
 		434D47CA192A246A003127B5 /* cocos2d-ios.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "cocos2d-ios.xcodeproj"; path = "cocos2d/cocos2d-ios.xcodeproj"; sourceTree = SOURCE_ROOT; };
 		43C3282D170B0C19004A9460 /* spine-cocos2d-iphone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "spine-cocos2d-iphone.m"; path = "src/spine/spine-cocos2d-iphone.m"; sourceTree = "<group>"; };
 		43C3282E170B0C19004A9460 /* spine-cocos2d-iphone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "spine-cocos2d-iphone.h"; path = "src/spine/spine-cocos2d-iphone.h"; sourceTree = "<group>"; };
@@ -172,9 +181,9 @@
 		43C32A05170B0F93004A9460 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = "Resources-ios/main.m"; sourceTree = "<group>"; };
 		43C32A07170B10FF004A9460 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = "Resources-ios/AppDelegate.h"; sourceTree = "<group>"; };
 		43C32A08170B10FF004A9460 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = "Resources-ios/AppDelegate.m"; sourceTree = "<group>"; };
-		43F7010C1927FBC700CA4038 /* goblins-ffd.atlas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "goblins-ffd.atlas"; path = "Resources/goblins-ffd.atlas"; sourceTree = "<group>"; };
-		43F7010D1927FBC700CA4038 /* goblins-ffd.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "goblins-ffd.json"; path = "Resources/goblins-ffd.json"; sourceTree = "<group>"; };
-		43F7010E1927FBC700CA4038 /* goblins-ffd.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "goblins-ffd.png"; path = "Resources/goblins-ffd.png"; sourceTree = "<group>"; };
+		43F7010C1927FBC700CA4038 /* goblins-mesh.atlas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "goblins-mesh.atlas"; path = "Resources/goblins-mesh.atlas"; sourceTree = "<group>"; };
+		43F7010D1927FBC700CA4038 /* goblins-mesh.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "goblins-mesh.json"; path = "Resources/goblins-mesh.json"; sourceTree = "<group>"; };
+		43F7010E1927FBC700CA4038 /* goblins-mesh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "goblins-mesh.png"; path = "Resources/goblins-mesh.png"; sourceTree = "<group>"; };
 		43F7FF381927F91900CA4038 /* Animation.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Animation.c; path = "../../spine-c/src/spine/Animation.c"; sourceTree = "<group>"; };
 		43F7FF391927F91900CA4038 /* AnimationState.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AnimationState.c; path = "../../spine-c/src/spine/AnimationState.c"; sourceTree = "<group>"; };
 		43F7FF3A1927F91900CA4038 /* AnimationStateData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AnimationStateData.c; path = "../../spine-c/src/spine/AnimationStateData.c"; sourceTree = "<group>"; };
@@ -252,8 +261,10 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				434D47F1192A2480003127B5 /* libcocos2d.a in Frameworks */,
-				652107961895250000B1FF07 /* CoreText.framework in Frameworks */,
+				4327E30A19E989A3007E7FB7 /* libcocos2d_chipmunk.a in Frameworks */,
+				4327E30B19E98A32007E7FB7 /* libChipmunk.a in Frameworks */,
+				4327E30919E98977007E7FB7 /* GLKit.framework in Frameworks */,
+				4327E30619E98913007E7FB7 /* CoreText.framework in Frameworks */,
 				9A5D2499170A94DA0030D4DD /* QuartzCore.framework in Frameworks */,
 				9A5D249B170A94DA0030D4DD /* OpenGLES.framework in Frameworks */,
 				9A5D249D170A94DA0030D4DD /* OpenAL.framework in Frameworks */,
@@ -333,6 +344,10 @@
 				43F7FF741927F92500CA4038 /* EventData.h */,
 				43F7FF441927F91900CA4038 /* extension.c */,
 				43F7FF751927F92500CA4038 /* extension.h */,
+				4327E30219E9879C007E7FB7 /* IkConstraint.c */,
+				4327E30019E9879C007E7FB7 /* IkConstraint.h */,
+				4327E30319E9879C007E7FB7 /* IkConstraintData.c */,
+				4327E30119E9879C007E7FB7 /* IkConstraintData.h */,
 				43F7FF451927F91900CA4038 /* Json.c */,
 				43F7FF461927F91900CA4038 /* Json.h */,
 				43F7FF471927F91900CA4038 /* MeshAttachment.c */,
@@ -378,9 +393,9 @@
 		43C32867170B0C7F004A9460 /* Resources */ = {
 			isa = PBXGroup;
 			children = (
-				43F7010C1927FBC700CA4038 /* goblins-ffd.atlas */,
-				43F7010D1927FBC700CA4038 /* goblins-ffd.json */,
-				43F7010E1927FBC700CA4038 /* goblins-ffd.png */,
+				43F7010C1927FBC700CA4038 /* goblins-mesh.atlas */,
+				43F7010D1927FBC700CA4038 /* goblins-mesh.json */,
+				43F7010E1927FBC700CA4038 /* goblins-mesh.png */,
 				43C32868170B0DA6004A9460 /* spineboy.json */,
 				43C3286A170B0DA6004A9460 /* spineboy.atlas */,
 				43C3286B170B0DA6004A9460 /* spineboy.png */,
@@ -430,6 +445,7 @@
 		9A5D2497170A94DA0030D4DD /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
+				4327E30819E98977007E7FB7 /* GLKit.framework */,
 				652107951895250000B1FF07 /* CoreText.framework */,
 				9A5D2498170A94DA0030D4DD /* QuartzCore.framework */,
 				9A5D249A170A94DA0030D4DD /* OpenGLES.framework */,
@@ -479,7 +495,7 @@
 		9A5D248D170A94DA0030D4DD /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 0460;
+				LastUpgradeCheck = 0510;
 				ORGANIZATIONNAME = "Craig Hinrichs";
 			};
 			buildConfigurationList = 9A5D2490170A94DA0030D4DD /* Build configuration list for PBXProject "spine-cocos2d-iphone-ios" */;
@@ -604,9 +620,9 @@
 				43C32885170B0DBE004A9460 /* Icon.png in Resources */,
 				43C32886170B0DBE004A9460 /* [email protected] in Resources */,
 				43C32888170B0DBE004A9460 /* iTunesArtwork in Resources */,
-				43F7010F1927FBC700CA4038 /* goblins-ffd.atlas in Resources */,
-				43F701101927FBC700CA4038 /* goblins-ffd.json in Resources */,
-				43F701111927FBC700CA4038 /* goblins-ffd.png in Resources */,
+				43F7010F1927FBC700CA4038 /* goblins-mesh.atlas in Resources */,
+				43F701101927FBC700CA4038 /* goblins-mesh.json in Resources */,
+				43F701111927FBC700CA4038 /* goblins-mesh.png in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -633,9 +649,11 @@
 				43F7FF5B1927F91900CA4038 /* Event.c in Sources */,
 				43F7FF5C1927F91900CA4038 /* EventData.c in Sources */,
 				43F7FF5D1927F91900CA4038 /* extension.c in Sources */,
+				4327E30419E9879C007E7FB7 /* IkConstraint.c in Sources */,
 				43F7FF5E1927F91900CA4038 /* Json.c in Sources */,
 				43F7FF5F1927F91900CA4038 /* MeshAttachment.c in Sources */,
 				43F7FF601927F91900CA4038 /* RegionAttachment.c in Sources */,
+				4327E30519E9879C007E7FB7 /* IkConstraintData.c in Sources */,
 				43F7FF611927F91900CA4038 /* Skeleton.c in Sources */,
 				43F7FF621927F91900CA4038 /* SkeletonBounds.c in Sources */,
 				43F7FF631927F91900CA4038 /* SkeletonData.c in Sources */,
@@ -659,6 +677,12 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_OPTIMIZATION_LEVEL = 0;
@@ -668,11 +692,17 @@
 				);
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				IPHONEOS_DEPLOYMENT_TARGET = 4.0;
+				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = "1,2";
+				VALID_ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 			};
 			name = Debug;
 		};
@@ -680,6 +710,12 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_PREPROCESSOR_DEFINITIONS = (
@@ -687,18 +723,24 @@
 					"NS_BLOCK_ASSERTIONS=1",
 				);
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				IPHONEOS_DEPLOYMENT_TARGET = 4.0;
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = "1,2";
+				VALID_ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 			};
 			name = Release;
 		};
 		9A5D2644170A94DC0030D4DD /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
+				ALWAYS_SEARCH_USER_PATHS = YES;
+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				COPY_PHASE_STRIP = NO;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -710,12 +752,14 @@
 					"\"cocos2d/cocos2d\"/**",
 				);
 				INFOPLIST_FILE = "Resources-ios/Info.plist";
+				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = (
 					"-lz",
 					"-lsqlite3",
 					"-ObjC",
 				);
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				VALID_ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				WRAPPER_EXTENSION = app;
 			};
 			name = Debug;
@@ -723,7 +767,8 @@
 		9A5D2645170A94DC0030D4DD /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
+				ALWAYS_SEARCH_USER_PATHS = YES;
+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				COPY_PHASE_STRIP = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "Resources-ios/Prefix.pch";
@@ -734,6 +779,7 @@
 					"\"cocos2d/cocos2d\"/**",
 				);
 				INFOPLIST_FILE = "Resources-ios/Info.plist";
+				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = (
 					"-lz",
 					"-lsqlite3",
@@ -741,6 +787,7 @@
 				);
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				VALIDATE_PRODUCT = YES;
+				VALID_ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				WRAPPER_EXTENSION = app;
 			};
 			name = Release;

+ 0 - 676
spine-cocos2d-iphone/3.0/spine-cocos2d-iphone-osx.xcodeproj/project.pbxproj

@@ -1,676 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 46;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		43BFBE0F170A778A00ECBACB /* spine-cocos2d-iphone.m in Sources */ = {isa = PBXBuildFile; fileRef = 43BFBE0D170A778A00ECBACB /* spine-cocos2d-iphone.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
-		43C32A1B170B1295004A9460 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C32A11170B1295004A9460 /* AppDelegate.m */; };
-		43C32A1C170B1295004A9460 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 43C32A13170B1295004A9460 /* InfoPlist.strings */; };
-		43C32A1D170B1295004A9460 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43C32A15170B1295004A9460 /* MainMenu.xib */; };
-		43C32A1E170B1295004A9460 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 43C32A17170B1295004A9460 /* icon.icns */; };
-		43C32A20170B1295004A9460 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C32A19170B1295004A9460 /* main.m */; };
-		43C32A36170D0A4D004A9460 /* spineboy.atlas in Resources */ = {isa = PBXBuildFile; fileRef = 43C32A30170D0A4D004A9460 /* spineboy.atlas */; };
-		43C32A37170D0A4D004A9460 /* spineboy.json in Resources */ = {isa = PBXBuildFile; fileRef = 43C32A31170D0A4D004A9460 /* spineboy.json */; };
-		43C32A38170D0A4D004A9460 /* spineboy.png in Resources */ = {isa = PBXBuildFile; fileRef = 43C32A32170D0A4D004A9460 /* spineboy.png */; };
-		43F7FD711927C31700CA4038 /* Animation.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD581927C31700CA4038 /* Animation.c */; };
-		43F7FD721927C31700CA4038 /* AnimationState.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD591927C31700CA4038 /* AnimationState.c */; };
-		43F7FD731927C31700CA4038 /* AnimationStateData.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD5A1927C31700CA4038 /* AnimationStateData.c */; };
-		43F7FD741927C31700CA4038 /* Atlas.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD5B1927C31700CA4038 /* Atlas.c */; };
-		43F7FD751927C31700CA4038 /* AtlasAttachmentLoader.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD5C1927C31700CA4038 /* AtlasAttachmentLoader.c */; };
-		43F7FD761927C31700CA4038 /* Attachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD5D1927C31700CA4038 /* Attachment.c */; };
-		43F7FD771927C31700CA4038 /* AttachmentLoader.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD5E1927C31700CA4038 /* AttachmentLoader.c */; };
-		43F7FD781927C31700CA4038 /* Bone.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD5F1927C31700CA4038 /* Bone.c */; };
-		43F7FD791927C31700CA4038 /* BoneData.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD601927C31700CA4038 /* BoneData.c */; };
-		43F7FD7A1927C31700CA4038 /* BoundingBoxAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD611927C31700CA4038 /* BoundingBoxAttachment.c */; };
-		43F7FD7B1927C31700CA4038 /* Event.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD621927C31700CA4038 /* Event.c */; };
-		43F7FD7C1927C31700CA4038 /* EventData.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD631927C31700CA4038 /* EventData.c */; };
-		43F7FD7D1927C31700CA4038 /* extension.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD641927C31700CA4038 /* extension.c */; };
-		43F7FD7E1927C31700CA4038 /* Json.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD651927C31700CA4038 /* Json.c */; };
-		43F7FD7F1927C31700CA4038 /* MeshAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD671927C31700CA4038 /* MeshAttachment.c */; };
-		43F7FD801927C31700CA4038 /* RegionAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD681927C31700CA4038 /* RegionAttachment.c */; };
-		43F7FD811927C31700CA4038 /* Skeleton.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD691927C31700CA4038 /* Skeleton.c */; };
-		43F7FD821927C31700CA4038 /* SkeletonBounds.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD6A1927C31700CA4038 /* SkeletonBounds.c */; };
-		43F7FD831927C31700CA4038 /* SkeletonData.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD6B1927C31700CA4038 /* SkeletonData.c */; };
-		43F7FD841927C31700CA4038 /* SkeletonJson.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD6C1927C31700CA4038 /* SkeletonJson.c */; };
-		43F7FD851927C31700CA4038 /* Skin.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD6D1927C31700CA4038 /* Skin.c */; };
-		43F7FD861927C31700CA4038 /* SkinnedMeshAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD6E1927C31700CA4038 /* SkinnedMeshAttachment.c */; };
-		43F7FD871927C31700CA4038 /* Slot.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD6F1927C31700CA4038 /* Slot.c */; };
-		43F7FD881927C31700CA4038 /* SlotData.c in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FD701927C31700CA4038 /* SlotData.c */; };
-		43F7FDA81927C33C00CA4038 /* SkeletonAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FDA41927C33C00CA4038 /* SkeletonAnimation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
-		43F7FDA91927C33C00CA4038 /* SkeletonRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FDA61927C33C00CA4038 /* SkeletonRenderer.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
-		43F7FDAC1927C34600CA4038 /* SpineboyExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FDAB1927C34600CA4038 /* SpineboyExample.m */; };
-		43F7FDB01927C35600CA4038 /* goblins-ffd.atlas in Resources */ = {isa = PBXBuildFile; fileRef = 43F7FDAD1927C35600CA4038 /* goblins-ffd.atlas */; };
-		43F7FDB11927C35600CA4038 /* goblins-ffd.json in Resources */ = {isa = PBXBuildFile; fileRef = 43F7FDAE1927C35600CA4038 /* goblins-ffd.json */; };
-		43F7FDB21927C35600CA4038 /* goblins-ffd.png in Resources */ = {isa = PBXBuildFile; fileRef = 43F7FDAF1927C35600CA4038 /* goblins-ffd.png */; };
-		43F7FDB51927D04200CA4038 /* GoblinsExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F7FDB41927D04200CA4038 /* GoblinsExample.m */; };
-		83F1A0E319868B46001F6B44 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83F1A0E219868B46001F6B44 /* GLKit.framework */; };
-		A2BD1E68192A41C100405470 /* libcocos2d.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A2BD1E63192A417300405470 /* libcocos2d.a */; };
-		A2BD1E73192A47A000405470 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2BD1E6C192A47A000405470 /* AVFoundation.framework */; };
-		A2BD1E74192A47A000405470 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2BD1E6D192A47A000405470 /* QuartzCore.framework */; };
-		A2BD1E75192A47A000405470 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2BD1E6E192A47A000405470 /* OpenGL.framework */; };
-		A2BD1E76192A47A000405470 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2BD1E6F192A47A000405470 /* OpenAL.framework */; };
-		A2BD1E77192A47A000405470 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2BD1E70192A47A000405470 /* AudioToolbox.framework */; };
-		A2BD1E78192A47A000405470 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2BD1E71192A47A000405470 /* AppKit.framework */; };
-		A2BD1E79192A47A000405470 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2BD1E72192A47A000405470 /* Foundation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
-		A2BD1E62192A417300405470 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = A2BD1E5C192A417300405470 /* cocos2d-osx.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = E01E663D121CA00A001A484F;
-			remoteInfo = cocos2d;
-		};
-		A2BD1E66192A417300405470 /* PBXContainerItemProxy */ = {
-			isa = PBXContainerItemProxy;
-			containerPortal = A2BD1E5C192A417300405470 /* cocos2d-osx.xcodeproj */;
-			proxyType = 2;
-			remoteGlobalIDString = D37EE9FC187D4E7700CB5EF2;
-			remoteInfo = ObjectiveChipmunk;
-		};
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
-		4319B51316FF9B2600C1D7A9 /* SpineExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SpineExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
-		43BFBE0D170A778A00ECBACB /* spine-cocos2d-iphone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "spine-cocos2d-iphone.m"; path = "src/spine/spine-cocos2d-iphone.m"; sourceTree = "<group>"; };
-		43BFBE0E170A778A00ECBACB /* spine-cocos2d-iphone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "spine-cocos2d-iphone.h"; path = "src/spine/spine-cocos2d-iphone.h"; sourceTree = "<group>"; };
-		43C32A10170B1295004A9460 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = "../Resources-mac/AppDelegate.h"; sourceTree = "<group>"; };
-		43C32A11170B1295004A9460 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = "../Resources-mac/AppDelegate.m"; sourceTree = "<group>"; };
-		43C32A14170B1295004A9460 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = InfoPlist.strings; sourceTree = "<group>"; };
-		43C32A16170B1295004A9460 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = MainMenu.xib; sourceTree = "<group>"; };
-		43C32A17170B1295004A9460 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = icon.icns; path = "Resources-mac/icon.icns"; sourceTree = "<group>"; };
-		43C32A18170B1295004A9460 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Resources-mac/Info.plist"; sourceTree = "<group>"; };
-		43C32A19170B1295004A9460 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = "../Resources-mac/main.m"; sourceTree = "<group>"; };
-		43C32A1A170B1295004A9460 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Prefix.pch; path = "../Resources-mac/Prefix.pch"; sourceTree = "<group>"; };
-		43C32A30170D0A4D004A9460 /* spineboy.atlas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = spineboy.atlas; sourceTree = "<group>"; };
-		43C32A31170D0A4D004A9460 /* spineboy.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = spineboy.json; sourceTree = "<group>"; };
-		43C32A32170D0A4D004A9460 /* spineboy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = spineboy.png; sourceTree = "<group>"; };
-		43F7FD581927C31700CA4038 /* Animation.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Animation.c; path = "../../spine-c/src/spine/Animation.c"; sourceTree = "<group>"; };
-		43F7FD591927C31700CA4038 /* AnimationState.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AnimationState.c; path = "../../spine-c/src/spine/AnimationState.c"; sourceTree = "<group>"; };
-		43F7FD5A1927C31700CA4038 /* AnimationStateData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AnimationStateData.c; path = "../../spine-c/src/spine/AnimationStateData.c"; sourceTree = "<group>"; };
-		43F7FD5B1927C31700CA4038 /* Atlas.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Atlas.c; path = "../../spine-c/src/spine/Atlas.c"; sourceTree = "<group>"; };
-		43F7FD5C1927C31700CA4038 /* AtlasAttachmentLoader.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AtlasAttachmentLoader.c; path = "../../spine-c/src/spine/AtlasAttachmentLoader.c"; sourceTree = "<group>"; };
-		43F7FD5D1927C31700CA4038 /* Attachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Attachment.c; path = "../../spine-c/src/spine/Attachment.c"; sourceTree = "<group>"; };
-		43F7FD5E1927C31700CA4038 /* AttachmentLoader.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AttachmentLoader.c; path = "../../spine-c/src/spine/AttachmentLoader.c"; sourceTree = "<group>"; };
-		43F7FD5F1927C31700CA4038 /* Bone.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Bone.c; path = "../../spine-c/src/spine/Bone.c"; sourceTree = "<group>"; };
-		43F7FD601927C31700CA4038 /* BoneData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = BoneData.c; path = "../../spine-c/src/spine/BoneData.c"; sourceTree = "<group>"; };
-		43F7FD611927C31700CA4038 /* BoundingBoxAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = BoundingBoxAttachment.c; path = "../../spine-c/src/spine/BoundingBoxAttachment.c"; sourceTree = "<group>"; };
-		43F7FD621927C31700CA4038 /* Event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Event.c; path = "../../spine-c/src/spine/Event.c"; sourceTree = "<group>"; };
-		43F7FD631927C31700CA4038 /* EventData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = EventData.c; path = "../../spine-c/src/spine/EventData.c"; sourceTree = "<group>"; };
-		43F7FD641927C31700CA4038 /* extension.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = extension.c; path = "../../spine-c/src/spine/extension.c"; sourceTree = "<group>"; };
-		43F7FD651927C31700CA4038 /* Json.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Json.c; path = "../../spine-c/src/spine/Json.c"; sourceTree = "<group>"; };
-		43F7FD661927C31700CA4038 /* Json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Json.h; path = "../../spine-c/src/spine/Json.h"; sourceTree = "<group>"; };
-		43F7FD671927C31700CA4038 /* MeshAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = MeshAttachment.c; path = "../../spine-c/src/spine/MeshAttachment.c"; sourceTree = "<group>"; };
-		43F7FD681927C31700CA4038 /* RegionAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = RegionAttachment.c; path = "../../spine-c/src/spine/RegionAttachment.c"; sourceTree = "<group>"; };
-		43F7FD691927C31700CA4038 /* Skeleton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Skeleton.c; path = "../../spine-c/src/spine/Skeleton.c"; sourceTree = "<group>"; };
-		43F7FD6A1927C31700CA4038 /* SkeletonBounds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkeletonBounds.c; path = "../../spine-c/src/spine/SkeletonBounds.c"; sourceTree = "<group>"; };
-		43F7FD6B1927C31700CA4038 /* SkeletonData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkeletonData.c; path = "../../spine-c/src/spine/SkeletonData.c"; sourceTree = "<group>"; };
-		43F7FD6C1927C31700CA4038 /* SkeletonJson.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkeletonJson.c; path = "../../spine-c/src/spine/SkeletonJson.c"; sourceTree = "<group>"; };
-		43F7FD6D1927C31700CA4038 /* Skin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Skin.c; path = "../../spine-c/src/spine/Skin.c"; sourceTree = "<group>"; };
-		43F7FD6E1927C31700CA4038 /* SkinnedMeshAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkinnedMeshAttachment.c; path = "../../spine-c/src/spine/SkinnedMeshAttachment.c"; sourceTree = "<group>"; };
-		43F7FD6F1927C31700CA4038 /* Slot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Slot.c; path = "../../spine-c/src/spine/Slot.c"; sourceTree = "<group>"; };
-		43F7FD701927C31700CA4038 /* SlotData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SlotData.c; path = "../../spine-c/src/spine/SlotData.c"; sourceTree = "<group>"; };
-		43F7FD891927C32800CA4038 /* Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Animation.h; path = "../../spine-c/include/spine/Animation.h"; sourceTree = "<group>"; };
-		43F7FD8A1927C32800CA4038 /* AnimationState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationState.h; path = "../../spine-c/include/spine/AnimationState.h"; sourceTree = "<group>"; };
-		43F7FD8B1927C32800CA4038 /* AnimationStateData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationStateData.h; path = "../../spine-c/include/spine/AnimationStateData.h"; sourceTree = "<group>"; };
-		43F7FD8C1927C32800CA4038 /* Atlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Atlas.h; path = "../../spine-c/include/spine/Atlas.h"; sourceTree = "<group>"; };
-		43F7FD8D1927C32800CA4038 /* AtlasAttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtlasAttachmentLoader.h; path = "../../spine-c/include/spine/AtlasAttachmentLoader.h"; sourceTree = "<group>"; };
-		43F7FD8E1927C32800CA4038 /* Attachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Attachment.h; path = "../../spine-c/include/spine/Attachment.h"; sourceTree = "<group>"; };
-		43F7FD8F1927C32800CA4038 /* AttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttachmentLoader.h; path = "../../spine-c/include/spine/AttachmentLoader.h"; sourceTree = "<group>"; };
-		43F7FD901927C32800CA4038 /* Bone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Bone.h; path = "../../spine-c/include/spine/Bone.h"; sourceTree = "<group>"; };
-		43F7FD911927C32800CA4038 /* BoneData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BoneData.h; path = "../../spine-c/include/spine/BoneData.h"; sourceTree = "<group>"; };
-		43F7FD921927C32800CA4038 /* BoundingBoxAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BoundingBoxAttachment.h; path = "../../spine-c/include/spine/BoundingBoxAttachment.h"; sourceTree = "<group>"; };
-		43F7FD931927C32800CA4038 /* Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Event.h; path = "../../spine-c/include/spine/Event.h"; sourceTree = "<group>"; };
-		43F7FD941927C32800CA4038 /* EventData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EventData.h; path = "../../spine-c/include/spine/EventData.h"; sourceTree = "<group>"; };
-		43F7FD951927C32800CA4038 /* extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = extension.h; path = "../../spine-c/include/spine/extension.h"; sourceTree = "<group>"; };
-		43F7FD961927C32800CA4038 /* MeshAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MeshAttachment.h; path = "../../spine-c/include/spine/MeshAttachment.h"; sourceTree = "<group>"; };
-		43F7FD971927C32800CA4038 /* RegionAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegionAttachment.h; path = "../../spine-c/include/spine/RegionAttachment.h"; sourceTree = "<group>"; };
-		43F7FD981927C32800CA4038 /* Skeleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Skeleton.h; path = "../../spine-c/include/spine/Skeleton.h"; sourceTree = "<group>"; };
-		43F7FD991927C32800CA4038 /* SkeletonBounds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonBounds.h; path = "../../spine-c/include/spine/SkeletonBounds.h"; sourceTree = "<group>"; };
-		43F7FD9A1927C32800CA4038 /* SkeletonData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonData.h; path = "../../spine-c/include/spine/SkeletonData.h"; sourceTree = "<group>"; };
-		43F7FD9B1927C32800CA4038 /* SkeletonJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonJson.h; path = "../../spine-c/include/spine/SkeletonJson.h"; sourceTree = "<group>"; };
-		43F7FD9C1927C32800CA4038 /* Skin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Skin.h; path = "../../spine-c/include/spine/Skin.h"; sourceTree = "<group>"; };
-		43F7FD9D1927C32800CA4038 /* SkinnedMeshAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkinnedMeshAttachment.h; path = "../../spine-c/include/spine/SkinnedMeshAttachment.h"; sourceTree = "<group>"; };
-		43F7FD9E1927C32800CA4038 /* Slot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Slot.h; path = "../../spine-c/include/spine/Slot.h"; sourceTree = "<group>"; };
-		43F7FD9F1927C32800CA4038 /* SlotData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SlotData.h; path = "../../spine-c/include/spine/SlotData.h"; sourceTree = "<group>"; };
-		43F7FDA01927C32800CA4038 /* spine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spine.h; path = "../../spine-c/include/spine/spine.h"; sourceTree = "<group>"; };
-		43F7FDA31927C33C00CA4038 /* SkeletonAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonAnimation.h; path = src/spine/SkeletonAnimation.h; sourceTree = "<group>"; };
-		43F7FDA41927C33C00CA4038 /* SkeletonAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SkeletonAnimation.m; path = src/spine/SkeletonAnimation.m; sourceTree = "<group>"; };
-		43F7FDA51927C33C00CA4038 /* SkeletonRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonRenderer.h; path = src/spine/SkeletonRenderer.h; sourceTree = "<group>"; };
-		43F7FDA61927C33C00CA4038 /* SkeletonRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SkeletonRenderer.m; path = src/spine/SkeletonRenderer.m; sourceTree = "<group>"; };
-		43F7FDAA1927C34600CA4038 /* SpineboyExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpineboyExample.h; sourceTree = "<group>"; };
-		43F7FDAB1927C34600CA4038 /* SpineboyExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpineboyExample.m; sourceTree = "<group>"; };
-		43F7FDAD1927C35600CA4038 /* goblins-ffd.atlas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "goblins-ffd.atlas"; sourceTree = "<group>"; };
-		43F7FDAE1927C35600CA4038 /* goblins-ffd.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "goblins-ffd.json"; sourceTree = "<group>"; };
-		43F7FDAF1927C35600CA4038 /* goblins-ffd.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "goblins-ffd.png"; sourceTree = "<group>"; };
-		43F7FDB31927D04200CA4038 /* GoblinsExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoblinsExample.h; sourceTree = "<group>"; };
-		43F7FDB41927D04200CA4038 /* GoblinsExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoblinsExample.m; sourceTree = "<group>"; };
-		83F1A0E219868B46001F6B44 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
-		A2BD1E5C192A417300405470 /* cocos2d-osx.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "cocos2d-osx.xcodeproj"; path = "cocos2d/cocos2d-osx.xcodeproj"; sourceTree = SOURCE_ROOT; };
-		A2BD1E6C192A47A000405470 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
-		A2BD1E6D192A47A000405470 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
-		A2BD1E6E192A47A000405470 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
-		A2BD1E6F192A47A000405470 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
-		A2BD1E70192A47A000405470 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
-		A2BD1E71192A47A000405470 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
-		A2BD1E72192A47A000405470 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		4319B51016FF9B2600C1D7A9 /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				83F1A0E319868B46001F6B44 /* GLKit.framework in Frameworks */,
-				A2BD1E78192A47A000405470 /* AppKit.framework in Frameworks */,
-				A2BD1E73192A47A000405470 /* AVFoundation.framework in Frameworks */,
-				A2BD1E75192A47A000405470 /* OpenGL.framework in Frameworks */,
-				A2BD1E68192A41C100405470 /* libcocos2d.a in Frameworks */,
-				A2BD1E76192A47A000405470 /* OpenAL.framework in Frameworks */,
-				A2BD1E74192A47A000405470 /* QuartzCore.framework in Frameworks */,
-				A2BD1E77192A47A000405470 /* AudioToolbox.framework in Frameworks */,
-				A2BD1E79192A47A000405470 /* Foundation.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		4319B50816FF9B2600C1D7A9 = {
-			isa = PBXGroup;
-			children = (
-				4319B6BC16FF9D1700C1D7A9 /* Classes */,
-				4319B7CB16FF9D3900C1D7A9 /* Resources */,
-				43C32A0F170B1282004A9460 /* Resources-mac */,
-				4319B6C616FF9D3900C1D7A9 /* cocos2d */,
-				4319B51616FF9B2600C1D7A9 /* Frameworks */,
-				4319B51416FF9B2600C1D7A9 /* Products */,
-			);
-			sourceTree = "<group>";
-		};
-		4319B51416FF9B2600C1D7A9 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				4319B51316FF9B2600C1D7A9 /* SpineExample.app */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		4319B51616FF9B2600C1D7A9 /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				83F1A0E219868B46001F6B44 /* GLKit.framework */,
-				A2BD1E6C192A47A000405470 /* AVFoundation.framework */,
-				A2BD1E6D192A47A000405470 /* QuartzCore.framework */,
-				A2BD1E6E192A47A000405470 /* OpenGL.framework */,
-				A2BD1E6F192A47A000405470 /* OpenAL.framework */,
-				A2BD1E70192A47A000405470 /* AudioToolbox.framework */,
-				A2BD1E71192A47A000405470 /* AppKit.framework */,
-				A2BD1E72192A47A000405470 /* Foundation.framework */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
-		4319B6BC16FF9D1700C1D7A9 /* Classes */ = {
-			isa = PBXGroup;
-			children = (
-				4319B8921701168A00C1D7A9 /* spine-c */,
-				4319B8931701168F00C1D7A9 /* spine-cocos2d-iphone */,
-				43F7FDAA1927C34600CA4038 /* SpineboyExample.h */,
-				43F7FDAB1927C34600CA4038 /* SpineboyExample.m */,
-				43F7FDB31927D04200CA4038 /* GoblinsExample.h */,
-				43F7FDB41927D04200CA4038 /* GoblinsExample.m */,
-				43C32A10170B1295004A9460 /* AppDelegate.h */,
-				43C32A11170B1295004A9460 /* AppDelegate.m */,
-				43C32A19170B1295004A9460 /* main.m */,
-				43C32A1A170B1295004A9460 /* Prefix.pch */,
-			);
-			name = Classes;
-			path = example;
-			sourceTree = SOURCE_ROOT;
-		};
-		4319B6C616FF9D3900C1D7A9 /* cocos2d */ = {
-			isa = PBXGroup;
-			children = (
-				A2BD1E5C192A417300405470 /* cocos2d-osx.xcodeproj */,
-			);
-			name = cocos2d;
-			path = libs;
-			sourceTree = SOURCE_ROOT;
-		};
-		4319B7CB16FF9D3900C1D7A9 /* Resources */ = {
-			isa = PBXGroup;
-			children = (
-				43F7FDAD1927C35600CA4038 /* goblins-ffd.atlas */,
-				43F7FDAE1927C35600CA4038 /* goblins-ffd.json */,
-				43F7FDAF1927C35600CA4038 /* goblins-ffd.png */,
-				43C32A30170D0A4D004A9460 /* spineboy.atlas */,
-				43C32A31170D0A4D004A9460 /* spineboy.json */,
-				43C32A32170D0A4D004A9460 /* spineboy.png */,
-			);
-			path = Resources;
-			sourceTree = SOURCE_ROOT;
-		};
-		4319B8921701168A00C1D7A9 /* spine-c */ = {
-			isa = PBXGroup;
-			children = (
-				43F7FD581927C31700CA4038 /* Animation.c */,
-				43F7FD891927C32800CA4038 /* Animation.h */,
-				43F7FD591927C31700CA4038 /* AnimationState.c */,
-				43F7FD8A1927C32800CA4038 /* AnimationState.h */,
-				43F7FD5A1927C31700CA4038 /* AnimationStateData.c */,
-				43F7FD8B1927C32800CA4038 /* AnimationStateData.h */,
-				43F7FD5B1927C31700CA4038 /* Atlas.c */,
-				43F7FD8C1927C32800CA4038 /* Atlas.h */,
-				43F7FD5C1927C31700CA4038 /* AtlasAttachmentLoader.c */,
-				43F7FD8D1927C32800CA4038 /* AtlasAttachmentLoader.h */,
-				43F7FD5D1927C31700CA4038 /* Attachment.c */,
-				43F7FD8E1927C32800CA4038 /* Attachment.h */,
-				43F7FD5E1927C31700CA4038 /* AttachmentLoader.c */,
-				43F7FD8F1927C32800CA4038 /* AttachmentLoader.h */,
-				43F7FD5F1927C31700CA4038 /* Bone.c */,
-				43F7FD901927C32800CA4038 /* Bone.h */,
-				43F7FD601927C31700CA4038 /* BoneData.c */,
-				43F7FD911927C32800CA4038 /* BoneData.h */,
-				43F7FD611927C31700CA4038 /* BoundingBoxAttachment.c */,
-				43F7FD921927C32800CA4038 /* BoundingBoxAttachment.h */,
-				43F7FD621927C31700CA4038 /* Event.c */,
-				43F7FD931927C32800CA4038 /* Event.h */,
-				43F7FD631927C31700CA4038 /* EventData.c */,
-				43F7FD941927C32800CA4038 /* EventData.h */,
-				43F7FD641927C31700CA4038 /* extension.c */,
-				43F7FD951927C32800CA4038 /* extension.h */,
-				43F7FD651927C31700CA4038 /* Json.c */,
-				43F7FD661927C31700CA4038 /* Json.h */,
-				43F7FD671927C31700CA4038 /* MeshAttachment.c */,
-				43F7FD961927C32800CA4038 /* MeshAttachment.h */,
-				43F7FD681927C31700CA4038 /* RegionAttachment.c */,
-				43F7FD971927C32800CA4038 /* RegionAttachment.h */,
-				43F7FD691927C31700CA4038 /* Skeleton.c */,
-				43F7FD981927C32800CA4038 /* Skeleton.h */,
-				43F7FD6A1927C31700CA4038 /* SkeletonBounds.c */,
-				43F7FD991927C32800CA4038 /* SkeletonBounds.h */,
-				43F7FD6B1927C31700CA4038 /* SkeletonData.c */,
-				43F7FD9A1927C32800CA4038 /* SkeletonData.h */,
-				43F7FD6C1927C31700CA4038 /* SkeletonJson.c */,
-				43F7FD9B1927C32800CA4038 /* SkeletonJson.h */,
-				43F7FD6D1927C31700CA4038 /* Skin.c */,
-				43F7FD9C1927C32800CA4038 /* Skin.h */,
-				43F7FD6E1927C31700CA4038 /* SkinnedMeshAttachment.c */,
-				43F7FD9D1927C32800CA4038 /* SkinnedMeshAttachment.h */,
-				43F7FD6F1927C31700CA4038 /* Slot.c */,
-				43F7FD9E1927C32800CA4038 /* Slot.h */,
-				43F7FD701927C31700CA4038 /* SlotData.c */,
-				43F7FD9F1927C32800CA4038 /* SlotData.h */,
-				43F7FDA01927C32800CA4038 /* spine.h */,
-			);
-			name = "spine-c";
-			path = ..;
-			sourceTree = "<group>";
-		};
-		4319B8931701168F00C1D7A9 /* spine-cocos2d-iphone */ = {
-			isa = PBXGroup;
-			children = (
-				43F7FDA31927C33C00CA4038 /* SkeletonAnimation.h */,
-				43F7FDA41927C33C00CA4038 /* SkeletonAnimation.m */,
-				43F7FDA51927C33C00CA4038 /* SkeletonRenderer.h */,
-				43F7FDA61927C33C00CA4038 /* SkeletonRenderer.m */,
-				43BFBE0D170A778A00ECBACB /* spine-cocos2d-iphone.m */,
-				43BFBE0E170A778A00ECBACB /* spine-cocos2d-iphone.h */,
-			);
-			name = "spine-cocos2d-iphone";
-			path = ..;
-			sourceTree = "<group>";
-		};
-		43C32A0F170B1282004A9460 /* Resources-mac */ = {
-			isa = PBXGroup;
-			children = (
-				43C32A12170B1295004A9460 /* English.lproj */,
-				43C32A17170B1295004A9460 /* icon.icns */,
-				43C32A18170B1295004A9460 /* Info.plist */,
-			);
-			name = "Resources-mac";
-			sourceTree = "<group>";
-		};
-		43C32A12170B1295004A9460 /* English.lproj */ = {
-			isa = PBXGroup;
-			children = (
-				43C32A13170B1295004A9460 /* InfoPlist.strings */,
-				43C32A15170B1295004A9460 /* MainMenu.xib */,
-			);
-			name = English.lproj;
-			path = "Resources-mac/English.lproj";
-			sourceTree = "<group>";
-		};
-		A2BD1E5D192A417300405470 /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				A2BD1E63192A417300405470 /* libcocos2d.a */,
-				A2BD1E67192A417300405470 /* libObjectiveChipmunk.a */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-		4319B51216FF9B2600C1D7A9 /* SpineExample */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = 4319B6AC16FF9B2B00C1D7A9 /* Build configuration list for PBXNativeTarget "SpineExample" */;
-			buildPhases = (
-				4319B50F16FF9B2600C1D7A9 /* Sources */,
-				4319B51016FF9B2600C1D7A9 /* Frameworks */,
-				4319B51116FF9B2600C1D7A9 /* Resources */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = SpineExample;
-			productName = "spine-cocos2d-iphone-mac";
-			productReference = 4319B51316FF9B2600C1D7A9 /* SpineExample.app */;
-			productType = "com.apple.product-type.application";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		4319B50A16FF9B2600C1D7A9 /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				LastUpgradeCheck = 0510;
-				ORGANIZATIONNAME = "Esoteric Software";
-			};
-			buildConfigurationList = 4319B50D16FF9B2600C1D7A9 /* Build configuration list for PBXProject "spine-cocos2d-iphone-osx" */;
-			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
-			hasScannedForEncodings = 0;
-			knownRegions = (
-				en,
-				English,
-			);
-			mainGroup = 4319B50816FF9B2600C1D7A9;
-			productRefGroup = 4319B51416FF9B2600C1D7A9 /* Products */;
-			projectDirPath = "";
-			projectReferences = (
-				{
-					ProductGroup = A2BD1E5D192A417300405470 /* Products */;
-					ProjectRef = A2BD1E5C192A417300405470 /* cocos2d-osx.xcodeproj */;
-				},
-			);
-			projectRoot = "";
-			targets = (
-				4319B51216FF9B2600C1D7A9 /* SpineExample */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXReferenceProxy section */
-		A2BD1E63192A417300405470 /* libcocos2d.a */ = {
-			isa = PBXReferenceProxy;
-			fileType = archive.ar;
-			path = libcocos2d.a;
-			remoteRef = A2BD1E62192A417300405470 /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-		A2BD1E67192A417300405470 /* libObjectiveChipmunk.a */ = {
-			isa = PBXReferenceProxy;
-			fileType = archive.ar;
-			path = libObjectiveChipmunk.a;
-			remoteRef = A2BD1E66192A417300405470 /* PBXContainerItemProxy */;
-			sourceTree = BUILT_PRODUCTS_DIR;
-		};
-/* End PBXReferenceProxy section */
-
-/* Begin PBXResourcesBuildPhase section */
-		4319B51116FF9B2600C1D7A9 /* Resources */ = {
-			isa = PBXResourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				43C32A1C170B1295004A9460 /* InfoPlist.strings in Resources */,
-				43C32A1D170B1295004A9460 /* MainMenu.xib in Resources */,
-				43C32A1E170B1295004A9460 /* icon.icns in Resources */,
-				43C32A36170D0A4D004A9460 /* spineboy.atlas in Resources */,
-				43C32A37170D0A4D004A9460 /* spineboy.json in Resources */,
-				43C32A38170D0A4D004A9460 /* spineboy.png in Resources */,
-				43F7FDB01927C35600CA4038 /* goblins-ffd.atlas in Resources */,
-				43F7FDB11927C35600CA4038 /* goblins-ffd.json in Resources */,
-				43F7FDB21927C35600CA4038 /* goblins-ffd.png in Resources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-		4319B50F16FF9B2600C1D7A9 /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				43BFBE0F170A778A00ECBACB /* spine-cocos2d-iphone.m in Sources */,
-				43C32A1B170B1295004A9460 /* AppDelegate.m in Sources */,
-				43C32A20170B1295004A9460 /* main.m in Sources */,
-				43F7FD711927C31700CA4038 /* Animation.c in Sources */,
-				43F7FD721927C31700CA4038 /* AnimationState.c in Sources */,
-				43F7FD731927C31700CA4038 /* AnimationStateData.c in Sources */,
-				43F7FD741927C31700CA4038 /* Atlas.c in Sources */,
-				43F7FD751927C31700CA4038 /* AtlasAttachmentLoader.c in Sources */,
-				43F7FD761927C31700CA4038 /* Attachment.c in Sources */,
-				43F7FD771927C31700CA4038 /* AttachmentLoader.c in Sources */,
-				43F7FD781927C31700CA4038 /* Bone.c in Sources */,
-				43F7FD791927C31700CA4038 /* BoneData.c in Sources */,
-				43F7FD7A1927C31700CA4038 /* BoundingBoxAttachment.c in Sources */,
-				43F7FD7B1927C31700CA4038 /* Event.c in Sources */,
-				43F7FD7C1927C31700CA4038 /* EventData.c in Sources */,
-				43F7FD7D1927C31700CA4038 /* extension.c in Sources */,
-				43F7FD7E1927C31700CA4038 /* Json.c in Sources */,
-				43F7FD7F1927C31700CA4038 /* MeshAttachment.c in Sources */,
-				43F7FD801927C31700CA4038 /* RegionAttachment.c in Sources */,
-				43F7FD811927C31700CA4038 /* Skeleton.c in Sources */,
-				43F7FD821927C31700CA4038 /* SkeletonBounds.c in Sources */,
-				43F7FD831927C31700CA4038 /* SkeletonData.c in Sources */,
-				43F7FD841927C31700CA4038 /* SkeletonJson.c in Sources */,
-				43F7FD851927C31700CA4038 /* Skin.c in Sources */,
-				43F7FD861927C31700CA4038 /* SkinnedMeshAttachment.c in Sources */,
-				43F7FD871927C31700CA4038 /* Slot.c in Sources */,
-				43F7FD881927C31700CA4038 /* SlotData.c in Sources */,
-				43F7FDA81927C33C00CA4038 /* SkeletonAnimation.m in Sources */,
-				43F7FDA91927C33C00CA4038 /* SkeletonRenderer.m in Sources */,
-				43F7FDAC1927C34600CA4038 /* SpineboyExample.m in Sources */,
-				43F7FDB51927D04200CA4038 /* GoblinsExample.m in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
-		43C32A13170B1295004A9460 /* InfoPlist.strings */ = {
-			isa = PBXVariantGroup;
-			children = (
-				43C32A14170B1295004A9460 /* English */,
-			);
-			name = InfoPlist.strings;
-			sourceTree = "<group>";
-		};
-		43C32A15170B1295004A9460 /* MainMenu.xib */ = {
-			isa = PBXVariantGroup;
-			children = (
-				43C32A16170B1295004A9460 /* English */,
-			);
-			name = MainMenu.xib;
-			sourceTree = "<group>";
-		};
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
-		4319B6AA16FF9B2B00C1D7A9 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				CLANG_WARN_BOOL_CONVERSION = YES;
-				CLANG_WARN_CONSTANT_CONVERSION = YES;
-				CLANG_WARN_EMPTY_BODY = YES;
-				CLANG_WARN_ENUM_CONVERSION = YES;
-				CLANG_WARN_INT_CONVERSION = YES;
-				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				GCC_C_LANGUAGE_STANDARD = gnu99;
-				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					DEBUG,
-					"COCOS2D_DEBUG=1",
-				);
-				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNDECLARED_SELECTOR = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES;
-				GCC_WARN_UNUSED_FUNCTION = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.7;
-				ONLY_ACTIVE_ARCH = YES;
-				SDKROOT = macosx;
-			};
-			name = Debug;
-		};
-		4319B6AB16FF9B2B00C1D7A9 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				CLANG_WARN_BOOL_CONVERSION = YES;
-				CLANG_WARN_CONSTANT_CONVERSION = YES;
-				CLANG_WARN_EMPTY_BODY = YES;
-				CLANG_WARN_ENUM_CONVERSION = YES;
-				CLANG_WARN_INT_CONVERSION = YES;
-				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_C_LANGUAGE_STANDARD = gnu99;
-				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					NDEBUG,
-					"NS_BLOCK_ASSERTIONS=1",
-				);
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNDECLARED_SELECTOR = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES;
-				GCC_WARN_UNUSED_FUNCTION = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.7;
-				SDKROOT = macosx;
-			};
-			name = Release;
-		};
-		4319B6AD16FF9B2B00C1D7A9 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				CLANG_ENABLE_OBJC_ARC = YES;
-				COMBINE_HIDPI_IMAGES = YES;
-				COPY_PHASE_STRIP = NO;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks\"",
-				);
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = "Resources-mac/Prefix.pch";
-				GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
-				HEADER_SEARCH_PATHS = (
-					"\"src\"",
-					"\"../../spine-c/include\"",
-					"\"cocos2d/cocos2d\"/**",
-					"\"cocos2d/external/kazmath/include\"",
-					"\"cocos2d/external/ObjectAL\"/**",
-				);
-				INFOPLIST_FILE = "Resources-mac/Info.plist";
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SRCROOT)/cocos2d/external/Chipmunk/msvc/glew/lib/Release/Win32\"",
-					"\"$(SRCROOT)/cocos2d/external/Chipmunk/msvc/glfw/lib-msvc100\"",
-					"\"$(SRCROOT)/cocos2d/external/Chipmunk/xcode/libGLEW/lib\"",
-					"\"$(SRCROOT)/cocos2d/external/Chipmunk/xcode/libglfw/lib\"",
-					"\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib\"",
-				);
-				OTHER_CFLAGS = "";
-				OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
-				OTHER_LDFLAGS = (
-					"-lz",
-					"-lsqlite3",
-					"-ObjC",
-				);
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				WRAPPER_EXTENSION = app;
-			};
-			name = Debug;
-		};
-		4319B6AE16FF9B2B00C1D7A9 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				CLANG_ENABLE_OBJC_ARC = YES;
-				COMBINE_HIDPI_IMAGES = YES;
-				COPY_PHASE_STRIP = YES;
-				FRAMEWORK_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/System/Library/Frameworks\"",
-				);
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = "Resources-mac/Prefix.pch";
-				GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
-				HEADER_SEARCH_PATHS = (
-					"\"src\"",
-					"\"../../spine-c/include\"",
-					"\"cocos2d/cocos2d\"/**",
-					"\"cocos2d/external/kazmath/include\"",
-					"\"cocos2d/external/ObjectAL\"/**",
-				);
-				INFOPLIST_FILE = "Resources-mac/Info.plist";
-				LIBRARY_SEARCH_PATHS = (
-					"$(inherited)",
-					"\"$(SRCROOT)/cocos2d/external/Chipmunk/msvc/glew/lib/Release/Win32\"",
-					"\"$(SRCROOT)/cocos2d/external/Chipmunk/msvc/glfw/lib-msvc100\"",
-					"\"$(SRCROOT)/cocos2d/external/Chipmunk/xcode/libGLEW/lib\"",
-					"\"$(SRCROOT)/cocos2d/external/Chipmunk/xcode/libglfw/lib\"",
-					"\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib\"",
-				);
-				OTHER_CFLAGS = "";
-				OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
-				OTHER_LDFLAGS = (
-					"-lz",
-					"-lsqlite3",
-					"-ObjC",
-				);
-				PRODUCT_NAME = "$(TARGET_NAME)";
-				WRAPPER_EXTENSION = app;
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		4319B50D16FF9B2600C1D7A9 /* Build configuration list for PBXProject "spine-cocos2d-iphone-osx" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				4319B6AA16FF9B2B00C1D7A9 /* Debug */,
-				4319B6AB16FF9B2B00C1D7A9 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		4319B6AC16FF9B2B00C1D7A9 /* Build configuration list for PBXNativeTarget "SpineExample" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				4319B6AD16FF9B2B00C1D7A9 /* Debug */,
-				4319B6AE16FF9B2B00C1D7A9 /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = 4319B50A16FF9B2600C1D7A9 /* Project object */;
-}

+ 0 - 7
spine-cocos2d-iphone/3.0/spine-cocos2d-iphone-osx.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
-   version = "1.0">
-   <FileRef
-      location = "self:spine-cocos2d-iphone-osx.xcodeproj">
-   </FileRef>
-</Workspace>

+ 0 - 0
spine-cocos2d-iphone/3.0/README.md → spine-cocos2d-iphone/3/README.md


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/AppDelegate.h → spine-cocos2d-iphone/3/Resources-ios/AppDelegate.h


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/AppDelegate.m → spine-cocos2d-iphone/3/Resources-ios/AppDelegate.m


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/[email protected] → spine-cocos2d-iphone/3/Resources-ios/[email protected]


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/Default-Landscape~ipad.png → spine-cocos2d-iphone/3/Resources-ios/Default-Landscape~ipad.png


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/Default.png → spine-cocos2d-iphone/3/Resources-ios/Default.png


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/[email protected] → spine-cocos2d-iphone/3/Resources-ios/[email protected]


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/Icon-72.png → spine-cocos2d-iphone/3/Resources-ios/Icon-72.png


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/Icon-Small-50.png → spine-cocos2d-iphone/3/Resources-ios/Icon-Small-50.png


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/Icon-Small.png → spine-cocos2d-iphone/3/Resources-ios/Icon-Small.png


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/[email protected] → spine-cocos2d-iphone/3/Resources-ios/[email protected]


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/Icon.png → spine-cocos2d-iphone/3/Resources-ios/Icon.png


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/[email protected] → spine-cocos2d-iphone/3/Resources-ios/[email protected]


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/Info.plist → spine-cocos2d-iphone/3/Resources-ios/Info.plist


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/Prefix.pch → spine-cocos2d-iphone/3/Resources-ios/Prefix.pch


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/iTunesArtwork → spine-cocos2d-iphone/3/Resources-ios/iTunesArtwork


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-ios/main.m → spine-cocos2d-iphone/3/Resources-ios/main.m


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-mac/AppDelegate.h → spine-cocos2d-iphone/3/Resources-mac/AppDelegate.h


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-mac/AppDelegate.m → spine-cocos2d-iphone/3/Resources-mac/AppDelegate.m


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-mac/English.lproj/InfoPlist.strings → spine-cocos2d-iphone/3/Resources-mac/English.lproj/InfoPlist.strings


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-mac/English.lproj/MainMenu.xib → spine-cocos2d-iphone/3/Resources-mac/English.lproj/MainMenu.xib


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-mac/Info.plist → spine-cocos2d-iphone/3/Resources-mac/Info.plist


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-mac/Prefix.pch → spine-cocos2d-iphone/3/Resources-mac/Prefix.pch


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-mac/icon.icns → spine-cocos2d-iphone/3/Resources-mac/icon.icns


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources-mac/main.m → spine-cocos2d-iphone/3/Resources-mac/main.m


+ 1 - 1
spine-cocos2d-iphone/2/Resources/goblins-ffd.atlas → spine-cocos2d-iphone/3/Resources/goblins-mesh.atlas

@@ -1,5 +1,5 @@
 
-goblins-ffd.png
+goblins-mesh.png
 format: RGBA8888
 filter: Linear,Linear
 repeat: none

+ 0 - 0
spine-cocos2d-iphone/3.0/Resources/goblins-ffd.json → spine-cocos2d-iphone/3/Resources/goblins-mesh.json


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources/goblins-ffd.png → spine-cocos2d-iphone/3/Resources/goblins-mesh.png


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources/spineboy.atlas → spine-cocos2d-iphone/3/Resources/spineboy.atlas


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources/spineboy.json → spine-cocos2d-iphone/3/Resources/spineboy.json


+ 0 - 0
spine-cocos2d-iphone/3.0/Resources/spineboy.png → spine-cocos2d-iphone/3/Resources/spineboy.png


+ 0 - 0
spine-cocos2d-iphone/3.0/example/GoblinsExample.h → spine-cocos2d-iphone/3/example/GoblinsExample.h


+ 1 - 1
spine-cocos2d-iphone/3.0/example/GoblinsExample.m → spine-cocos2d-iphone/3/example/GoblinsExample.m

@@ -14,7 +14,7 @@
 	self = [super init];
 	if (!self) return nil;
 
-	skeletonNode = [SkeletonAnimation skeletonWithFile:@"goblins-ffd.json" atlasFile:@"goblins-ffd.atlas" scale:1];
+	skeletonNode = [SkeletonAnimation skeletonWithFile:@"goblins-mesh.json" atlasFile:@"goblins-mesh.atlas" scale:1];
 	[skeletonNode setSkin:@"goblin"];
 	[skeletonNode setAnimationForTrack:0 name:@"walk" loop:YES];
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác