summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-10 00:57:16 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-10 01:08:25 +0100
commit2083c7ce05683c864f29b7c46de0cd874b103982 (patch)
tree596963ad23031ece5673f989b0aba8738b2cc425
parent7b544078eb0e7cad58bd6fc5251a3c185c9bb082 (diff)
loader: rename serialized_scenery -> scenery_cell
-rw-r--r--editor/scenery-json.cpp2
-rw-r--r--loader/anim-atlas.cpp (renamed from loader/anim.cpp)0
-rw-r--r--loader/impl.cpp4
-rw-r--r--loader/impl.hpp6
-rw-r--r--loader/loader.cpp2
-rw-r--r--loader/loader.hpp4
-rw-r--r--loader/scenery-cell.hpp (renamed from loader/scenery.hpp)2
-rw-r--r--loader/scenery.cpp8
-rw-r--r--serialize/old-savegame.cpp2
-rw-r--r--serialize/scenery.cpp6
-rw-r--r--serialize/scenery.hpp8
-rw-r--r--test/scenery.cpp2
12 files changed, 23 insertions, 23 deletions
diff --git a/editor/scenery-json.cpp b/editor/scenery-json.cpp
index 7f832b0f..7a31a306 100644
--- a/editor/scenery-json.cpp
+++ b/editor/scenery-json.cpp
@@ -1,7 +1,7 @@
#include "scenery-editor.hpp"
#include "serialize/scenery.hpp"
#include "loader/loader.hpp"
-#include "loader/scenery.hpp"
+#include "loader/scenery-cell.hpp"
#include <Corrade/Containers/ArrayView.h>
namespace floormat {
diff --git a/loader/anim.cpp b/loader/anim-atlas.cpp
index 6fca5a49..6fca5a49 100644
--- a/loader/anim.cpp
+++ b/loader/anim-atlas.cpp
diff --git a/loader/impl.cpp b/loader/impl.cpp
index 86e79109..12b71a9b 100644
--- a/loader/impl.cpp
+++ b/loader/impl.cpp
@@ -1,6 +1,6 @@
#include "impl.hpp"
#include "compat/assert.hpp"
-#include "scenery.hpp"
+#include "scenery-cell.hpp"
#include "wall-cell.hpp"
#include "anim-cell.hpp"
#include "ground-traits.hpp"
@@ -10,7 +10,7 @@
#include "wall-cell.hpp"
// todo scenery_traits
#include "anim-cell.hpp"
-#include "scenery.hpp"
+#include "scenery-cell.hpp"
#include "vobj-cell.hpp"
#include "atlas-loader.hpp"
#include "atlas-loader-storage.hpp"
diff --git a/loader/impl.hpp b/loader/impl.hpp
index 3520d91b..cc24981f 100644
--- a/loader/impl.hpp
+++ b/loader/impl.hpp
@@ -67,9 +67,9 @@ struct loader_impl final : loader_
const anim_cell& make_invalid_anim_atlas() override;
// >-----> scenery >----->
- std::vector<serialized_scenery> sceneries_array;
- tsl::robin_map<StringView, const serialized_scenery*> sceneries_map;
- ArrayView<const serialized_scenery> sceneries() override;
+ std::vector<scenery_cell> sceneries_array;
+ tsl::robin_map<StringView, const scenery_cell*> sceneries_map;
+ ArrayView<const scenery_cell> sceneries() override;
const scenery_proto& scenery(StringView name) noexcept(false) override;
void get_scenery_list();
diff --git a/loader/loader.cpp b/loader/loader.cpp
index 8b711206..1820b3e7 100644
--- a/loader/loader.cpp
+++ b/loader/loader.cpp
@@ -2,7 +2,7 @@
#include "ground-cell.hpp"
#include "loader/wall-cell.hpp"
#include "anim-cell.hpp"
-#include "scenery.hpp"
+#include "scenery-cell.hpp"
namespace floormat {
diff --git a/loader/loader.hpp b/loader/loader.hpp
index 8056fa8c..2da6b361 100644
--- a/loader/loader.hpp
+++ b/loader/loader.hpp
@@ -10,7 +10,7 @@ namespace Magnum::Trade { template<uint32_t> class ImageData; using ImageData2D
namespace floormat {
-struct serialized_scenery;
+struct scenery_cell;
namespace loader_detail {}
namespace Serialize {}
@@ -38,7 +38,7 @@ struct loader_
virtual void destroy() = 0;
static loader_& default_loader() noexcept;
virtual ArrayView<const ground_cell> ground_atlas_list() noexcept(false) = 0; // todo maybe try returning
- virtual ArrayView<const serialized_scenery> sceneries() = 0;
+ virtual ArrayView<const scenery_cell> sceneries() = 0;
virtual const scenery_proto& scenery(StringView name) noexcept(false) = 0;
virtual StringView startup_directory() noexcept = 0;
static StringView strip_prefix(StringView name);
diff --git a/loader/scenery.hpp b/loader/scenery-cell.hpp
index eea31ad3..8c954b5a 100644
--- a/loader/scenery.hpp
+++ b/loader/scenery-cell.hpp
@@ -4,7 +4,7 @@
namespace floormat {
-struct serialized_scenery final
+struct scenery_cell final
{
String name;
scenery_proto proto;
diff --git a/loader/scenery.cpp b/loader/scenery.cpp
index d374571c..d83cb346 100644
--- a/loader/scenery.cpp
+++ b/loader/scenery.cpp
@@ -5,7 +5,7 @@
#include "serialize/json-helper.hpp"
#include "serialize/anim.hpp"
#include "serialize/scenery.hpp"
-#include "loader/scenery.hpp"
+#include "scenery-cell.hpp"
#include "loader/anim-cell.hpp"
#include <Corrade/Containers/ArrayViewStl.h>
#include <Corrade/Utility/Path.h>
@@ -24,7 +24,7 @@ namespace floormat::loader_detail {
void loader_impl::get_scenery_list()
{
sceneries_array.clear();
- sceneries_array = json_helper::from_json<std::vector<serialized_scenery>>(Path::join(SCENERY_PATH, "scenery.json"));
+ sceneries_array = json_helper::from_json<std::vector<scenery_cell>>(Path::join(SCENERY_PATH, "scenery.json"));
if constexpr(true) // todo!
{
@@ -38,7 +38,7 @@ void loader_impl::get_scenery_list()
sceneries_map.clear();
sceneries_map.reserve(sceneries_array.size() * 2);
- for (const serialized_scenery& s : sceneries_array)
+ for (const scenery_cell& s : sceneries_array)
{
if (sceneries_map.contains(s.name))
fm_abort("duplicate scenery name '%s'", s.name.data());
@@ -48,7 +48,7 @@ void loader_impl::get_scenery_list()
fm_assert(!sceneries_map.empty());
}
-ArrayView<const serialized_scenery> loader_impl::sceneries()
+ArrayView<const scenery_cell> loader_impl::sceneries()
{
if (sceneries_array.empty()) [[likely]]
get_scenery_list();
diff --git a/serialize/old-savegame.cpp b/serialize/old-savegame.cpp
index df0cbbb5..14313f5b 100644
--- a/serialize/old-savegame.cpp
+++ b/serialize/old-savegame.cpp
@@ -4,7 +4,7 @@
#include "src/critter.hpp"
#include "src/light.hpp"
#include "loader/loader.hpp"
-#include "loader/scenery.hpp"
+#include "loader/scenery-cell.hpp"
#include "src/ground-atlas.hpp"
#include "src/anim-atlas.hpp"
#include "src/chunk-scenery.hpp"
diff --git a/serialize/scenery.cpp b/serialize/scenery.cpp
index b51fac74..8935ee3d 100644
--- a/serialize/scenery.cpp
+++ b/serialize/scenery.cpp
@@ -4,7 +4,7 @@
#include "compat/assert.hpp"
#include "loader/loader.hpp"
#include "serialize/corrade-string.hpp"
-#include "loader/scenery.hpp"
+#include "loader/scenery-cell.hpp"
#include "serialize/pass-mode.hpp"
#include "serialize/magnum-vector.hpp"
#include <Corrade/Containers/String.h>
@@ -182,7 +182,7 @@ void adl_serializer<scenery_proto>::from_json(const json& j, scenery_proto& f)
}
}
-void adl_serializer<serialized_scenery>::to_json(json& j, const serialized_scenery& val)
+void adl_serializer<scenery_cell>::to_json(json& j, const scenery_cell& val)
{
fm_soft_assert(val.proto.atlas);
j = val.proto;
@@ -190,7 +190,7 @@ void adl_serializer<serialized_scenery>::to_json(json& j, const serialized_scene
j["name"] = name;
}
-void adl_serializer<serialized_scenery>::from_json(const json& j, serialized_scenery& val)
+void adl_serializer<scenery_cell>::from_json(const json& j, scenery_cell& val)
{
val = {};
val.proto = j;
diff --git a/serialize/scenery.hpp b/serialize/scenery.hpp
index 93ceeb57..6df4a843 100644
--- a/serialize/scenery.hpp
+++ b/serialize/scenery.hpp
@@ -3,7 +3,7 @@
#include <Corrade/Containers/String.h>
#include <nlohmann/json_fwd.hpp>
-namespace floormat { struct serialized_scenery; }
+namespace floormat { struct scenery_cell; }
namespace nlohmann {
@@ -22,9 +22,9 @@ template<> struct adl_serializer<floormat::scenery_proto> {
static void from_json(const json& j, floormat::scenery_proto& val);
};
-template<> struct adl_serializer<floormat::serialized_scenery> {
- static void to_json(json& j, const floormat::serialized_scenery& val);
- static void from_json(const json& j, floormat::serialized_scenery& val);
+template<> struct adl_serializer<floormat::scenery_cell> {
+ static void to_json(json& j, const floormat::scenery_cell& val);
+ static void from_json(const json& j, floormat::scenery_cell& val);
};
} // namespace nlohmann
diff --git a/test/scenery.cpp b/test/scenery.cpp
index 42de1ab6..378d2cc1 100644
--- a/test/scenery.cpp
+++ b/test/scenery.cpp
@@ -1,6 +1,6 @@
#include "app.hpp"
#include "loader/loader.hpp"
-#include "loader/scenery.hpp"
+#include "loader/scenery-cell.hpp"
namespace floormat {