Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for v3.4.3 #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ def configure(env):



def get_doc_classes():
return [
"Spine",
]
16 changes: 16 additions & 0 deletions register_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,21 @@ class ResourceFormatLoaderSpine : public ResourceFormatLoader {
}
};

#if (VERSION_MAJOR == 3 && VERSION_MINOR == 4)
static Ref<ResourceFormatLoaderSpine> resource_loader_spine;
#else
static ResourceFormatLoaderSpine *resource_loader_spine = NULL;
#endif

void register_spine_types() {

ClassDB::register_class<Spine>();
ClassDB::register_class<Spine::SpineResource>();
#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);
Expand All @@ -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

}

Expand Down