From e964de68df2196b5ca16cc9a9950ed1fb45b05bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E7=BA=BF=E7=81=B5?= Date: Mon, 11 Jul 2022 16:00:23 +0800 Subject: [PATCH 1/8] [cocos2d-x] Use backend shader definations (#2104) --- spine-cocos2dx/src/spine/v4/SkeletonBatch.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/spine-cocos2dx/src/spine/v4/SkeletonBatch.cpp b/spine-cocos2dx/src/spine/v4/SkeletonBatch.cpp index 6da030f78..7c0351c62 100644 --- a/spine-cocos2dx/src/spine/v4/SkeletonBatch.cpp +++ b/spine-cocos2dx/src/spine/v4/SkeletonBatch.cpp @@ -40,6 +40,7 @@ using std::max; #include "renderer/backend/Device.h" #include "renderer/ccShaders.h" +#include "renderer/backend/Types.h" namespace spine { @@ -89,17 +90,17 @@ namespace spine { void SkeletonBatch::updateProgramStateLayout(cocos2d::backend::ProgramState *programState) { auto vertexLayout = programState->getVertexLayout(); - auto locPosition = programState->getAttributeLocation("a_position"); - auto locTexcoord = programState->getAttributeLocation("a_texCoord"); - auto locColor = programState->getAttributeLocation("a_color"); - vertexLayout->setAttribute("a_position", locPosition, backend::VertexFormat::FLOAT3, offsetof(V3F_C4B_T2F, vertices), false); - vertexLayout->setAttribute("a_color", locColor, backend::VertexFormat::UBYTE4, offsetof(V3F_C4B_T2F, colors), true); - vertexLayout->setAttribute("a_texCoord", locTexcoord, backend::VertexFormat::FLOAT2, offsetof(V3F_C4B_T2F, texCoords), false); + auto locPosition = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_POSITION); + auto locTexcoord = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_TEXCOORD); + auto locColor = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_COLOR); + vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_POSITION, locPosition, backend::VertexFormat::FLOAT3, offsetof(V3F_C4B_T2F, vertices), false); + vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_COLOR, locColor, backend::VertexFormat::UBYTE4, offsetof(V3F_C4B_T2F, colors), true); + vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_TEXCOORD, locTexcoord, backend::VertexFormat::FLOAT2, offsetof(V3F_C4B_T2F, texCoords), false); vertexLayout->setLayout(sizeof(_vertices[0])); - _locMVP = programState->getUniformLocation("u_MVPMatrix"); - _locTexture = programState->getUniformLocation("u_texture"); + _locMVP = programState->getUniformLocation(backend::UNIFORM_NAME_MVP_MATRIX); + _locTexture = programState->getUniformLocation(backend::UNIFORM_NAME_TEXTURE); } void SkeletonBatch::update(float delta) { From 7fa0c841a20aee99d1e6c1bf4995e302c36fcf75 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 18 Jul 2022 10:29:21 +0200 Subject: [PATCH 2/8] [godot] Fix version compatibility note in README --- spine-godot/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-godot/README.md b/spine-godot/README.md index 222f23198..b6d1d3b70 100644 --- a/spine-godot/README.md +++ b/spine-godot/README.md @@ -16,7 +16,7 @@ For the official legal terms governing the Spine Runtimes, please read the [Spin ## Spine version -spine-godot works with data exported from Spine 4.2.xx. +spine-godot works with data exported from Spine 4.1.xx. spine-godot supports all Spine features, except two-color tinting and the screen blend mode. From ef11ae965379d3538bd6b6ffe024061db828641e Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 18 Jul 2022 10:59:07 +0200 Subject: [PATCH 3/8] [godot] Update links for 4.1 branch --- spine-godot/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spine-godot/README.md b/spine-godot/README.md index b6d1d3b70..bb4609b03 100644 --- a/spine-godot/README.md +++ b/spine-godot/README.md @@ -30,10 +30,10 @@ spine-godot works with the latest stable Godot 3.4 release. It requires compilat We provide prebuilt Godot editor and export template binaries for Godot 3.4.4-stable: -* [Godot Editor Windows](https://spine-godot.s3.eu-central-1.amazonaws.com/4.2-beta/3.4.4-stable/godot-editor-windows.zip) -* [Godot Editor Linux](https://spine-godot.s3.eu-central-1.amazonaws.com/4.2-beta/3.4.4-stable/godot-editor-linux.zip) -* [Godot Editor macOS](https://spine-godot.s3.eu-central-1.amazonaws.com/4.2-beta/3.4.4-stable/godot-editor-macos.zip) -* [Godot export templates for Windows, Linux, macOS, Web, Android, iOS](https://spine-godot.s3.eu-central-1.amazonaws.com/4.2-beta/3.4.4-stable/spine-godot-templates-4.2-beta-3.4.4-stable.tpz) +* [Godot Editor Windows](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.4.4-stable/godot-editor-windows.zip) +* [Godot Editor Linux](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.4.4-stable/godot-editor-linux.zip) +* [Godot Editor macOS](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.4.4-stable/godot-editor-macos.zip) +* [Godot export templates for Windows, Linux, macOS, Web, Android, iOS](https://spine-godot.s3.eu-central-1.amazonaws.com/4.1/3.4.4-stable/spine-godot-templates-4.1-3.4.4-stable.tpz) ### Building the Godot editor and export templates locally From b79316de81ded13390d72f2695519214ff6685d3 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 18 Jul 2022 13:16:14 +0200 Subject: [PATCH 4/8] [unity] Fixed skeleton import and Inspector behaviour of TK2D integration on 4.1. See #2113. --- .../Editor/Asset Types/SkeletonDataAssetInspector.cs | 2 +- .../Modules/TK2D/SpriteCollectionAttachmentLoader.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs index 0a1312791..bde3b42fc 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs @@ -193,7 +193,7 @@ namespace Spine.Unity.Editor { } if (changeCheck.changed) { - if (requiresReload || serializedObject.ApplyModifiedProperties()) { + if (serializedObject.ApplyModifiedProperties() || requiresReload) { this.Clear(); this.InitializeEditor(); diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/TK2D/SpriteCollectionAttachmentLoader.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/TK2D/SpriteCollectionAttachmentLoader.cs index cdad5f491..0a5cec5d1 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/TK2D/SpriteCollectionAttachmentLoader.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/TK2D/SpriteCollectionAttachmentLoader.cs @@ -105,7 +105,7 @@ namespace Spine.Unity.TK2D { page.rendererObject = material; region.page = page; region.u = u; - region.u = v; + region.v = v; region.u2 = u2; region.v2 = v2; region.rotate = regionRotated; From cd3118f9e047e7a439f8cc8646c379a10503f088 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 18 Jul 2022 14:02:24 +0200 Subject: [PATCH 5/8] [maven-release-plugin] prepare release spine-libgdx-4.1.0 --- spine-libgdx/spine-libgdx/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-libgdx/spine-libgdx/pom.xml b/spine-libgdx/spine-libgdx/pom.xml index 6955ff259..39c01f6dd 100644 --- a/spine-libgdx/spine-libgdx/pom.xml +++ b/spine-libgdx/spine-libgdx/pom.xml @@ -10,7 +10,7 @@ com.esotericsoftware.spine spine-libgdx jar - 4.1.0-SNAPSHOT + 4.1.0 spine-libgdx @@ -39,7 +39,7 @@ scm:git:https://github.com/EsotericSoftware/spine-runtimes.git scm:git:https://github.com/EsotericSoftware/spine-runtimes.git https://github.com/EsotericSoftware/spine-runtimes/ - 4.0.02.1 + spine-libgdx-4.1.0 From 30863a69c24dd174b67fb11c790936d72fb43539 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 18 Jul 2022 14:03:33 +0200 Subject: [PATCH 6/8] [maven-release-plugin] prepare for next development iteration --- spine-libgdx/spine-libgdx/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-libgdx/spine-libgdx/pom.xml b/spine-libgdx/spine-libgdx/pom.xml index 39c01f6dd..3b609eafa 100644 --- a/spine-libgdx/spine-libgdx/pom.xml +++ b/spine-libgdx/spine-libgdx/pom.xml @@ -10,7 +10,7 @@ com.esotericsoftware.spine spine-libgdx jar - 4.1.0 + 4.1.1-SNAPSHOT spine-libgdx From 3cdfb25a485be0f3cbad3c54eedd4e42b6f34574 Mon Sep 17 00:00:00 2001 From: Daniel Collins <74185255+yoyo-danielc@users.noreply.github.com> Date: Mon, 18 Jul 2022 13:07:14 +0100 Subject: [PATCH 7/8] [c] Fixed JSON parsing of PathConstraint spacing mode (#2065). (#2115) See 4ec3290b987230a0b71d67c34269ba50f4e5e57f --- spine-c/spine-c/src/spine/SkeletonJson.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spine-c/spine-c/src/spine/SkeletonJson.c b/spine-c/spine-c/src/spine/SkeletonJson.c index 4b5be2fee..61befe66c 100644 --- a/spine-c/spine-c/src/spine/SkeletonJson.c +++ b/spine-c/spine-c/src/spine/SkeletonJson.c @@ -1196,6 +1196,8 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char data->spacingMode = SP_SPACING_MODE_FIXED; else if (strcmp(item, "percent") == 0) data->spacingMode = SP_SPACING_MODE_PERCENT; + else + data->spacingMode = SP_SPACING_MODE_PROPORTIONAL; item = Json_getString(constraintMap, "rotateMode", "tangent"); if (strcmp(item, "tangent") == 0) data->rotateMode = SP_ROTATE_MODE_TANGENT; From 85af0f658033370cb0965b2deb302d1252782956 Mon Sep 17 00:00:00 2001 From: Toru Hisai Date: Mon, 18 Jul 2022 21:09:12 +0900 Subject: [PATCH 8/8] prevent a crash when a skin has no attachments. (#2114) --- .../spine-cpp/src/spine/SkeletonJson.cpp | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp index 88e45fca3..9e517cbed 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp @@ -508,43 +508,43 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { skeletonData->_defaultSkin = skin; } - for (attachmentsMap = Json::getItem(skinMap, - "attachments") - ->_child; - attachmentsMap; attachmentsMap = attachmentsMap->_next) { - SlotData *slot = skeletonData->findSlot(attachmentsMap->_name); - Json *attachmentMap; + Json *attachments = Json::getItem(skinMap, "attachments"); + if (attachments) + for (attachmentsMap = attachments->_child; + attachmentsMap; attachmentsMap = attachmentsMap->_next) { + SlotData *slot = skeletonData->findSlot(attachmentsMap->_name); + Json *attachmentMap; - for (attachmentMap = attachmentsMap->_child; attachmentMap; attachmentMap = attachmentMap->_next) { - Attachment *attachment = NULL; - const char *skinAttachmentName = attachmentMap->_name; - const char *attachmentName = Json::getString(attachmentMap, "name", skinAttachmentName); - const char *attachmentPath = Json::getString(attachmentMap, "path", attachmentName); - const char *color; - Json *entry; + for (attachmentMap = attachmentsMap->_child; attachmentMap; attachmentMap = attachmentMap->_next) { + Attachment *attachment = NULL; + const char *skinAttachmentName = attachmentMap->_name; + const char *attachmentName = Json::getString(attachmentMap, "name", skinAttachmentName); + const char *attachmentPath = Json::getString(attachmentMap, "path", attachmentName); + const char *color; + Json *entry; - const char *typeString = Json::getString(attachmentMap, "type", "region"); - AttachmentType type; - if (strcmp(typeString, "region") == 0) type = AttachmentType_Region; - else if (strcmp(typeString, "mesh") == 0) - type = AttachmentType_Mesh; - else if (strcmp(typeString, "linkedmesh") == 0) - type = AttachmentType_Linkedmesh; - else if (strcmp(typeString, "boundingbox") == 0) - type = AttachmentType_Boundingbox; - else if (strcmp(typeString, "path") == 0) - type = AttachmentType_Path; - else if (strcmp(typeString, "clipping") == 0) - type = AttachmentType_Clipping; - else if (strcmp(typeString, "point") == 0) - type = AttachmentType_Point; - else { - delete skeletonData; - setError(root, "Unknown attachment type: ", typeString); - return NULL; - } + const char *typeString = Json::getString(attachmentMap, "type", "region"); + AttachmentType type; + if (strcmp(typeString, "region") == 0) type = AttachmentType_Region; + else if (strcmp(typeString, "mesh") == 0) + type = AttachmentType_Mesh; + else if (strcmp(typeString, "linkedmesh") == 0) + type = AttachmentType_Linkedmesh; + else if (strcmp(typeString, "boundingbox") == 0) + type = AttachmentType_Boundingbox; + else if (strcmp(typeString, "path") == 0) + type = AttachmentType_Path; + else if (strcmp(typeString, "clipping") == 0) + type = AttachmentType_Clipping; + else if (strcmp(typeString, "point") == 0) + type = AttachmentType_Point; + else { + delete skeletonData; + setError(root, "Unknown attachment type: ", typeString); + return NULL; + } - switch (type) { + switch (type) { case AttachmentType_Region: { attachment = _attachmentLoader->newRegionAttachment(*skin, attachmentName, attachmentPath); if (!attachment) { @@ -624,8 +624,8 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { bool inheritDeform = Json::getInt(attachmentMap, "deform", 1) ? true : false; LinkedMesh *linkedMesh = new (__FILE__, __LINE__) LinkedMesh(mesh, String(Json::getString( - attachmentMap, - "skin", 0)), + attachmentMap, + "skin", 0)), slot->getIndex(), String(entry->_valueString), inheritDeform); @@ -653,7 +653,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { int vertexCount = 0; pathAttatchment->_closed = Json::getInt(attachmentMap, "closed", 0) ? true : false; pathAttatchment->_constantSpeed = Json::getInt(attachmentMap, "constantSpeed", 1) ? true - : false; + : false; vertexCount = Json::getInt(attachmentMap, "vertexCount", 0); readVertices(attachmentMap, pathAttatchment, vertexCount << 1); @@ -696,11 +696,11 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { _attachmentLoader->configureAttachment(attachment); break; } - } + } - skin->setAttachment(slot->getIndex(), skinAttachmentName, attachment); + skin->setAttachment(slot->getIndex(), skinAttachmentName, attachment); + } } - } } }