diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-11 22:01:38 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-11 22:01:38 +0100 |
commit | 1a84f009b39c070a8d4f4931e2376936190a161e (patch) | |
tree | 7ad71362644592e95f8eeb5f331b1f7cdd3b841e | |
parent | 96e3bb9c8a368f649bfb1c60a3fe92b9d415c288 (diff) |
a
-rw-r--r-- | editor/imgui-editors.cpp | 2 | ||||
-rw-r--r-- | editor/scenery-editor.hpp | 2 | ||||
-rw-r--r-- | editor/scenery-json.cpp | 2 | ||||
-rw-r--r-- | loader/scenery.hpp | 2 | ||||
-rw-r--r-- | serialize/scenery.cpp | 3 | ||||
-rw-r--r-- | test/scenery.cpp | 2 |
6 files changed, 5 insertions, 8 deletions
diff --git a/editor/imgui-editors.cpp b/editor/imgui-editors.cpp index 595d6c77..e2f4b5c1 100644 --- a/editor/imgui-editors.cpp +++ b/editor/imgui-editors.cpp @@ -34,7 +34,7 @@ StringView scenery_type_to_string(const scenery_& sc) } StringView scenery_path(const wall_info* wa) { return wa->atlas->name(); } -StringView scenery_name(StringView, const scenery_& sc) { return sc.descr; } +StringView scenery_name(StringView, const scenery_& sc) { return sc.name; } StringView scenery_name(StringView, const vobj_& vobj) { return vobj.descr; } StringView scenery_name(StringView, const wall_info* w) { return w->name; } std::shared_ptr<anim_atlas> get_atlas(const scenery_& sc) { return sc.proto.atlas; } diff --git a/editor/scenery-editor.hpp b/editor/scenery-editor.hpp index 999e9e15..dec74b95 100644 --- a/editor/scenery-editor.hpp +++ b/editor/scenery-editor.hpp @@ -15,7 +15,7 @@ class scenery_editor final { public: struct scenery_ final { - String name, descr; + String name; scenery_proto proto; explicit operator bool() const noexcept; }; diff --git a/editor/scenery-json.cpp b/editor/scenery-json.cpp index e8b4dfec..7f832b0f 100644 --- a/editor/scenery-json.cpp +++ b/editor/scenery-json.cpp @@ -10,7 +10,7 @@ void scenery_editor::load_atlases() { _atlases.clear(); for (const auto& s : loader.sceneries()) - _atlases[s.name] = scenery_{s.name, s.descr, s.proto}; + _atlases[s.name] = scenery_{s.name, s.proto}; } } // namespace floormat diff --git a/loader/scenery.hpp b/loader/scenery.hpp index 55f3f972..eea31ad3 100644 --- a/loader/scenery.hpp +++ b/loader/scenery.hpp @@ -6,7 +6,7 @@ namespace floormat { struct serialized_scenery final { - String name, descr; + String name; scenery_proto proto; }; diff --git a/serialize/scenery.cpp b/serialize/scenery.cpp index 8cad1d9a..c3e6bda8 100644 --- a/serialize/scenery.cpp +++ b/serialize/scenery.cpp @@ -170,7 +170,6 @@ void adl_serializer<serialized_scenery>::to_json(json& j, const serialized_scene j = val.proto; const auto name = !val.name.isEmpty() ? StringView{val.name} : val.proto.atlas->name(); j["name"] = name; - j["description"] = val.descr; } void adl_serializer<serialized_scenery>::from_json(const json& j, serialized_scenery& val) @@ -178,8 +177,6 @@ void adl_serializer<serialized_scenery>::from_json(const json& j, serialized_sce val = {}; val.proto = j; val.name = j["name"]; - if (j.contains("description")) - val.descr = j["description"]; } } // namespace nlohmann diff --git a/test/scenery.cpp b/test/scenery.cpp index 5d8606b5..01f30781 100644 --- a/test/scenery.cpp +++ b/test/scenery.cpp @@ -10,7 +10,7 @@ void test_loading() { fm_assert(!loader.sceneries().isEmpty()); - for (const auto& [name, descr, proto] : loader.sceneries()) + for (const auto& [name, proto] : loader.sceneries()) fm_assert(proto.sc_type != scenery_type::none); } |