From c72ea8c652fc3535f20d6bd1723c7ca30ce1412e Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Fri, 10 Jun 2022 15:00:12 +0200 Subject: [PATCH] [godot] Fix incorrect altas utf8 string length, closes #2094. --- spine-godot/spine_godot/SpineAnimationTrack.cpp | 1 - spine-godot/spine_godot/SpineAtlasResource.cpp | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-godot/spine_godot/SpineAnimationTrack.cpp b/spine-godot/spine_godot/SpineAnimationTrack.cpp index 31ad2039d..e67f391ca 100644 --- a/spine-godot/spine_godot/SpineAnimationTrack.cpp +++ b/spine-godot/spine_godot/SpineAnimationTrack.cpp @@ -274,7 +274,6 @@ void SpineAnimationTrack::update_animation_state(const Variant &variant_sprite) auto animation_player_path = scene_path.rel_path_to(animation_player->get_path()); for (int i = 0; i < edited_animation->get_track_count(); i++) { auto path = edited_animation->track_get_path(i); - auto node = Node::get_node_or_null(path); if (path == animation_player_path) { found_track_index = i; break; diff --git a/spine-godot/spine_godot/SpineAtlasResource.cpp b/spine-godot/spine_godot/SpineAtlasResource.cpp index b7da1d80b..1fd685786 100644 --- a/spine-godot/spine_godot/SpineAtlasResource.cpp +++ b/spine-godot/spine_godot/SpineAtlasResource.cpp @@ -161,7 +161,8 @@ Error SpineAtlasResource::load_from_atlas_file(const String &path) { clear(); texture_loader = new GodotSpineTextureLoader(&textures, &normal_maps, normal_map_prefix); - atlas = new spine::Atlas(atlas_data.utf8(), atlas_data.size(), source_path.get_base_dir().utf8(), texture_loader); + auto atlas_utf8 = atlas_data.utf8(); + atlas = new spine::Atlas(atlas_utf8, atlas_utf8.length(), source_path.get_base_dir().utf8(), texture_loader); if (atlas) return OK; clear();