Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions native/cocos/editor-support/spine-wasm/spine-wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ using namespace spine;
HashMap<SkeletonData *, HashMap<Attachment *, AttachmentVertices *>*> spineAttachmentVerticesMap{};
HashMap<SkeletonData *, HashMap<spine::String, spine::String>*> spineTexturesMap{};

#ifdef CC_SPINE_VERSION_4_2
HashMap<SkeletonData *, Atlas*> spineAtlasMap{};
#endif


static const uint16_t quadTriangles[6] = {0, 1, 2, 2, 3, 0};

Expand Down Expand Up @@ -193,7 +197,12 @@ SkeletonData* SpineWasmUtil::createSpineSkeletonDataWithJson(const String& jsonS

saveAttachmentVertices(skeletonData, textureNames, textureUUIDs);
}
#ifdef CC_SPINE_VERSION_3_8
delete atlas;
#else
spineAtlasMap.put(skeletonData, atlas);
#endif

#endif

return skeletonData;
Expand Down Expand Up @@ -222,7 +231,12 @@ SkeletonData* SpineWasmUtil::createSpineSkeletonDataWithBinary(uint32_t byteSize

saveAttachmentVertices(skeletonData, textureNames, textureUUIDs);
}
#ifdef CC_SPINE_VERSION_3_8
delete atlas;
#else
spineAtlasMap.put(skeletonData, atlas);
#endif

#endif
return skeletonData;
}
Expand All @@ -249,6 +263,10 @@ void SpineWasmUtil::destroySpineSkeletonDataWithUUID(const String& uuid) {

spineAttachmentVerticesMap.remove(data);
}
#ifndef CC_SPINE_VERSION_3_8
auto* atlas = spineAtlasMap[data];
delete atlas;
#endif
delete data;
skeletonDataMap.remove(uuid);
}
Expand Down
2 changes: 1 addition & 1 deletion native/external-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"type": "github",
"owner": "cocos",
"name": "cocos-engine-external",
"checkout": "v4.0.0-2"
"checkout": "v4.0.0-3"
}
}
Loading