diff --git a/cocos2d-x/cocos/editor-support/spine/Skin.h b/cocos2d-x/cocos/editor-support/spine/Skin.h index b7e0c865..9b8606ad 100644 --- a/cocos2d-x/cocos/editor-support/spine/Skin.h +++ b/cocos2d-x/cocos/editor-support/spine/Skin.h @@ -32,6 +32,8 @@ #include #include +#include +#include namespace spine { class Attachment; diff --git a/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_conversions.hpp b/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_conversions.hpp index 85e7c98a..5b6dd5d1 100644 --- a/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_conversions.hpp +++ b/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_conversions.hpp @@ -672,32 +672,6 @@ bool seval_to_spine_Vector_T_ptr(const se::Value& v, spine::Vector* ret) return true; } -bool spine_skin_attachments_to_seval(std::vector>& v, se::Value* ret) { - assert(ret != nullptr); - bool ok = true; - se::HandleObject arr(se::Object::createArrayObject(v.size())); - - int i = 0; - - for (const auto &vv : v) - { - se::HandleObject obj(se::Object::createPlainObject()); - - se::Value tmp; - for (const auto& e : vv) { - native_ptr_to_rooted_seval(e.second, &tmp); - obj->setProperty(e.first.c_str(), tmp); - } - - arr->setArrayElement(i, se::Value(obj)); - i++; - } - - ret->setObject(arr, true); - - return ok; -} - bool seval_to_spine_Vector_String(const se::Value& v, spine::Vector* ret); bool spine_Vector_String_to_seval(const spine::Vector& v, se::Value* ret); #endif diff --git a/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_spine_manual.cpp b/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_spine_manual.cpp index 1d780c62..dcac720c 100644 --- a/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_spine_manual.cpp +++ b/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_spine_manual.cpp @@ -235,6 +235,32 @@ static bool js_register_spine_retainSkeletonData(se::State& s) } SE_BIND_FUNC(js_register_spine_retainSkeletonData) +bool spine_skin_attachments_to_seval(std::vector>& v, se::Value* ret) { + assert(ret != nullptr); + bool ok = true; + se::HandleObject arr(se::Object::createArrayObject(v.size())); + + int i = 0; + + for (const auto &vv : v) + { + se::HandleObject obj(se::Object::createPlainObject()); + + se::Value tmp; + for (const auto& e : vv) { + native_ptr_to_rooted_seval(e.second, &tmp); + obj->setProperty(e.first.c_str(), tmp); + } + + arr->setArrayElement(i, se::Value(obj)); + i++; + } + + ret->setObject(arr, true); + + return ok; +} + static bool js_cocos2dx_spine_Skin_getAttachmentsForJSB(se::State& s) { spine::Skin* cobj = (spine::Skin*)s.nativeThisObject(); SE_PRECONDITION2(