From ee1a527191db646850ee919b8fe3a6f8cb6cd693 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 10 Nov 2022 21:27:08 +0100 Subject: get rid of std::string --- loader/loader-impl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'loader') diff --git a/loader/loader-impl.cpp b/loader/loader-impl.cpp index 03144f30..5d137eca 100644 --- a/loader/loader-impl.cpp +++ b/loader/loader-impl.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -41,7 +40,7 @@ struct loader_impl final : loader_ Containers::Pointer tga_importer = importer_plugins.loadAndInstantiate("TgaImporter"); - std::unordered_map> tile_atlas_map; + std::unordered_map> tile_atlas_map; std::unordered_map> anim_atlas_map; std::vector anim_atlases; @@ -79,7 +78,7 @@ std::shared_ptr loader_impl::tile_atlas(StringView name, Vector2ub s return it->second; auto image = texture(FM_IMAGE_PATH, name); auto atlas = std::make_shared(name, image, size); - tile_atlas_map[name] = atlas; + tile_atlas_map[atlas->name()] = atlas; return atlas; } @@ -140,7 +139,7 @@ std::shared_ptr loader_impl::anim_atlas(StringView name) auto anim_info = json_helper::from_json(Path::splitExtension(path).first() + ".json"); auto tex = texture("", path); - fm_assert(!anim_info.anim_name.empty() && !anim_info.object_name.empty()); + fm_assert(!anim_info.anim_name.isEmpty() && !anim_info.object_name.isEmpty()); fm_assert(anim_info.pixel_size.product() > 0); fm_assert(!anim_info.groups.empty()); fm_assert(anim_info.nframes > 0); -- cgit v1.2.3