Merge branch '4.1' into 4.2-beta

This commit is contained in:
Mario Zechner 2022-07-18 14:10:22 +02:00
commit 9beeb20d9d
7 changed files with 60 additions and 57 deletions

View File

@ -1258,6 +1258,8 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
data->spacingMode = SP_SPACING_MODE_FIXED; data->spacingMode = SP_SPACING_MODE_FIXED;
else if (strcmp(item, "percent") == 0) else if (strcmp(item, "percent") == 0)
data->spacingMode = SP_SPACING_MODE_PERCENT; data->spacingMode = SP_SPACING_MODE_PERCENT;
else
data->spacingMode = SP_SPACING_MODE_PROPORTIONAL;
item = Json_getString(constraintMap, "rotateMode", "tangent"); item = Json_getString(constraintMap, "rotateMode", "tangent");
if (strcmp(item, "tangent") == 0) data->rotateMode = SP_ROTATE_MODE_TANGENT; if (strcmp(item, "tangent") == 0) data->rotateMode = SP_ROTATE_MODE_TANGENT;

View File

@ -40,6 +40,7 @@ using std::max;
#include "renderer/backend/Device.h" #include "renderer/backend/Device.h"
#include "renderer/ccShaders.h" #include "renderer/ccShaders.h"
#include "renderer/backend/Types.h"
namespace spine { namespace spine {
@ -89,17 +90,17 @@ namespace spine {
void SkeletonBatch::updateProgramStateLayout(cocos2d::backend::ProgramState *programState) { void SkeletonBatch::updateProgramStateLayout(cocos2d::backend::ProgramState *programState) {
auto vertexLayout = programState->getVertexLayout(); auto vertexLayout = programState->getVertexLayout();
auto locPosition = programState->getAttributeLocation("a_position"); auto locPosition = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_POSITION);
auto locTexcoord = programState->getAttributeLocation("a_texCoord"); auto locTexcoord = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_TEXCOORD);
auto locColor = programState->getAttributeLocation("a_color"); auto locColor = programState->getAttributeLocation(backend::ATTRIBUTE_NAME_COLOR);
vertexLayout->setAttribute("a_position", locPosition, backend::VertexFormat::FLOAT3, offsetof(V3F_C4B_T2F, vertices), false); vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_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(backend::ATTRIBUTE_NAME_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); vertexLayout->setAttribute(backend::ATTRIBUTE_NAME_TEXCOORD, locTexcoord, backend::VertexFormat::FLOAT2, offsetof(V3F_C4B_T2F, texCoords), false);
vertexLayout->setLayout(sizeof(_vertices[0])); vertexLayout->setLayout(sizeof(_vertices[0]));
_locMVP = programState->getUniformLocation("u_MVPMatrix"); _locMVP = programState->getUniformLocation(backend::UNIFORM_NAME_MVP_MATRIX);
_locTexture = programState->getUniformLocation("u_texture"); _locTexture = programState->getUniformLocation(backend::UNIFORM_NAME_TEXTURE);
} }
void SkeletonBatch::update(float delta) { void SkeletonBatch::update(float delta) {

View File

@ -512,43 +512,43 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) {
skeletonData->_defaultSkin = skin; skeletonData->_defaultSkin = skin;
} }
for (attachmentsMap = Json::getItem(skinMap, Json *attachments = Json::getItem(skinMap, "attachments");
"attachments") if (attachments)
->_child; for (attachmentsMap = attachments->_child;
attachmentsMap; attachmentsMap = attachmentsMap->_next) { attachmentsMap; attachmentsMap = attachmentsMap->_next) {
SlotData *slot = skeletonData->findSlot(attachmentsMap->_name); SlotData *slot = skeletonData->findSlot(attachmentsMap->_name);
Json *attachmentMap; Json *attachmentMap;
for (attachmentMap = attachmentsMap->_child; attachmentMap; attachmentMap = attachmentMap->_next) { for (attachmentMap = attachmentsMap->_child; attachmentMap; attachmentMap = attachmentMap->_next) {
Attachment *attachment = NULL; Attachment *attachment = NULL;
const char *skinAttachmentName = attachmentMap->_name; const char *skinAttachmentName = attachmentMap->_name;
const char *attachmentName = Json::getString(attachmentMap, "name", skinAttachmentName); const char *attachmentName = Json::getString(attachmentMap, "name", skinAttachmentName);
const char *attachmentPath = Json::getString(attachmentMap, "path", attachmentName); const char *attachmentPath = Json::getString(attachmentMap, "path", attachmentName);
const char *color; const char *color;
Json *entry; Json *entry;
const char *typeString = Json::getString(attachmentMap, "type", "region"); const char *typeString = Json::getString(attachmentMap, "type", "region");
AttachmentType type; AttachmentType type;
if (strcmp(typeString, "region") == 0) type = AttachmentType_Region; if (strcmp(typeString, "region") == 0) type = AttachmentType_Region;
else if (strcmp(typeString, "mesh") == 0) else if (strcmp(typeString, "mesh") == 0)
type = AttachmentType_Mesh; type = AttachmentType_Mesh;
else if (strcmp(typeString, "linkedmesh") == 0) else if (strcmp(typeString, "linkedmesh") == 0)
type = AttachmentType_Linkedmesh; type = AttachmentType_Linkedmesh;
else if (strcmp(typeString, "boundingbox") == 0) else if (strcmp(typeString, "boundingbox") == 0)
type = AttachmentType_Boundingbox; type = AttachmentType_Boundingbox;
else if (strcmp(typeString, "path") == 0) else if (strcmp(typeString, "path") == 0)
type = AttachmentType_Path; type = AttachmentType_Path;
else if (strcmp(typeString, "clipping") == 0) else if (strcmp(typeString, "clipping") == 0)
type = AttachmentType_Clipping; type = AttachmentType_Clipping;
else if (strcmp(typeString, "point") == 0) else if (strcmp(typeString, "point") == 0)
type = AttachmentType_Point; type = AttachmentType_Point;
else { else {
delete skeletonData; delete skeletonData;
setError(root, "Unknown attachment type: ", typeString); setError(root, "Unknown attachment type: ", typeString);
return NULL; return NULL;
} }
switch (type) { switch (type) {
case AttachmentType_Region: { case AttachmentType_Region: {
Sequence *sequence = readSequence(Json::getItem(attachmentMap, "sequence")); Sequence *sequence = readSequence(Json::getItem(attachmentMap, "sequence"));
attachment = _attachmentLoader->newRegionAttachment(*skin, attachmentName, attachmentPath, sequence); attachment = _attachmentLoader->newRegionAttachment(*skin, attachmentName, attachmentPath, sequence);
@ -632,8 +632,8 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) {
bool inheritTimelines = Json::getInt(attachmentMap, "timelines", 1) ? true : false; bool inheritTimelines = Json::getInt(attachmentMap, "timelines", 1) ? true : false;
LinkedMesh *linkedMesh = new (__FILE__, __LINE__) LinkedMesh(mesh, LinkedMesh *linkedMesh = new (__FILE__, __LINE__) LinkedMesh(mesh,
String(Json::getString( String(Json::getString(
attachmentMap, attachmentMap,
"skin", 0)), "skin", 0)),
slot->getIndex(), slot->getIndex(),
String(entry->_valueString), String(entry->_valueString),
inheritTimelines); inheritTimelines);
@ -661,7 +661,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) {
int vertexCount = 0; int vertexCount = 0;
pathAttatchment->_closed = Json::getInt(attachmentMap, "closed", 0) ? true : false; pathAttatchment->_closed = Json::getInt(attachmentMap, "closed", 0) ? true : false;
pathAttatchment->_constantSpeed = Json::getInt(attachmentMap, "constantSpeed", 1) ? true pathAttatchment->_constantSpeed = Json::getInt(attachmentMap, "constantSpeed", 1) ? true
: false; : false;
vertexCount = Json::getInt(attachmentMap, "vertexCount", 0); vertexCount = Json::getInt(attachmentMap, "vertexCount", 0);
readVertices(attachmentMap, pathAttatchment, vertexCount << 1); readVertices(attachmentMap, pathAttatchment, vertexCount << 1);
@ -704,11 +704,11 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) {
_attachmentLoader->configureAttachment(attachment); _attachmentLoader->configureAttachment(attachment);
break; break;
} }
} }
skin->setAttachment(slot->getIndex(), skinAttachmentName, attachment); skin->setAttachment(slot->getIndex(), skinAttachmentName, attachment);
}
} }
}
} }
} }

