mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-05 02:06:53 +08:00
Merge branch 'master' of https://github.com/EsotericSoftware/spine-runtimes
This commit is contained in:
commit
fdb83d5428
@ -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). */
|
/* Returns the number of tuple values read (1, 2, 4, or 0 for failure). */
|
||||||
static int readTuple (const char* end, Str tuple[]) {
|
static int readTuple (const char* end, Str tuple[]) {
|
||||||
int i;
|
int i;
|
||||||
Str str;
|
Str str = {NULL, NULL};
|
||||||
readLine(0, end, &str);
|
readLine(0, end, &str);
|
||||||
if (!beginPast(&str, ':')) return 0;
|
if (!beginPast(&str, ':')) return 0;
|
||||||
|
|
||||||
|
|||||||
@ -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 parentRotation = (!bone->data->inheritRotation || !bone->parent) ? 0 : bone->parent->worldRotation;
|
||||||
float rotation = bone->rotation;
|
float rotation = bone->rotation;
|
||||||
float rotationIK = ATAN2(targetY - bone->worldY, targetX - bone->worldX) * RAD_DEG;
|
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;
|
rotationIK -= parentRotation;
|
||||||
bone->rotationIK = rotation + (rotationIK - rotation) * alpha;
|
bone->rotationIK = rotation + (rotationIK - rotation) * alpha;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,7 @@ void _spSkeletonJson_setError (spSkeletonJson* self, Json* root, const char* val
|
|||||||
FREE(self->error);
|
FREE(self->error);
|
||||||
strcpy(message, value1);
|
strcpy(message, value1);
|
||||||
length = (int)strlen(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);
|
MALLOC_STR(self->error, message);
|
||||||
if (root) Json_dispose(root);
|
if (root) Json_dispose(root);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,8 +12,8 @@ Alternatively, the contents of the `spine-c/src`, `spine-c/include` and `spine-c
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
[Spineboy](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/2/example/SpineboyExample.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.cpp)
|
[Golbins](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/2/example/GoblinsExample.m)
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
|
|||||||
@ -5,15 +5,15 @@ The spine-cocos2d-iphone runtime provides functionality to load, manipulate and
|
|||||||
## Setup
|
## 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. 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. 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.0` 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
|
## Examples
|
||||||
|
|
||||||
[Spineboy](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/3.0/example/SpineboyExample.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.0/example/GoblinsExample.cpp)
|
[Golbins](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/3/example/GoblinsExample.m)
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
|
|||||||
@ -2425,7 +2425,7 @@ spine.AtlasAttachmentLoader = function (atlas) {
|
|||||||
};
|
};
|
||||||
spine.AtlasAttachmentLoader.prototype = {
|
spine.AtlasAttachmentLoader.prototype = {
|
||||||
newRegionAttachment: function (skin, name, path) {
|
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 + ")";
|
if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")";
|
||||||
var attachment = new spine.RegionAttachment(name);
|
var attachment = new spine.RegionAttachment(name);
|
||||||
attachment.rendererObject = region;
|
attachment.rendererObject = region;
|
||||||
@ -2439,7 +2439,7 @@ spine.AtlasAttachmentLoader.prototype = {
|
|||||||
return attachment;
|
return attachment;
|
||||||
},
|
},
|
||||||
newMeshAttachment: function (skin, name, path) {
|
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 + ")";
|
if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")";
|
||||||
var attachment = new spine.MeshAttachment(name);
|
var attachment = new spine.MeshAttachment(name);
|
||||||
attachment.rendererObject = region;
|
attachment.rendererObject = region;
|
||||||
@ -2457,7 +2457,7 @@ spine.AtlasAttachmentLoader.prototype = {
|
|||||||
return attachment;
|
return attachment;
|
||||||
},
|
},
|
||||||
newSkinnedMeshAttachment: function (skin, name, path) {
|
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 + ")";
|
if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")";
|
||||||
var attachment = new spine.SkinnedMeshAttachment(name);
|
var attachment = new spine.SkinnedMeshAttachment(name);
|
||||||
attachment.rendererObject = region;
|
attachment.rendererObject = region;
|
||||||
|
|||||||
@ -128,4 +128,4 @@ function SkinnedMeshAttachment.new (name)
|
|||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
return MeshAttachment
|
return SkinnedMeshAttachment
|
||||||
|
|||||||
@ -139,11 +139,8 @@
|
|||||||
<AppxManifest Include="Package.appxmanifest">
|
<AppxManifest Include="Package.appxmanifest">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</AppxManifest>
|
</AppxManifest>
|
||||||
<Content Include="..\..\..\spine-xna\example\data\goblins-ffd.atlas">
|
<Content Include="..\..\..\spine-xna\example\data\goblins-mesh.png">
|
||||||
<Link>Assets\goblins-ffd.atlas</Link>
|
<Link>Assets\goblins-mesh.png</Link>
|
||||||
</Content>
|
|
||||||
<Content Include="..\..\..\spine-xna\example\data\goblins-ffd.json">
|
|
||||||
<Link>Assets\goblins-ffd.json</Link>
|
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="..\..\..\spine-xna\example\data\raptor.png">
|
<Content Include="..\..\..\spine-xna\example\data\raptor.png">
|
||||||
<Link>Assets\raptor.png</Link>
|
<Link>Assets\raptor.png</Link>
|
||||||
@ -156,9 +153,6 @@
|
|||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<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">
|
<Content Include="..\..\..\spine-xna\example\data\spineboy.png">
|
||||||
<Link>Assets\spineboy.png</Link>
|
<Link>Assets\spineboy.png</Link>
|
||||||
</Content>
|
</Content>
|
||||||
@ -184,6 +178,14 @@
|
|||||||
<Link>Assets\raptor.json</Link>
|
<Link>Assets\raptor.json</Link>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</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)' < '11.0' ">
|
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '11.0' ">
|
||||||
<VisualStudioVersion>11.0</VisualStudioVersion>
|
<VisualStudioVersion>11.0</VisualStudioVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -112,15 +112,6 @@
|
|||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<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">
|
<Content Include="..\..\..\spine-xna\example\data\raptor.atlas">
|
||||||
<Link>data\raptor.atlas</Link>
|
<Link>data\raptor.atlas</Link>
|
||||||
</Content>
|
</Content>
|
||||||
@ -139,5 +130,14 @@
|
|||||||
<Content Include="..\..\..\spine-xna\example\data\spineboy.png">
|
<Content Include="..\..\..\spine-xna\example\data\spineboy.png">
|
||||||
<Link>data\spineboy.png</Link>
|
<Link>data\spineboy.png</Link>
|
||||||
</Content>
|
</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>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@ -81,8 +81,8 @@ SkeletonDrawable::SkeletonDrawable (SkeletonData* skeletonData, AnimationStateDa
|
|||||||
SkeletonDrawable::~SkeletonDrawable () {
|
SkeletonDrawable::~SkeletonDrawable () {
|
||||||
delete vertexArray;
|
delete vertexArray;
|
||||||
FREE(worldVertices);
|
FREE(worldVertices);
|
||||||
|
if (ownsAnimationStateData) AnimationStateData_dispose(state->data);
|
||||||
AnimationState_dispose(state);
|
AnimationState_dispose(state);
|
||||||
if (ownsAnimationStateData) AnimationStateData_dispose(state->data);
|
|
||||||
Skeleton_dispose(skeleton);
|
Skeleton_dispose(skeleton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -250,10 +250,6 @@ public class SkeletonSprite extends DisplayObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
minX *= scaleX;
|
|
||||||
maxX *= scaleX;
|
|
||||||
minY *= scaleY;
|
|
||||||
maxY *= scaleY;
|
|
||||||
var temp:Number;
|
var temp:Number;
|
||||||
if (maxX < minX) {
|
if (maxX < minX) {
|
||||||
temp = maxX;
|
temp = maxX;
|
||||||
|
|||||||
@ -417,7 +417,8 @@ public class SkeletonRenderer : MonoBehaviour {
|
|||||||
for (int i = startSlot, triangleIndex = 0; i < endSlot; i++) {
|
for (int i = startSlot, triangleIndex = 0; i < endSlot; i++) {
|
||||||
Slot slot = drawOrder[i];
|
Slot slot = drawOrder[i];
|
||||||
Attachment attachment = slot.attachment;
|
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 (attachment is RegionAttachment) {
|
||||||
if (!flip) {
|
if (!flip) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user