diff --git a/cocos/spine/skeleton-cache.ts b/cocos/spine/skeleton-cache.ts index ed1cbd4629a..df85fea5169 100644 --- a/cocos/spine/skeleton-cache.ts +++ b/cocos/spine/skeleton-cache.ts @@ -357,10 +357,9 @@ class SkeletonCache { public getSkeletonCache (uuid: string, skeletonData: spine.SkeletonData): SkeletonCacheItemInfo { let skeletonInfo = this._skeletonCache[uuid]; if (!skeletonInfo) { - const skeleton = null; //new spine.Skeleton(skeletonData); - const clipper = null; //new spine.SkeletonClipping(); - //const stateData = null; //new spine.AnimationStateData(skeleton.data); - const state = null; //new spine.AnimationState(stateData); + const skeleton = null; + const clipper = null; + const state = null; const listener = new TrackEntryListeners(); this._skeletonCache[uuid] = skeletonInfo = { diff --git a/cocos/spine/skeleton-system.ts b/cocos/spine/skeleton-system.ts index 4d003e15f2e..88d9e9ae64f 100644 --- a/cocos/spine/skeleton-system.ts +++ b/cocos/spine/skeleton-system.ts @@ -74,12 +74,10 @@ export class SkeletonSystem extends System { } } - index = 0; postUpdate (dt: number): void { if (!this._skeletons) { return; } - this.index++; if (!EDITOR_NOT_IN_PREVIEW) spine.SkeletonSystem.updateAnimation(dt); this._skeletons.forEach((skeleton) => { skeleton.updateAnimation(dt); diff --git a/native/cocos/editor-support/spine-wasm/spine-model.cpp b/native/cocos/editor-support/spine-wasm/spine-model.cpp index 8692b3e6f7a..b191eca7968 100644 --- a/native/cocos/editor-support/spine-wasm/spine-model.cpp +++ b/native/cocos/editor-support/spine-wasm/spine-model.cpp @@ -9,41 +9,6 @@ SpineModel::~SpineModel() { SpineModel::data = nullptr; } -/* -void SpineModel::addSlotMesh(SlotMesh& mesh, bool needMerge) { - bool canMerge = false; - auto count = meshArray.size(); - if (needMerge && count >= 1) { - auto* lastMesh = &meshArray[count - 1]; - if (lastMesh->blendMode == mesh.blendMode && lastMesh->textureID == mesh.textureID) { - canMerge = true; - lastMesh->vCount += mesh.vCount; - lastMesh->iCount += mesh.iCount; - } - } - if (!canMerge) { - auto mergeMesh = SlotMesh(mesh.vBuf, mesh.iBuf, mesh.vCount, mesh.iCount); - mergeMesh.blendMode = mesh.blendMode; - mergeMesh.textureID = mesh.textureID; - meshArray.push_back(mergeMesh); - } - auto indexCount = mesh.iCount; - uint16_t* iiPtr = mesh.iBuf; - for (uint16_t i = 0; i < indexCount; i++) { - iiPtr[i] += vCount; - } - - auto vertexCount = mesh.vCount; - float* floatPtr = (float*)mesh.vBuf; - int floatStride = this->byteStride / 4; - for (int i = 0; i < vertexCount; i++) { - floatPtr[floatStride * i + 2] = 0; - } - vCount += vertexCount; - iCount += indexCount; -} -*/ - void SpineModel::addSlotMesh(SlotMesh& mesh, bool needMerge) { bool canMerge = false; auto count = data->size(); @@ -81,10 +46,6 @@ void SpineModel::addSlotMesh(SlotMesh& mesh, bool needMerge) { } void SpineModel::clearMeshes() { - //for (auto it = meshArray.begin(); it != meshArray.end(); ++it) { - // delete &(*it); - //} - //meshArray.clear(); data->resize(0); vCount = 0; iCount = 0; @@ -94,10 +55,6 @@ std::vector* SpineModel::getData() { return data; } -//std::vector* SpineModel::getMeshes() { -// return &meshArray; -//} - void SpineModel::setBufferPtr(uint8_t* vp, uint16_t* ip) { vPtr = (uint32_t)vp; iPtr = (uint32_t)ip; diff --git a/native/cocos/editor-support/spine-wasm/spine-model.h b/native/cocos/editor-support/spine-wasm/spine-model.h index e8af1d1e019..bb278bc856d 100644 --- a/native/cocos/editor-support/spine-wasm/spine-model.h +++ b/native/cocos/editor-support/spine-wasm/spine-model.h @@ -35,7 +35,6 @@ class SpineModel { void setBufferPtr(uint8_t* vp, uint16_t* ip); std::vector* data; std::vector* getData(); - //std::vector* getMeshes(); public: uint32_t vCount; @@ -43,8 +42,6 @@ class SpineModel { uint32_t vPtr; uint32_t iPtr; uint32_t byteStride; - //std::vector meshArray{}; - }; #endif \ No newline at end of file diff --git a/native/cocos/editor-support/spine-wasm/spine-type-export.cpp b/native/cocos/editor-support/spine-wasm/spine-type-export.cpp index 445f4f9a26f..d6ecbbd8df9 100644 --- a/native/cocos/editor-support/spine-wasm/spine-type-export.cpp +++ b/native/cocos/editor-support/spine-wasm/spine-type-export.cpp @@ -22,27 +22,6 @@ const spine::String STRING_STD2SP(const std::string &str) { return spString; } -/* -template -std::vector VECTOR_SP2STD(Vector &container) { - int count = container.size(); - std::vector stdVector(count); - for (int i = 0; i < count; i++) { - stdVector[i] = container[i]; - } - return stdVector; -} - -std::vector VECTOR_SP2STD_SIZE_T(Vector &container) { - int count = container.size(); - std::vector stdVector(count); - for (int i = 0; i < count; i++) { - stdVector[i] = container[i]; - } - return stdVector; -} -*/ - const std::vector VECTOR_SP2STD_STRING(Vector &container) { int count = container.size(); std::vector stdVector(count); @@ -52,29 +31,6 @@ const std::vector VECTOR_SP2STD_STRING(Vector &container) { return stdVector; } -/* -template -std::vector> VECTOR_2_SP2STD(Vector> &container) { - int count = container.size(); - std::vector> stdVector(count); - for (int i = 0; i < count; i++) { - stdVector[i] = VECTOR_SP2STD(container[i]); - } - return stdVector; -} - - -template -std::vector VECTOR_SP2STD2(Vector container) { - int count = container.size(); - std::vector stdVector(count); - for (int i = 0; i < count; i++) { - stdVector[i] = container[i]; - } - return stdVector; -} -*/ - template Vector VECTOR_STD2SP(std::vector &container) { int count = container.size(); @@ -126,9 +82,6 @@ using SPVectorTimelinePtr = Vector; using SPVectorTrackEntryPtr = Vector; using SPVectorUpdatablePtr = Vector; -//using SPVectorEntry = Vector; -//using SPVectorVectorEntry = Vector>; - } // namespace EMSCRIPTEN_BINDINGS(spine) { @@ -348,31 +301,7 @@ EMSCRIPTEN_BINDINGS(spine) { .function("set", &Vector2::set) .function("length", &Vector2::length) .function("normalize", &Vector2::normalize); -/* - class_("SPVectorEntry") - .function("size", &SPVectorEntry::size) - .function("get", &SPVectorEntry::operator[], allow_raw_pointers()); - - class_("SPVectorVectorEntry") - .function("size", &SPVectorVectorEntry::size) - .function("get", &SPVectorVectorEntry::operator[], allow_raw_pointers()); - - - class_("AttachmentMap") - .function("get", &Skin::AttachmentMap::get, allow_raw_pointers()); - - - class_("Entries") - .function("hasNext", &Skin::AttachmentMap::Entries::hasNext) - .function("next", &Skin::AttachmentMap::Entries::next); - value_object("Entry") - //.constructor<>() - //.constructor() - .field("_slotIndex",&Skin::AttachmentMap::Entry::_slotIndex) - .field("_name",&Skin::AttachmentMap::Entry::_name); - ///.field("_attachment", &Skin::AttachmentMap::Entry::_attachment, allow_raw_pointer()); - */ class_("String") .function("length", &String::length) .function("isEmpty", &String::isEmpty) @@ -1645,9 +1574,7 @@ EMSCRIPTEN_BINDINGS(spine) { .property("iCount", &SpineModel::iCount) .property("vPtr", &SpineModel::vPtr) .property("iPtr", &SpineModel::iPtr) - //.property("data", &SpineModel::data, allow_raw_pointer>()); .function("getData", &SpineModel::getData, allow_raw_pointer>()); - //.function("getMeshes", &SpineModel::getMeshes, allow_raw_pointer>()); class_("SpineDebugShape") .property("type", &SpineDebugShape::type)