Skip to content

Commit

Permalink
Merge pull request #14 from defold/update-1-2-191
Browse files Browse the repository at this point in the history
Updated to use new DM_DECLARE_COMPONENT_TYPE macro from 1.2.191
  • Loading branch information
JCash authored Dec 29, 2021
2 parents 1bafbda + 2fbcff1 commit 117b98c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions defold-spine/src/comp_spine_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
// ******************************************************************************
Expand Down Expand Up @@ -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);

0 comments on commit 117b98c

Please sign in to comment.