diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-10 05:04:41 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-10 05:04:41 +0100 |
commit | e53afc53ae4344235736af2956630d1d4f95fdf0 (patch) | |
tree | 855c52c98ed30f0d668da8faca9d5086c581cf80 /loader | |
parent | ab26592417392195ac02586545262c87c375f20e (diff) |
a
Diffstat (limited to 'loader')
-rw-r--r-- | loader/wall-atlas.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/loader/wall-atlas.cpp b/loader/wall-atlas.cpp index 1e63a6c9..242702e3 100644 --- a/loader/wall-atlas.cpp +++ b/loader/wall-atlas.cpp @@ -25,6 +25,8 @@ using loader_detail::loader_impl; fm_soft_assert(loader.check_atlas_name(val.name)); if (j.contains("descr")) val.descr = j["descr"]; + else + val.descr = Path::split(val.name).second(); } [[maybe_unused]] static void to_json(json& j, const wall_info& val) @@ -41,7 +43,8 @@ namespace floormat::loader_detail { std::shared_ptr<wall_atlas> loader_impl::get_wall_atlas(StringView name, StringView path) { fm_assert(name != "<invalid>"_s); - auto filename = Path::join(path, name); + char buf[FILENAME_MAX]; + auto filename = make_atlas_path(buf, path, name); auto def = wall_atlas_def::deserialize(""_s.join({filename, ".json"_s})); auto tex = texture(""_s, filename, false); @@ -99,9 +102,6 @@ std::shared_ptr<class wall_atlas> loader_impl::wall_atlas(StringView name, bool goto error; } - std::unreachable(); - fm_assert(false); - missing: { // todo allocate wall_info instead |