[godot] Fix incorrect altas utf8 string length, closes #2094.

This commit is contained in:
Mario Zechner 2022-06-10 15:00:12 +02:00
parent 63065eefed
commit c72ea8c652
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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();