diff --git a/spine-c/spine-c/include/spine/SlotData.h b/spine-c/spine-c/include/spine/SlotData.h index 609fd5b5c..2fa4434ea 100644 --- a/spine-c/spine-c/include/spine/SlotData.h +++ b/spine-c/spine-c/include/spine/SlotData.h @@ -51,7 +51,6 @@ typedef struct spSlotData { spColor *darkColor; spBlendMode blendMode; int/*bool*/ visible; - char *path; } spSlotData; SP_API spSlotData *spSlotData_create(const int index, const char *name, spBoneData *boneData); diff --git a/spine-c/spine-c/src/spine/SkeletonBinary.c b/spine-c/spine-c/src/spine/SkeletonBinary.c index 7135877fa..28a4b9fd3 100644 --- a/spine-c/spine-c/src/spine/SkeletonBinary.c +++ b/spine-c/spine-c/src/spine/SkeletonBinary.c @@ -57,35 +57,6 @@ typedef struct { _spLinkedMesh *linkedMeshes; } _spSkeletonBinary; -static int string_lastIndexOf(const char *str, char needle) { - if (!str) return -1; - int lastIndex = -1; - for (int i = 0; str[i] != '\0'; i++) { - if (str[i] == needle) { - lastIndex = i; - } - } - return lastIndex; -} - -static char *string_substring(const char *str, int start, int end) { - if (str == NULL || start > end || start < 0) { - return NULL; - } - - int len = end - start; - char *substr = MALLOC(char, len + 1); - if (substr == NULL) { - return NULL; - } - - strncpy(substr, str + start, len); - substr[len] = '\0'; - - return substr; -} - - static int string_starts_with(const char *str, const char *needle) { int lenStr, lenNeedle, i; if (!str) return 0; @@ -1437,14 +1408,6 @@ spSkeletonData *spSkeletonBinary_readSkeletonData(spSkeletonBinary *self, const skeletonData->slots = MALLOC(spSlotData *, skeletonData->slotsCount); for (i = 0; i < skeletonData->slotsCount; ++i) { char *slotName = readString(input); - char *pathName = NULL; - if (nonessential) { - int slash = string_lastIndexOf(slotName, '/'); - if (slash != -1) { - pathName = string_substring(slotName, 0, slash); - slotName = string_substring(slotName, slash + 1, strlen(slotName)); - } - } spBoneData *boneData = skeletonData->bones[readVarint(input, 1)]; spSlotData *slotData = spSlotData_create(i, slotName, boneData); FREE(slotName); @@ -1464,7 +1427,6 @@ spSkeletonData *spSkeletonBinary_readSkeletonData(spSkeletonBinary *self, const slotData->blendMode = (spBlendMode) readVarint(input, 1); if (nonessential) { slotData->visible = readBoolean(input); - slotData->path = pathName; } skeletonData->slots[i] = slotData; } diff --git a/spine-c/spine-c/src/spine/SkeletonJson.c b/spine-c/spine-c/src/spine/SkeletonJson.c index 557953eb6..7cee3b90c 100644 --- a/spine-c/spine-c/src/spine/SkeletonJson.c +++ b/spine-c/spine-c/src/spine/SkeletonJson.c @@ -1041,34 +1041,6 @@ static int string_starts_with(const char *str, const char *needle) { return -1; } -static int string_lastIndexOf(const char *str, char needle) { - if (!str) return -1; - int lastIndex = -1; - for (int i = 0; str[i] != '\0'; i++) { - if (str[i] == needle) { - lastIndex = i; - } - } - return lastIndex; -} - -static char *string_substring(const char *str, int start, int end) { - if (str == NULL || start > end || start < 0) { - return NULL; - } - - int len = end - start; - char *substr = MALLOC(char, len + 1); - if (substr == NULL) { - return NULL; - } - - strncpy(substr, str + start, len); - substr[len] = '\0'; - - return substr; -} - spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char *json) { int i, ii; spSkeletonData *skeletonData; @@ -1192,13 +1164,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char return NULL; } - char *pathName = NULL; char *slotName = (char *) Json_getString(slotMap, "name", NULL); - int slash = string_lastIndexOf(slotName, '/'); - if (slash != -1) { - pathName = string_substring(slotName, 0, slash); - slotName = string_substring(slotName, slash + 1, strlen(slotName)); - } data = spSlotData_create(i, slotName, boneData); color = Json_getString(slotMap, "color", 0); @@ -1234,7 +1200,6 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char } data->visible = Json_getInt(slotMap, "visible", -1); - data->path = pathName; skeletonData->slots[i] = data; skeletonData->slotsCount++; } diff --git a/spine-cpp/spine-cpp/include/spine/SlotData.h b/spine-cpp/spine-cpp/include/spine/SlotData.h index f942b7d3a..045198b05 100644 --- a/spine-cpp/spine-cpp/include/spine/SlotData.h +++ b/spine-cpp/spine-cpp/include/spine/SlotData.h @@ -109,10 +109,6 @@ namespace spine { void setVisible(bool inValue); - String &getPath() { return _path; } - - void setPath(const String &inValue) { _path = inValue; } - private: const int _index; String _name; @@ -124,7 +120,6 @@ namespace spine { String _attachmentName; BlendMode _blendMode; bool _visible; - String _path; }; } diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp index 07b491219..50cc2b008 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp @@ -176,14 +176,6 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons skeletonData->_slots.setSize(slotsCount, 0); for (int i = 0; i < slotsCount; ++i) { String slotName = String(readString(input), true); - String pathName = ""; - if (nonessential) { - int slash = slotName.lastIndexOf('/'); - if (slash != -1) { - pathName = slotName.substring(0, slash); - slotName = slotName.substring(slash + 1); - } - } BoneData *boneData = skeletonData->_bones[readVarint(input, true)]; SlotData *slotData = new (__FILE__, __LINE__) SlotData(i, slotName, *boneData); @@ -200,7 +192,6 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons slotData->_blendMode = static_cast(readVarint(input, true)); if (nonessential) { slotData->_visible = readBoolean(input); - slotData->_path = pathName; } skeletonData->_slots[i] = slotData; } diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp index 5f20a4973..5fc636f40 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp @@ -241,13 +241,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { return NULL; } - String pathName = ""; String slotName = String(Json::getString(slotMap, "name", 0)); - int slash = slotName.lastIndexOf('/'); - if (slash != -1) { - pathName = slotName.substring(0, slash); - slotName = slotName.substring(slash + 1); - } data = new (__FILE__, __LINE__) SlotData(i, slotName, *boneData); color = Json::getString(slotMap, "color", 0); @@ -281,7 +275,6 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { data->_blendMode = BlendMode_Screen; } data->_visible = Json::getBoolean(slotMap, "visible", true); - data->_path = pathName; skeletonData->_slots[i] = data; } }