summaryrefslogtreecommitdiffhomepage
path: root/loader
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-12-22 10:07:08 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-12-22 10:07:08 +0100
commit424701126b5613badc23dd7354b26294dc1c6c93 (patch)
treed7d87af8c659fde18fdf269ec2cade08e229abfc /loader
parentdba52df4581329a692d889d76cb7f093e7e3f7d9 (diff)
a
Diffstat (limited to 'loader')
-rw-r--r--loader/wall-atlas.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/loader/wall-atlas.cpp b/loader/wall-atlas.cpp
index 2e4d3704..4f13e91a 100644
--- a/loader/wall-atlas.cpp
+++ b/loader/wall-atlas.cpp
@@ -19,6 +19,7 @@
namespace floormat {
using nlohmann::json;
+using loader_detail::loader_impl;
[[maybe_unused]] static void from_json(const json& j, wall_info& val)
{
@@ -42,8 +43,9 @@ namespace floormat::loader_detail {
std::shared_ptr<wall_atlas> loader_impl::get_wall_atlas(StringView name, StringView path)
{
- auto def = wall_atlas_def::deserialize(""_s.join({path, ".json"_s}));
- auto tex = texture(""_s, path);
+ auto filename = Path::join(path, name);
+ auto def = wall_atlas_def::deserialize(""_s.join({filename, ".json"_s}));
+ auto tex = texture(""_s, filename, false);
fm_soft_assert(name == def.header.name);
fm_soft_assert(!def.frames.empty());
@@ -101,6 +103,7 @@ void loader_impl::get_wall_atlas_list()
for (auto& x : wall_atlas_array)
{
fm_soft_assert(check_atlas_name(x.name));
+ x.atlas = get_wall_atlas(x.name, WALL_TILESET_PATH);
StringView name = x.name;
wall_atlas_map[name] = &x;
fm_debug_assert(name.data() == wall_atlas_map[name]->name.data());