summaryrefslogtreecommitdiffhomepage
path: root/serialize
diff options
context:
space:
mode:
Diffstat (limited to 'serialize')
-rw-r--r--serialize/ground-atlas.cpp (renamed from serialize/tile-atlas.cpp)12
-rw-r--r--serialize/ground-atlas.hpp (renamed from serialize/tile-atlas.hpp)8
-rw-r--r--serialize/tile.cpp4
-rw-r--r--serialize/world-reader.cpp8
-rw-r--r--serialize/world-writer.cpp2
5 files changed, 17 insertions, 17 deletions
diff --git a/serialize/tile-atlas.cpp b/serialize/ground-atlas.cpp
index 88385339..76c8686e 100644
--- a/serialize/tile-atlas.cpp
+++ b/serialize/ground-atlas.cpp
@@ -1,5 +1,5 @@
-#include "src/tile-atlas.hpp"
-#include "serialize/tile-atlas.hpp"
+#include "src/ground-atlas.hpp"
+#include "serialize/ground-atlas.hpp"
#include "serialize/corrade-string.hpp"
#include "serialize/magnum-vector.hpp"
#include "loader/loader.hpp"
@@ -25,7 +25,7 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(proxy, name, size)
namespace nlohmann {
-void adl_serializer<std::shared_ptr<tile_atlas>>::to_json(json& j, const std::shared_ptr<const tile_atlas>& x)
+void adl_serializer<std::shared_ptr<ground_atlas>>::to_json(json& j, const std::shared_ptr<const ground_atlas>& x)
{
using nlohmann::to_json;
if (!x)
@@ -34,7 +34,7 @@ void adl_serializer<std::shared_ptr<tile_atlas>>::to_json(json& j, const std::sh
to_json(j, proxy{x->name(), x->num_tiles2(), x->pass_mode()});
}
-void adl_serializer<std::shared_ptr<tile_atlas>>::from_json(const json& j, std::shared_ptr<tile_atlas>& val)
+void adl_serializer<std::shared_ptr<ground_atlas>>::from_json(const json& j, std::shared_ptr<ground_atlas>& val)
{
if (j.is_null())
val = nullptr;
@@ -43,10 +43,10 @@ void adl_serializer<std::shared_ptr<tile_atlas>>::from_json(const json& j, std::
using nlohmann::from_json;
proxy x;
from_json(j, x);
- pass_mode p = tile_atlas::default_pass_mode;
+ pass_mode p = ground_atlas::default_pass_mode;
if (j.contains("pass-mode"))
p = j["pass-mode"];
- val = loader.tile_atlas(x.name, x.size, p);
+ val = loader.ground_atlas(x.name, x.size, p);
if (auto p2 = val->pass_mode(); p2 != p)
{
const auto name = val->name();
diff --git a/serialize/tile-atlas.hpp b/serialize/ground-atlas.hpp
index 0c65c55e..344e8714 100644
--- a/serialize/tile-atlas.hpp
+++ b/serialize/ground-atlas.hpp
@@ -1,14 +1,14 @@
#pragma once
-#include "src/tile-atlas.hpp"
+#include "src/ground-atlas.hpp"
#include <memory>
#include <nlohmann/json_fwd.hpp>
namespace nlohmann {
template<>
-struct adl_serializer<std::shared_ptr<floormat::tile_atlas>> final {
- static void to_json(json& j, const std::shared_ptr<const floormat::tile_atlas>& x);
- static void from_json(const json& j, std::shared_ptr<floormat::tile_atlas>& x);
+struct adl_serializer<std::shared_ptr<floormat::ground_atlas>> final {
+ static void to_json(json& j, const std::shared_ptr<const floormat::ground_atlas>& x);
+ static void from_json(const json& j, std::shared_ptr<floormat::ground_atlas>& x);
};
} // namespace nlohmann
diff --git a/serialize/tile.cpp b/serialize/tile.cpp
index 69cec8a2..cd9064a8 100644
--- a/serialize/tile.cpp
+++ b/serialize/tile.cpp
@@ -1,8 +1,8 @@
#include "serialize/tile.hpp"
#include "src/tile.hpp"
#include "src/global-coords.hpp"
-#include "serialize/tile-atlas.hpp"
-#include "src/tile-atlas.hpp"
+#include "serialize/ground-atlas.hpp"
+#include "src/ground-atlas.hpp"
#include <tuple>
#include <nlohmann/json.hpp>
diff --git a/serialize/world-reader.cpp b/serialize/world-reader.cpp
index 05b880b8..5e66616b 100644
--- a/serialize/world-reader.cpp
+++ b/serialize/world-reader.cpp
@@ -7,7 +7,7 @@
#include "src/light.hpp"
#include "loader/loader.hpp"
#include "loader/scenery.hpp"
-#include "src/tile-atlas.hpp"
+#include "src/ground-atlas.hpp"
#include "src/anim-atlas.hpp"
#include "src/chunk-scenery.hpp"
#include "compat/strerror.hpp"
@@ -215,9 +215,9 @@ void reader_state::read_chunks(reader_t& s)
? s.read<uint8_t>()
: uint8_t(s.read<uint16_t>());
auto name = lookup_atlas(id);
- if constexpr(std::is_same_v<tile_atlas, T>)
+ if constexpr(std::is_same_v<ground_atlas, T>)
{
- auto atlas = loader.tile_atlas(name);
+ auto atlas = loader.ground_atlas(name);
fm_soft_assert(v < atlas->num_tiles());
return { atlas, v };
}
@@ -232,7 +232,7 @@ void reader_state::read_chunks(reader_t& s)
SET_CHUNK_SIZE();
//t.passability() = pass_mode(flags & pass_mask);
if (flags & meta_ground)
- t.ground() = make_atlas.operator()<tile_atlas>();
+ t.ground() = make_atlas.operator()<ground_atlas>();
if (flags & meta_wall_n)
t.wall_north() = make_atlas.operator()<wall_atlas>();
if (flags & meta_wall_w)
diff --git a/serialize/world-writer.cpp b/serialize/world-writer.cpp
index a89f039a..e32d3cdf 100644
--- a/serialize/world-writer.cpp
+++ b/serialize/world-writer.cpp
@@ -1,6 +1,6 @@
#define FM_SERIALIZE_WORLD_IMPL
#include "world-impl.hpp"
-#include "src/tile-atlas.hpp"
+#include "src/ground-atlas.hpp"
#include "src/wall-atlas.hpp"
#include "binary-writer.inl"
#include "src/global-coords.hpp"