From 8dfa3d885b34f9d9cc20b47890268cedb9fb217f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 10 Nov 2022 16:04:57 +0100 Subject: flush it --- loader/loader-impl.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'loader') diff --git a/loader/loader-impl.cpp b/loader/loader-impl.cpp index 6b2fe986..03144f30 100644 --- a/loader/loader-impl.cpp +++ b/loader/loader-impl.cpp @@ -5,10 +5,10 @@ #include "src/anim-atlas.hpp" #include "serialize/json-helper.hpp" #include "serialize/anim.hpp" -#include #include #include #include +#include #include #include #include @@ -137,10 +137,7 @@ std::shared_ptr loader_impl::anim_atlas(StringView name) else { const auto path = Path::join(FM_ANIM_PATH, name); - std::filesystem::path p = std::string_view{path}; - p.replace_extension("json"); - auto anim_info = json_helper::from_json(p); - p.replace_extension({}); + 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()); @@ -149,7 +146,7 @@ std::shared_ptr loader_impl::anim_atlas(StringView name) fm_assert(anim_info.nframes > 0); fm_assert(anim_info.nframes == 1 || anim_info.fps > 0); - auto atlas = std::make_shared(p.string(), tex, std::move(anim_info)); + auto atlas = std::make_shared(Path::splitExtension(path).first(), tex, std::move(anim_info)); return anim_atlas_map[atlas->name()] = atlas; } } -- cgit v1.2.3