diff --git a/config.py b/config.py index 9259763..abfcee3 100644 --- a/config.py +++ b/config.py @@ -10,3 +10,7 @@ def configure(env): +def get_doc_classes(): + return [ + "Spine", + ] \ No newline at end of file diff --git a/register_types.cpp b/register_types.cpp index 91b6a6d..65f6761 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -239,13 +239,21 @@ class ResourceFormatLoaderSpine : public ResourceFormatLoader { } }; +#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4) +static Ref resource_loader_spine; +#else static ResourceFormatLoaderSpine *resource_loader_spine = NULL; +#endif void register_spine_types() { ClassDB::register_class(); ClassDB::register_class(); +#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4) + resource_loader_spine.instance(); +#else resource_loader_spine = memnew( ResourceFormatLoaderSpine ); +#endif ResourceLoader::add_resource_format_loader(resource_loader_spine); _spSetMalloc(spine_malloc); @@ -255,8 +263,16 @@ void register_spine_types() { void unregister_spine_types() { +#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4) + if (resource_loader_spine != nullptr) + { + resource_loader_spine.unref(); + } + +#else if (resource_loader_spine) memdelete(resource_loader_spine); +#endif }