diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-10 16:04:57 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-10 16:04:57 +0100 |
commit | 8dfa3d885b34f9d9cc20b47890268cedb9fb217f (patch) | |
tree | 208400aa58f825730fc6220dea76eb1780e8122f /loader | |
parent | b1d66390ca5d11e48f58bb87f49b0f9da5338ca0 (diff) |
flush it
Diffstat (limited to 'loader')
-rw-r--r-- | loader/loader-impl.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
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 <filesystem> #include <unordered_map> #include <utility> #include <optional> +#include <Corrade/Containers/Pair.h> #include <Corrade/Containers/ArrayViewStl.h> #include <Corrade/Containers/StringView.h> #include <Corrade/Containers/StringStlHash.h> @@ -137,10 +137,7 @@ std::shared_ptr<anim_atlas> 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<Serialize::anim>(p); - p.replace_extension({}); + auto anim_info = json_helper::from_json<Serialize::anim>(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<anim_atlas> 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<struct anim_atlas>(p.string(), tex, std::move(anim_info)); + auto atlas = std::make_shared<struct anim_atlas>(Path::splitExtension(path).first(), tex, std::move(anim_info)); return anim_atlas_map[atlas->name()] = atlas; } } |