diff --git a/spine-c/spine-c.vcxproj b/spine-c/spine-c.vcxproj index 5219ad301..0ac111cba 100644 --- a/spine-c/spine-c.vcxproj +++ b/spine-c/spine-c.vcxproj @@ -20,12 +20,14 @@ StaticLibrary true Unicode + v110 StaticLibrary false true Unicode + v110 @@ -97,6 +99,9 @@ + + + @@ -123,9 +128,11 @@ - + + + diff --git a/spine-c/spine-c.vcxproj.filters b/spine-c/spine-c.vcxproj.filters index 7dc493ef9..c62c2f897 100644 --- a/spine-c/spine-c.vcxproj.filters +++ b/spine-c/spine-c.vcxproj.filters @@ -96,6 +96,15 @@ Header Files + + Header Files + + + Header Files + + + Header Files + @@ -167,14 +176,20 @@ Source Files - - Source Files - Source Files Source Files + + Source Files + + + Source Files + + + Source Files + \ No newline at end of file diff --git a/spine-c/src/spine/Bone.c b/spine-c/src/spine/Bone.c index ec942fd20..052532ea4 100644 --- a/spine-c/src/spine/Bone.c +++ b/spine-c/src/spine/Bone.c @@ -88,8 +88,8 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota CONST_CAST(float, self->d) = ld; CONST_CAST(float, self->worldX) = x; CONST_CAST(float, self->worldY) = y; - CONST_CAST(float, self->worldSignX) = scaleX > 0 ? 1 : -1; - CONST_CAST(float, self->worldSignY) = scaleY > 0 ? 1 : -1; + CONST_CAST(float, self->worldSignX) = scaleX > 0 ? 1.0f : -1.0f; + CONST_CAST(float, self->worldSignY) = scaleY > 0 ? 1.0f : -1.0f; return; } diff --git a/spine-c/src/spine/IkConstraint.c b/spine-c/src/spine/IkConstraint.c index 10e2952b3..c5f3bddca 100644 --- a/spine-c/src/spine/IkConstraint.c +++ b/spine-c/src/spine/IkConstraint.c @@ -133,7 +133,7 @@ void spIkConstraint_apply2 (spBone* parent, spBone* child, float targetX, float float aa = a * a, bb = b * b, ll = l1 * l1, dd = tx * tx + ty * ty; float c0 = bb * ll + aa * dd - aa * bb, c1 = -2 * bb * l1, c2 = bb - aa; float d = c1 * c1 - 4 * c2 * c0; - float minAngle = 0, minDist = 999999999, minX = 0, minY = 0; + float minAngle = 0, minDist = 999999999.0f, minX = 0, minY = 0; float maxAngle = 0, maxDist = 0, maxX = 0, maxY = 0; float x = l1 + a, dist = x * x, angle, y; cy = 0; diff --git a/spine-cocos2dx/2/src/spine/SkeletonRenderer.cpp b/spine-cocos2dx/2/src/spine/SkeletonRenderer.cpp index 2e0a4e2b4..223947e15 100644 --- a/spine-cocos2dx/2/src/spine/SkeletonRenderer.cpp +++ b/spine-cocos2dx/2/src/spine/SkeletonRenderer.cpp @@ -184,9 +184,9 @@ void SkeletonRenderer::draw () { a = attachment->a; break; } - case SP_ATTACHMENT_SKINNED_MESH: { - spSkinnedMeshAttachment* attachment = (spSkinnedMeshAttachment*)slot->attachment; - spSkinnedMeshAttachment_computeWorldVertices(attachment, slot, worldVertices); + case SP_ATTACHMENT_WEIGHTED_MESH: { + spWeightedMeshAttachment* attachment = (spWeightedMeshAttachment*)slot->attachment; + spWeightedMeshAttachment_computeWorldVertices(attachment, slot, worldVertices); texture = getTexture(attachment); uvs = attachment->uvs; verticesCount = attachment->uvsCount; @@ -250,8 +250,8 @@ void SkeletonRenderer::draw () { ccDrawColor4B(255, 0, 0, 255); for (int i = 0, n = skeleton->bonesCount; i < n; i++) { spBone *bone = skeleton->bones[i]; - float x = bone->data->length * bone->m00 + bone->worldX; - float y = bone->data->length * bone->m10 + bone->worldY; + float x = bone->data->length * bone->a + bone->worldX; + float y = bone->data->length * bone->c + bone->worldY; ccDrawLine(ccp(bone->worldX, bone->worldY), ccp(x, y)); } // Bone origins. @@ -273,7 +273,7 @@ CCTexture2D* SkeletonRenderer::getTexture (spMeshAttachment* attachment) const { return (CCTexture2D*)((spAtlasRegion*)attachment->rendererObject)->page->rendererObject; } -CCTexture2D* SkeletonRenderer::getTexture (spSkinnedMeshAttachment* attachment) const { +CCTexture2D* SkeletonRenderer::getTexture (spWeightedMeshAttachment* attachment) const { return (CCTexture2D*)((spAtlasRegion*)attachment->rendererObject)->page->rendererObject; } @@ -292,9 +292,9 @@ CCRect SkeletonRenderer::boundingBox () { spMeshAttachment* mesh = (spMeshAttachment*)slot->attachment; spMeshAttachment_computeWorldVertices(mesh, slot, worldVertices); verticesCount = mesh->verticesCount; - } else if (slot->attachment->type == SP_ATTACHMENT_SKINNED_MESH) { - spSkinnedMeshAttachment* mesh = (spSkinnedMeshAttachment*)slot->attachment; - spSkinnedMeshAttachment_computeWorldVertices(mesh, slot, worldVertices); + } else if (slot->attachment->type == SP_ATTACHMENT_WEIGHTED_MESH) { + spWeightedMeshAttachment* mesh = (spWeightedMeshAttachment*)slot->attachment; + spWeightedMeshAttachment_computeWorldVertices(mesh, slot, worldVertices); verticesCount = mesh->uvsCount; } else continue; diff --git a/spine-cocos2dx/2/src/spine/SkeletonRenderer.h b/spine-cocos2dx/2/src/spine/SkeletonRenderer.h index ac286bf55..ec685e0f8 100644 --- a/spine-cocos2dx/2/src/spine/SkeletonRenderer.h +++ b/spine-cocos2dx/2/src/spine/SkeletonRenderer.h @@ -97,7 +97,7 @@ protected: virtual cocos2d::CCTexture2D* getTexture (spRegionAttachment* attachment) const; virtual cocos2d::CCTexture2D* getTexture (spMeshAttachment* attachment) const; - virtual cocos2d::CCTexture2D* getTexture (spSkinnedMeshAttachment* attachment) const; + virtual cocos2d::CCTexture2D* getTexture (spWeightedMeshAttachment* attachment) const; private: bool ownsSkeletonData; diff --git a/spine-cocos2dx/3/src/spine/SkeletonRenderer.cpp b/spine-cocos2dx/3/src/spine/SkeletonRenderer.cpp index 10bef4739..904381a42 100644 --- a/spine-cocos2dx/3/src/spine/SkeletonRenderer.cpp +++ b/spine-cocos2dx/3/src/spine/SkeletonRenderer.cpp @@ -198,9 +198,9 @@ void SkeletonRenderer::drawSkeleton (const Mat4 &transform, uint32_t transformFl a = attachment->a; break; } - case SP_ATTACHMENT_SKINNED_MESH: { - spSkinnedMeshAttachment* attachment = (spSkinnedMeshAttachment*)slot->attachment; - spSkinnedMeshAttachment_computeWorldVertices(attachment, slot, _worldVertices); + case SP_ATTACHMENT_WEIGHTED_MESH: { + spWeightedMeshAttachment* attachment = (spWeightedMeshAttachment*)slot->attachment; + spWeightedMeshAttachment_computeWorldVertices(attachment, slot, _worldVertices); texture = getTexture(attachment); uvs = attachment->uvs; verticesCount = attachment->uvsCount; @@ -271,8 +271,8 @@ void SkeletonRenderer::drawSkeleton (const Mat4 &transform, uint32_t transformFl DrawPrimitives::setDrawColor4B(255, 0, 0, 255); for (int i = 0, n = _skeleton->bonesCount; i < n; i++) { spBone *bone = _skeleton->bones[i]; - float x = bone->data->length * bone->m00 + bone->worldX; - float y = bone->data->length * bone->m10 + bone->worldY; + float x = bone->data->length * bone->a + bone->worldX; + float y = bone->data->length * bone->c + bone->worldY; DrawPrimitives::drawLine(Vec2(bone->worldX, bone->worldY), Vec2(x, y)); } // Bone origins. @@ -296,7 +296,7 @@ Texture2D* SkeletonRenderer::getTexture (spMeshAttachment* attachment) const { return (Texture2D*)((spAtlasRegion*)attachment->rendererObject)->page->rendererObject; } -Texture2D* SkeletonRenderer::getTexture (spSkinnedMeshAttachment* attachment) const { +Texture2D* SkeletonRenderer::getTexture (spWeightedMeshAttachment* attachment) const { return (Texture2D*)((spAtlasRegion*)attachment->rendererObject)->page->rendererObject; } @@ -315,9 +315,9 @@ Rect SkeletonRenderer::getBoundingBox () const { spMeshAttachment* mesh = (spMeshAttachment*)slot->attachment; spMeshAttachment_computeWorldVertices(mesh, slot, _worldVertices); verticesCount = mesh->verticesCount; - } else if (slot->attachment->type == SP_ATTACHMENT_SKINNED_MESH) { - spSkinnedMeshAttachment* mesh = (spSkinnedMeshAttachment*)slot->attachment; - spSkinnedMeshAttachment_computeWorldVertices(mesh, slot, _worldVertices); + } else if (slot->attachment->type == SP_ATTACHMENT_WEIGHTED_MESH) { + spWeightedMeshAttachment* mesh = (spWeightedMeshAttachment*)slot->attachment; + spWeightedMeshAttachment_computeWorldVertices(mesh, slot, _worldVertices); verticesCount = mesh->uvsCount; } else continue; diff --git a/spine-cocos2dx/3/src/spine/SkeletonRenderer.h b/spine-cocos2dx/3/src/spine/SkeletonRenderer.h index 50200613d..480c9d393 100644 --- a/spine-cocos2dx/3/src/spine/SkeletonRenderer.h +++ b/spine-cocos2dx/3/src/spine/SkeletonRenderer.h @@ -115,7 +115,7 @@ protected: void setSkeletonData (spSkeletonData* skeletonData, bool ownsSkeletonData); virtual cocos2d::Texture2D* getTexture (spRegionAttachment* attachment) const; virtual cocos2d::Texture2D* getTexture (spMeshAttachment* attachment) const; - virtual cocos2d::Texture2D* getTexture (spSkinnedMeshAttachment* attachment) const; + virtual cocos2d::Texture2D* getTexture (spWeightedMeshAttachment* attachment) const; bool _ownsSkeletonData; spAtlas* _atlas;