Browse Source

Merge branch 'master' of https://github.com/EsotericSoftware/spine-runtimes

Fenrisul 10 years ago
parent
commit
fdb83d5428

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

@@ -120,7 +120,7 @@ static int readValue (const char* end, Str* str) {
 /* Returns the number of tuple values read (1, 2, 4, or 0 for failure). */
 static int readTuple (const char* end, Str tuple[]) {
 	int i;
-	Str str;
+	Str str = {NULL, NULL};
 	readLine(0, end, &str);
 	if (!beginPast(&str, ':')) return 0;
 

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

@@ -70,7 +70,7 @@ void spIkConstraint_apply1 (spBone* bone, float targetX, float targetY, float al
 	float parentRotation = (!bone->data->inheritRotation || !bone->parent) ? 0 : bone->parent->worldRotation;
 	float rotation = bone->rotation;
 	float rotationIK = ATAN2(targetY - bone->worldY, targetX - bone->worldX) * RAD_DEG;
-	if (bone->worldFlipX != (bone->worldFlipY != Bone_isYDown())) rotationIK = -rotationIK;
+	if (bone->worldFlipX != (bone->worldFlipY != spBone_isYDown())) rotationIK = -rotationIK;
 	rotationIK -= parentRotation;
 	bone->rotationIK = rotation + (rotationIK - rotation) * alpha;
 }

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

@@ -65,7 +65,7 @@ void _spSkeletonJson_setError (spSkeletonJson* self, Json* root, const char* val
 	FREE(self->error);
 	strcpy(message, value1);
 	length = (int)strlen(value1);
-	if (value2) strncat(message + length, value2, 256 - length);
+	if (value2) strncat(message + length, value2, 255 - length);
 	MALLOC_STR(self->error, message);
 	if (root) Json_dispose(root);
 }

+ 2 - 2
spine-cocos2d-iphone/2/README.md

@@ -12,8 +12,8 @@ Alternatively, the contents of the `spine-c/src`, `spine-c/include` and `spine-c
 
 ## Examples
 
-[Spineboy](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/2/example/SpineboyExample.cpp)
-[Golbins](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/2/example/GoblinsExample.cpp)
+[Spineboy](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/2/example/SpineboyExample.m)
+[Golbins](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/2/example/GoblinsExample.m)
 
 ## Links
 

+ 5 - 5
spine-cocos2d-iphone/3/README.md

@@ -5,15 +5,15 @@ The spine-cocos2d-iphone runtime provides functionality to load, manipulate and
 ## Setup
 
 1. Download the Spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it [as a zip](https://github.com/EsotericSoftware/spine-runtimes/archive/master.zip).
-1. Place the contents of a cocos2d version 3.0.x distribution into the `spine-cocos2d-iphone/3.0/cocos2d` directory.
-1. Open the XCode project file for iOS or Mac from the `spine-cocos2d-iphone/3.0` directory.
+1. Place the contents of a cocos2d version 3.1 (or higher) distribution into the `spine-cocos2d-iphone/3/cocos2d` directory.
+1. Open the Xcode project file for iOS or Mac from the `spine-cocos2d-iphone/3` directory.
 
-Alternatively, the contents of the `spine-c/src`, `spine-c/include` and `spine-cocos2d-iphone/3.0/src` directories can be copied into your project. Be sure your header search path will find the contents of the `spine-c/include` and `spine-cocos2d-iphone/3.0/src` directories. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files.
+Alternatively, the contents of the `spine-c/src`, `spine-c/include` and `spine-cocos2d-iphone/3/src` directories can be copied into your project. Be sure your header search path will find the contents of the `spine-c/include` and `spine-cocos2d-iphone/3/src` directories. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files.
 
 ## Examples
 
-[Spineboy](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/3.0/example/SpineboyExample.cpp)
-[Golbins](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/3.0/example/GoblinsExample.cpp)
+[Spineboy](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/3/example/SpineboyExample.m)
+[Golbins](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/3/example/GoblinsExample.m)
 
 ## Links
 

+ 3 - 3
spine-js/spine.js

@@ -2425,7 +2425,7 @@ spine.AtlasAttachmentLoader = function (atlas) {
 };
 spine.AtlasAttachmentLoader.prototype = {
 	newRegionAttachment: function (skin, name, path) {
-		var region = this.atlas.findRegion(name);
+		var region = this.atlas.findRegion(path);
 		if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")";
 		var attachment = new spine.RegionAttachment(name);
 		attachment.rendererObject = region;
@@ -2439,7 +2439,7 @@ spine.AtlasAttachmentLoader.prototype = {
 		return attachment;
 	},
 	newMeshAttachment: function (skin, name, path) {
-		var region = this.atlas.findRegion(name);
+		var region = this.atlas.findRegion(path);
 		if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")";
 		var attachment = new spine.MeshAttachment(name);
 		attachment.rendererObject = region;
@@ -2457,7 +2457,7 @@ spine.AtlasAttachmentLoader.prototype = {
 		return attachment;
 	},
 	newSkinnedMeshAttachment: function (skin, name, path) {
-		var region = this.atlas.findRegion(name);
+		var region = this.atlas.findRegion(path);
 		if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")";
 		var attachment = new spine.SkinnedMeshAttachment(name);
 		attachment.rendererObject = region;

+ 1 - 1
spine-lua/SkinnedMeshAttachment.lua

@@ -128,4 +128,4 @@ function SkinnedMeshAttachment.new (name)
 
 	return self
 end
-return MeshAttachment
+return SkinnedMeshAttachment

+ 10 - 8
spine-monogame/windows8-store/example/spine-monogame-example.csproj

@@ -139,11 +139,8 @@
     <AppxManifest Include="Package.appxmanifest">
       <SubType>Designer</SubType>
     </AppxManifest>
-    <Content Include="..\..\..\spine-xna\example\data\goblins-ffd.atlas">
-      <Link>Assets\goblins-ffd.atlas</Link>
-    </Content>
-    <Content Include="..\..\..\spine-xna\example\data\goblins-ffd.json">
-      <Link>Assets\goblins-ffd.json</Link>
+    <Content Include="..\..\..\spine-xna\example\data\goblins-mesh.png">
+      <Link>Assets\goblins-mesh.png</Link>
     </Content>
     <Content Include="..\..\..\spine-xna\example\data\raptor.png">
       <Link>Assets\raptor.png</Link>
@@ -156,9 +153,6 @@
     </Content>
   </ItemGroup>
   <ItemGroup>
-    <Content Include="..\..\..\spine-xna\example\data\goblins-ffd.png">
-      <Link>Assets\goblins-ffd.png</Link>
-    </Content>
     <Content Include="..\..\..\spine-xna\example\data\spineboy.png">
       <Link>Assets\spineboy.png</Link>
     </Content>
@@ -184,6 +178,14 @@
       <Link>Assets\raptor.json</Link>
     </Content>
   </ItemGroup>
+  <ItemGroup>
+    <Content Include="..\..\..\spine-xna\example\data\goblins-mesh.atlas">
+      <Link>Assets\goblins-mesh.atlas</Link>
+    </Content>
+    <Content Include="..\..\..\spine-xna\example\data\goblins-mesh.json">
+      <Link>Assets\goblins-mesh.json</Link>
+    </Content>
+  </ItemGroup>
   <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0' ">
     <VisualStudioVersion>11.0</VisualStudioVersion>
   </PropertyGroup>

+ 9 - 9
spine-monogame/xamarinstudio-ios/example/spine-monogame-example.csproj

@@ -112,15 +112,6 @@
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
-    <Content Include="..\..\..\spine-xna\example\data\goblins-ffd.atlas">
-      <Link>data\goblins-ffd.atlas</Link>
-    </Content>
-    <Content Include="..\..\..\spine-xna\example\data\goblins-ffd.json">
-      <Link>data\goblins-ffd.json</Link>
-    </Content>
-    <Content Include="..\..\..\spine-xna\example\data\goblins-ffd.png">
-      <Link>data\goblins-ffd.png</Link>
-    </Content>
     <Content Include="..\..\..\spine-xna\example\data\raptor.atlas">
       <Link>data\raptor.atlas</Link>
     </Content>
@@ -139,5 +130,14 @@
     <Content Include="..\..\..\spine-xna\example\data\spineboy.png">
       <Link>data\spineboy.png</Link>
     </Content>
+    <Content Include="..\..\..\spine-xna\example\data\goblins-mesh.png">
+      <Link>data\goblins-mesh.png</Link>
+    </Content>
+    <Content Include="..\..\..\spine-xna\example\data\goblins-mesh.json">
+      <Link>data\goblins-mesh.json</Link>
+    </Content>
+    <Content Include="..\..\..\spine-xna\example\data\goblins-mesh.atlas">
+      <Link>data\goblins-mesh.atlas</Link>
+    </Content>
   </ItemGroup>
 </Project>

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

@@ -81,8 +81,8 @@ SkeletonDrawable::SkeletonDrawable (SkeletonData* skeletonData, AnimationStateDa
 SkeletonDrawable::~SkeletonDrawable () {
 	delete vertexArray;
 	FREE(worldVertices);
+    if (ownsAnimationStateData) AnimationStateData_dispose(state->data);
 	AnimationState_dispose(state);
-	if (ownsAnimationStateData) AnimationStateData_dispose(state->data);
 	Skeleton_dispose(skeleton);
 }
 

+ 0 - 4
spine-starling/spine-starling/src/spine/starling/SkeletonSprite.as

@@ -250,10 +250,6 @@ public class SkeletonSprite extends DisplayObject {
 			}
 		}
 
-		minX *= scaleX;
-		maxX *= scaleX;
-		minY *= scaleY;
-		maxY *= scaleY;
 		var temp:Number;
 		if (maxX < minX) {
 			temp = maxX;

+ 2 - 1
spine-unity/Assets/spine-unity/SkeletonRenderer.cs

@@ -417,7 +417,8 @@ public class SkeletonRenderer : MonoBehaviour {
 		for (int i = startSlot, triangleIndex = 0; i < endSlot; i++) {
 			Slot slot = drawOrder[i];
 			Attachment attachment = slot.attachment;
-			bool flip = frontFacing && ((slot.Bone.WorldFlipX != slot.Bone.WorldFlipY) != (Mathf.Sign(slot.Bone.WorldScaleX) != Mathf.Sign(slot.bone.WorldScaleY)));
+			Bone bone = slot.bone;
+			bool flip = frontFacing && ((bone.WorldFlipX != bone.WorldFlipY) != (Mathf.Sign(bone.WorldScaleX) != Mathf.Sign(bone.WorldScaleY)));
 
 			if (attachment is RegionAttachment) {
 				if (!flip) {