From da535a6d4340083d7e69b9635f28223955a0b07b Mon Sep 17 00:00:00 2001 From: Hipreme Date: Wed, 12 Jan 2022 15:08:42 -0300 Subject: [PATCH 1/2] Added support for v3.4.3 --- config.py | 4 ++++ register_types.cpp | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) 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..1f801c5 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -239,13 +239,21 @@ class ResourceFormatLoaderSpine : public ResourceFormatLoader { } }; +#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4 && VERSION_PATCH == 3) +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 && VERSION_PATCH == 3) + 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 && VERSION_PATCH == 3) + if (resource_loader_spine != nullptr) + { + resource_loader_spine.unref(); + } + +#else if (resource_loader_spine) memdelete(resource_loader_spine); +#endif } From 002bcaec9f83124d6421f0ba3c1bf0cb70f516b3 Mon Sep 17 00:00:00 2001 From: Marcelo Silva Nascimento Mancini Date: Thu, 14 Apr 2022 10:28:00 -0300 Subject: [PATCH 2/2] Update register_types.cpp Ignore #if PATCH. --- register_types.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/register_types.cpp b/register_types.cpp index 1f801c5..65f6761 100644 --- a/register_types.cpp +++ b/register_types.cpp @@ -239,7 +239,7 @@ class ResourceFormatLoaderSpine : public ResourceFormatLoader { } }; -#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4 && VERSION_PATCH == 3) +#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4) static Ref resource_loader_spine; #else static ResourceFormatLoaderSpine *resource_loader_spine = NULL; @@ -249,7 +249,7 @@ void register_spine_types() { ClassDB::register_class(); ClassDB::register_class(); -#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4 && VERSION_PATCH == 3) +#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4) resource_loader_spine.instance(); #else resource_loader_spine = memnew( ResourceFormatLoaderSpine ); @@ -263,7 +263,7 @@ void register_spine_types() { void unregister_spine_types() { -#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4 && VERSION_PATCH == 3) +#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4) if (resource_loader_spine != nullptr) { resource_loader_spine.unref();