diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-12-11 02:19:12 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-12-11 02:19:12 +0100 |
commit | eaa6c76bd92e292ac59dcfa0a7aa70cd1e2f50fb (patch) | |
tree | 5110a6fe2fb70e7fbd66db70a37287c00ccf4fda /loader | |
parent | 067a3f3ae0c1ab94ace005897673a484e165b31b (diff) |
w
Diffstat (limited to 'loader')
-rw-r--r-- | loader/atlas.cpp | 1 | ||||
-rw-r--r-- | loader/json.cpp | 5 | ||||
-rw-r--r-- | loader/loader.hpp | 2 | ||||
-rw-r--r-- | loader/vobj.cpp | 1 | ||||
-rw-r--r-- | loader/wall-atlas.cpp | 7 |
5 files changed, 8 insertions, 8 deletions
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<const String> 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<std::shared_ptr<class tile_atlas>> loader_::tile_atlases(StringView filename, pass_mode p) +std::vector<std::shared_ptr<class tile_atlas>> loader_::tile_atlases(StringView filename) { auto vec = json_helper::from_json<std::vector<std::shared_ptr<class tile_atlas>>>( 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<std::shared_ptr<class tile_atlas>> tile_atlases(StringView filename, pass_mode p); + static std::vector<std::shared_ptr<class tile_atlas>> tile_atlases(StringView filename); virtual const std::vector<serialized_scenery>& 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<const vobj_info> 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<const wall_info> loader_impl::wall_atlas_list() { if (wall_atlas_map.empty()) get_wall_atlas_list(); + fm_assert(!wall_atlas_map.empty()); return wall_atlas_array; } |