From eaa6c76bd92e292ac59dcfa0a7aa70cd1e2f50fb Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 11 Dec 2023 02:19:12 +0100 Subject: w --- loader/atlas.cpp | 1 + loader/json.cpp | 5 +---- loader/loader.hpp | 2 +- loader/vobj.cpp | 1 + loader/wall-atlas.cpp | 7 ++++--- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'loader') diff --git a/loader/atlas.cpp b/loader/atlas.cpp index e811e61e..de1d8e15 100644 --- a/loader/atlas.cpp +++ b/loader/atlas.cpp @@ -74,6 +74,7 @@ ArrayView loader_impl::anim_atlas_list() { if (anim_atlases.empty()) get_anim_atlas_list(); + fm_assert(!anim_atlases.empty()); return anim_atlases; } diff --git a/loader/json.cpp b/loader/json.cpp index 007bafeb..e9da0339 100644 --- a/loader/json.cpp +++ b/loader/json.cpp @@ -54,13 +54,10 @@ const scenery_proto& loader_impl::scenery(StringView name) noexcept(false) namespace floormat { -std::vector> loader_::tile_atlases(StringView filename, pass_mode p) +std::vector> loader_::tile_atlases(StringView filename) { auto vec = json_helper::from_json>>( Path::join(loader_::IMAGE_PATH, filename)); - for (auto& x : vec) - if (!x->pass_mode()) - x->set_pass_mode(p); return vec; } diff --git a/loader/loader.hpp b/loader/loader.hpp index a7dd8a7f..e7824aa5 100644 --- a/loader/loader.hpp +++ b/loader/loader.hpp @@ -38,7 +38,7 @@ struct loader_ static void destroy(); static loader_& default_loader() noexcept; // todo move to ArrayView later, make non-static, and remove pass_mode - static std::vector> tile_atlases(StringView filename, pass_mode p); + static std::vector> tile_atlases(StringView filename); virtual const std::vector& sceneries() = 0; virtual const scenery_proto& scenery(StringView name) noexcept(false) = 0; virtual StringView startup_directory() noexcept = 0; diff --git a/loader/vobj.cpp b/loader/vobj.cpp index b48275ab..9aa6fb39 100644 --- a/loader/vobj.cpp +++ b/loader/vobj.cpp @@ -91,6 +91,7 @@ ArrayView loader_impl::vobj_list() { if (vobjs.empty()) get_vobj_list(); + fm_assert(!vobjs.empty()); return vobjs; } diff --git a/loader/wall-atlas.cpp b/loader/wall-atlas.cpp index 745c5eb8..9d5c8c2b 100644 --- a/loader/wall-atlas.cpp +++ b/loader/wall-atlas.cpp @@ -25,15 +25,15 @@ using nlohmann::json; val = {}; val.name = j["name"]; fm_soft_assert(loader.check_atlas_name(val.name)); - if (j.contains("description")) - val.descr = j["description"]; + if (j.contains("descr")) + val.descr = j["descr"]; } [[maybe_unused]] static void to_json(json& j, const wall_info& val) { j["name"] = val.name; if (val.descr) - j["description"] = val.descr; + j["descr"] = val.descr; } } // namespace floormat @@ -112,6 +112,7 @@ ArrayView loader_impl::wall_atlas_list() { if (wall_atlas_map.empty()) get_wall_atlas_list(); + fm_assert(!wall_atlas_map.empty()); return wall_atlas_array; } -- cgit v1.2.3