From 2fbcff178a848bb768cb22b1eeff98e70387e31b Mon Sep 17 00:00:00 2001 From: JCash Date: Fri, 10 Dec 2021 14:22:12 +0100 Subject: [PATCH] Updated to use new component type macro --- defold-spine/src/comp_spine_model.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/defold-spine/src/comp_spine_model.cpp b/defold-spine/src/comp_spine_model.cpp index 435458e..c6aea26 100644 --- a/defold-spine/src/comp_spine_model.cpp +++ b/defold-spine/src/comp_spine_model.cpp @@ -919,7 +919,7 @@ namespace dmSpine } } - static dmGameObject::Result CompSpineModelRegister(const dmGameObject::ComponentTypeCreateCtx* ctx, dmGameObject::ComponentType* type) + static dmGameObject::Result ComponentType_Create(const dmGameObject::ComponentTypeCreateCtx* ctx, dmGameObject::ComponentType* type) { SpineModelContext* spinemodelctx = new SpineModelContext; spinemodelctx->m_Factory = ctx->m_Factory; @@ -957,6 +957,13 @@ namespace dmSpine return dmGameObject::RESULT_OK; } + static dmGameObject::Result ComponentType_Destroy(const dmGameObject::ComponentTypeCreateCtx* ctx, dmGameObject::ComponentType* type) + { + SpineModelContext* spinemodelctx = (SpineModelContext*)ComponentTypeGetContext(type); + delete spinemodelctx; + return dmGameObject::RESULT_OK; + } + // ****************************************************************************** // SCRIPTING HELPER FUNCTIONS // ****************************************************************************** @@ -1028,4 +1035,4 @@ namespace dmSpine } } -DM_DECLARE_COMPONENT_TYPE(ComponentTypeSpineModelExt, "spinemodelc", dmSpine::CompSpineModelRegister); +DM_DECLARE_COMPONENT_TYPE(ComponentTypeSpineModelExt, "spinemodelc", dmSpine::ComponentType_Create, dmSpine::ComponentType_Destroy);