This commit is contained in:
Fenrisul 2015-02-17 18:37:28 -08:00
commit fdb83d5428
12 changed files with 36 additions and 37 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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;

View File

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

View File

@ -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>

View File

@ -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>

View File

@ -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);
}

View File

@ -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;

View File

@ -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) {