View File

@ -16,7 +16,7 @@ For the official legal terms governing the Spine Runtimes, please read the [Spin
## Spine version ## 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. spine-godot supports all Spine features, except two-color tinting and the screen blend mode.
@ -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: 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 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.2-beta/3.4.4-stable/godot-editor-linux.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.2-beta/3.4.4-stable/godot-editor-macos.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.2-beta/3.4.4-stable/spine-godot-templates-4.2-beta-3.4.4-stable.tpz) * [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 ### Building the Godot editor and export templates locally

View File

@ -10,7 +10,7 @@
<groupId>com.esotericsoftware.spine</groupId> <groupId>com.esotericsoftware.spine</groupId>
<artifactId>spine-libgdx</artifactId> <artifactId>spine-libgdx</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>4.1.0-SNAPSHOT</version> <version>4.1.1-SNAPSHOT</version>
<name>spine-libgdx</name> <name>spine-libgdx</name>
@ -39,7 +39,7 @@
<connection>scm:git:https://github.com/EsotericSoftware/spine-runtimes.git</connection> <connection>scm:git:https://github.com/EsotericSoftware/spine-runtimes.git</connection>
<developerConnection>scm:git:https://github.com/EsotericSoftware/spine-runtimes.git</developerConnection> <developerConnection>scm:git:https://github.com/EsotericSoftware/spine-runtimes.git</developerConnection>
<url>https://github.com/EsotericSoftware/spine-runtimes/</url> <url>https://github.com/EsotericSoftware/spine-runtimes/</url>
<tag>4.0.02.1</tag> <tag>spine-libgdx-4.1.0</tag>
</scm> </scm>
<repositories> <repositories>

View File

@ -193,7 +193,7 @@ namespace Spine.Unity.Editor {
} }
if (changeCheck.changed) { if (changeCheck.changed) {
if (requiresReload || serializedObject.ApplyModifiedProperties()) { if (serializedObject.ApplyModifiedProperties() || requiresReload) {
this.Clear(); this.Clear();
this.InitializeEditor(); this.InitializeEditor();

View File

@ -105,7 +105,7 @@ namespace Spine.Unity.TK2D {
page.rendererObject = material; page.rendererObject = material;
region.page = page; region.page = page;
region.u = u; region.u = u;
region.u = v; region.v = v;
region.u2 = u2; region.u2 = u2;
region.v2 = v2; region.v2 = v2;
region.rotate = regionRotated; region.rotate = regionRotated;