diff --git a/.github/workflows/spine-godot-extension-v4-all.yml b/.github/workflows/spine-godot-extension-v4-all.yml index b17f436be..a70b6f21d 100644 --- a/.github/workflows/spine-godot-extension-v4-all.yml +++ b/.github/workflows/spine-godot-extension-v4-all.yml @@ -14,8 +14,8 @@ jobs: matrix: version: [ + {"tag": "4.5.1-stable", "version": "4.5.1.stable", "dev": false}, {"tag": "4.4.1-stable", "version": "4.4.1.stable", "dev": false}, - {"tag": "4.3-stable", "version": "4.3.stable", "dev": false}, ] uses: ./.github/workflows/spine-godot-extension-v4.yml with: diff --git a/.github/workflows/spine-godot-v4-all.yml b/.github/workflows/spine-godot-v4-all.yml index 64ca66cee..d4ae741c9 100644 --- a/.github/workflows/spine-godot-v4-all.yml +++ b/.github/workflows/spine-godot-v4-all.yml @@ -14,10 +14,10 @@ jobs: matrix: version: [ + {"tag": "4.5.1-stable", "version": "4.5.1.stable", "mono": false}, + {"tag": "4.5.1-stable", "version": "4.5.1.stable", "mono": true}, {"tag": "4.4.1-stable", "version": "4.4.1.stable", "mono": false}, {"tag": "4.4.1-stable", "version": "4.4.1.stable", "mono": true}, - {"tag": "4.3-stable", "version": "4.3.stable", "mono": false}, - {"tag": "4.3-stable", "version": "4.3.stable", "mono": true}, ] uses: ./.github/workflows/spine-godot-v4.yml with: diff --git a/spine-godot/spine_godot/SpineAtlasResource.cpp b/spine-godot/spine_godot/SpineAtlasResource.cpp index 5a1c774a5..4d10d3dac 100644 --- a/spine-godot/spine_godot/SpineAtlasResource.cpp +++ b/spine-godot/spine_godot/SpineAtlasResource.cpp @@ -300,7 +300,8 @@ Error SpineAtlasResource::load_from_atlas_file_internal(const String &path, bool clear(); texture_loader = new GodotSpineTextureLoader(&textures, &normal_maps, &specular_maps, normal_map_prefix, specular_map_prefix, is_importing); auto atlas_utf8 = atlas_data.utf8(); - atlas = new spine::Atlas(atlas_utf8, atlas_utf8.length(), source_path.get_base_dir().utf8(), texture_loader); + auto dir_utf8 = source_path.get_base_dir().utf8(); + atlas = new spine::Atlas(atlas_utf8.ptr(), atlas_utf8.length(), dir_utf8.ptr(), texture_loader); if (atlas) return OK; clear(); @@ -343,7 +344,8 @@ Error SpineAtlasResource::load_from_file(const String &path) { clear(); texture_loader = new GodotSpineTextureLoader(&textures, &normal_maps, &specular_maps, normal_map_prefix, specular_map_prefix, false); auto utf8 = atlas_data.utf8(); - atlas = new spine::Atlas(utf8.ptr(), utf8.size(), source_path.get_base_dir().utf8(), texture_loader); + auto dir_utf8 = source_path.get_base_dir().utf8(); + atlas = new spine::Atlas(utf8.ptr(), utf8.size(), dir_utf8.ptr(), texture_loader); if (atlas) return OK; clear(); diff --git a/spine-godot/spine_godot/SpineCommon.h b/spine-godot/spine_godot/SpineCommon.h index 1cacf556b..0843473cd 100644 --- a/spine-godot/spine_godot/SpineCommon.h +++ b/spine-godot/spine_godot/SpineCommon.h @@ -109,8 +109,8 @@ using namespace godot; return ret; \ } -#define SPINE_STRING(x) spine::String((x).utf8()) -#define SPINE_STRING_TMP(x) spine::String((x).utf8(), true, false) +#define SPINE_STRING(x) spine::String((x).utf8().ptr()) +#define SPINE_STRING_TMP(x) spine::String((x).utf8().ptr(), true, false) // Can't do template classes with Godot's object model :( class SpineObjectWrapper : public REFCOUNTED { diff --git a/spine-godot/spine_godot/SpineEditorPlugin.cpp b/spine-godot/spine_godot/SpineEditorPlugin.cpp index 36050faea..fe48777d2 100644 --- a/spine-godot/spine_godot/SpineEditorPlugin.cpp +++ b/spine-godot/spine_godot/SpineEditorPlugin.cpp @@ -27,8 +27,6 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#define VERSION_MAJOR 4 - #ifdef TOOLS_ENABLED #include "SpineEditorPlugin.h" #include "SpineAtlasResource.h" diff --git a/spine-godot/spine_godot/SpineEditorPlugin.h b/spine-godot/spine_godot/SpineEditorPlugin.h index e6964ee62..ea1aacd01 100644 --- a/spine-godot/spine_godot/SpineEditorPlugin.h +++ b/spine-godot/spine_godot/SpineEditorPlugin.h @@ -44,9 +44,14 @@ #include #else #include "editor/editor_node.h" +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) +#include "editor/inspector/editor_properties.h" +#include "editor/inspector/editor_properties_array_dict.h" +#else #include "editor/editor_properties.h" #include "editor/editor_properties_array_dict.h" #endif +#endif class SpineAtlasResourceImportPlugin : public EditorImportPlugin { GDCLASS(SpineAtlasResourceImportPlugin, EditorImportPlugin) diff --git a/spine-godot/spine_godot/SpineEvent.cpp b/spine-godot/spine_godot/SpineEvent.cpp index e36764142..109abbc77 100644 --- a/spine-godot/spine_godot/SpineEvent.cpp +++ b/spine-godot/spine_godot/SpineEvent.cpp @@ -85,7 +85,7 @@ String SpineEvent::get_string_value() { void SpineEvent::set_string_value(const String &v) { SPINE_CHECK(get_spine_object(), ) - get_spine_object()->setStringValue(spine::String(v.utf8())); + get_spine_object()->setStringValue(spine::String(v.utf8().ptr())); } float SpineEvent::get_volume() { diff --git a/spine-godot/spine_godot/SpineEventData.cpp b/spine-godot/spine_godot/SpineEventData.cpp index a0845f89d..ca1026546 100644 --- a/spine-godot/spine_godot/SpineEventData.cpp +++ b/spine-godot/spine_godot/SpineEventData.cpp @@ -84,7 +84,7 @@ String SpineEventData::get_string_value() { void SpineEventData::set_string_value(const String &v) { SPINE_CHECK(get_spine_object(), ) - get_spine_object()->setStringValue(spine::String(v.utf8())); + get_spine_object()->setStringValue(spine::String(v.utf8().ptr())); } String SpineEventData::get_audio_path() { @@ -94,7 +94,7 @@ String SpineEventData::get_audio_path() { void SpineEventData::set_audio_path(const String &v) { SPINE_CHECK(get_spine_object(), ) - get_spine_object()->setAudioPath(spine::String(v.utf8())); + get_spine_object()->setAudioPath(spine::String(v.utf8().ptr())); } float SpineEventData::get_volume() { diff --git a/spine-godot/spine_godot/SpineSkeletonDataResource.cpp b/spine-godot/spine_godot/SpineSkeletonDataResource.cpp index 3042a7398..eedd9498a 100644 --- a/spine-godot/spine_godot/SpineSkeletonDataResource.cpp +++ b/spine-godot/spine_godot/SpineSkeletonDataResource.cpp @@ -52,9 +52,13 @@ #ifdef SPINE_GODOT_EXTENSION #include #else +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) +#include "editor/file_system/editor_file_system.h" +#else #include "editor/editor_file_system.h" #endif #endif +#endif void SpineAnimationMix::_bind_methods() { ClassDB::bind_method(D_METHOD("set_from", "from"), @@ -339,7 +343,7 @@ void SpineSkeletonDataResource::load_resources(spine::Atlas *atlas, spine::SkeletonData *data; if (!EMPTY(json)) { spine::SkeletonJson skeletonJson(atlas); - data = skeletonJson.readSkeletonData(json.utf8()); + data = skeletonJson.readSkeletonData(json.utf8().ptr()); if (!data) { ERR_PRINT(String("Error while loading skeleton data: ") + get_path()); ERR_PRINT(String("Error message: ") + skeletonJson.getError().buffer()); diff --git a/spine-godot/spine_godot/SpineSkeletonFileResource.cpp b/spine-godot/spine_godot/SpineSkeletonFileResource.cpp index 1872fc19e..87d9e43f6 100644 --- a/spine-godot/spine_godot/SpineSkeletonFileResource.cpp +++ b/spine-godot/spine_godot/SpineSkeletonFileResource.cpp @@ -135,7 +135,7 @@ Error SpineSkeletonFileResource::load_from_file(const String &path) { json = FileAccess::get_file_as_string(path, &error); if (error != OK) return error; #endif - if (!checkJson(json.utf8())) return ERR_INVALID_DATA; + if (!checkJson(json.utf8().ptr())) return ERR_INVALID_DATA; } else { #ifdef SPINE_GODOT_EXTENSION binary = FileAccess::get_file_as_bytes(path);