Skip to content

Commit

Permalink
[godot] Fix compatibility with Godot 3.6, make it default build for 3…
Browse files Browse the repository at this point in the history
….x. Closes #2647
  • Loading branch information
badlogic committed Oct 1, 2024
1 parent aa932c6 commit c58d4c7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/spine-godot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true
EM_VERSION: 3.1.14
GODOT_TAG: 3.5.3-stable
GODOT_VERSION: 3.5.3.stable
GODOT_TAG: 3.6-stable
GODOT_VERSION: 3.6.stable

jobs:
godot-editor-windows:
Expand Down
4 changes: 4 additions & 0 deletions spine-godot/spine_godot/SpineAtlasResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ Error SpineAtlasResource::copy_from(const Ref<Resource> &p_resource) {
#if VERSION_MAJOR > 3
RES SpineAtlasResourceFormatLoader::load(const String &path, const String &original_path, Error *error, bool use_sub_threads, float *progress, CacheMode cache_mode) {
#else
#if VERSION_MINOR > 5
RES SpineAtlasResourceFormatLoader::load(const String &path, const String &original_path, Error *error, bool p_no_subresource_cache) {
#else
RES SpineAtlasResourceFormatLoader::load(const String &path, const String &original_path, Error *error) {
#endif
#endif
Ref<SpineAtlasResource> atlas = memnew(SpineAtlasResource);
atlas->load_from_file(path);
Expand Down
4 changes: 4 additions & 0 deletions spine-godot/spine_godot/SpineAtlasResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ class SpineAtlasResourceFormatLoader : public ResourceFormatLoader {
public:
#if VERSION_MAJOR > 3
RES load(const String &path, const String &original_path, Error *error, bool use_sub_threads, float *progress, CacheMode cache_mode) override;
#else
#if VERSION_MINOR > 5
RES load(const String &path, const String &original_path, Error *error, bool no_subresource_cache = false) override;
#else
RES load(const String &path, const String &original_path, Error *error) override;
#endif
#endif

void get_recognized_extensions(List<String> *extensions) const override;
Expand Down
4 changes: 4 additions & 0 deletions spine-godot/spine_godot/SpineSkeletonFileResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ Error SpineSkeletonFileResource::copy_from(const Ref<Resource> &p_resource) {
#if VERSION_MAJOR > 3
RES SpineSkeletonFileResourceFormatLoader::load(const String &path, const String &original_path, Error *error, bool use_sub_threads, float *progress, CacheMode cache_mode) {
#else
#if MINOR_VERSION > 5
RES SpineSkeletonFileResourceFormatLoader::load(const String &path, const String &original_path, Error *error, bool no_subresource_cache) {
#else
RES SpineSkeletonFileResourceFormatLoader::load(const String &path, const String &original_path, Error *error) {
#endif
#endif
Ref<SpineSkeletonFileResource> skeleton_file = memnew(SpineSkeletonFileResource);
skeleton_file->load_from_file(path);
Expand Down
8 changes: 6 additions & 2 deletions spine-godot/spine_godot/SpineSkeletonFileResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ class SpineSkeletonFileResourceFormatLoader : public ResourceFormatLoader {
#if VERSION_MAJOR > 3
RES load(const String &path, const String &original_path, Error *error, bool use_sub_threads, float *progress, CacheMode cache_mode);
#else
RES load(const String &path, const String &original_path, Error *error) override;
#if VERSION_MINOR > 5
RES load(const String &path, const String &original_path, Error *error, bool no_subresource_cache = false);
#else
RES load(const String &path, const String &original_path, Error *error);
#endif
#endif

void get_recognized_extensions(List<String> *extensions) const override;
Expand All @@ -82,7 +86,7 @@ class SpineSkeletonFileResourceFormatSaver : public ResourceFormatSaver {
#if VERSION_MAJOR > 3
Error save(const RES &resource, const String &path, uint32_t flags) override;
#else
Error save(const String &path, const RES &resource, uint32_t flags) override;
Error save(const String &path, const RES &resource, uint32_t flags);
#endif

void get_recognized_extensions(const RES &resource, List<String> *p_extensions) const override;
Expand Down

0 comments on commit c58d4c7

Please sign in to comment.