summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-12-01 14:35:55 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-12-01 14:36:31 +0100
commitcc7d22803c50c1df9fc22e3ac91efd428bd5090d (patch)
tree980eca810274274bc41c474baa19b924ec051ce8
parent81f68a2c83c0c25259cd526c8bb4839caa361e8f (diff)
tile: remove '_image' stuffix from tile_proto accessors
-rw-r--r--serialize/world-writer.cpp6
-rw-r--r--src/tile.cpp16
-rw-r--r--src/tile.hpp8
3 files changed, 15 insertions, 15 deletions
diff --git a/serialize/world-writer.cpp b/serialize/world-writer.cpp
index 2754f26f..fb1eee85 100644
--- a/serialize/world-writer.cpp
+++ b/serialize/world-writer.cpp
@@ -285,7 +285,7 @@ void writer_state::serialize_chunk(const chunk& c, chunk_coords coord)
for (std::size_t i = 0; i < TILE_COUNT; i++)
{
const tile_proto x = c[i];
- const auto ground = x.ground_image(), wall_north = x.wall_north_image(), wall_west = x.wall_west_image();
+ const auto ground = x.ground(), wall_north = x.wall_north(), wall_west = x.wall_west();
const auto scenery = x.scenery_frame;
fm_debug_assert(s.bytes_written() + tile_size <= chunkbuf_size);
@@ -293,7 +293,7 @@ void writer_state::serialize_chunk(const chunk& c, chunk_coords coord)
auto img_g = maybe_intern_atlas(ground);
auto img_n = maybe_intern_atlas(wall_north);
auto img_w = maybe_intern_atlas(wall_west);
- auto [sc, img_s, sc_exact] = maybe_intern_scenery(x.scenery_image(), true);
+ auto [sc, img_s, sc_exact] = maybe_intern_scenery(x.scenery(), true);
tilemeta flags = {};
flags |= meta_ground * (img_g != null_atlas);
@@ -378,7 +378,7 @@ ArrayView<const char> writer_state::serialize_world()
for (const auto& [_, c] : _world->chunks())
for (auto [x, _k, _pt] : c)
- maybe_intern_scenery(x.scenery_image(), false);
+ maybe_intern_scenery(x.scenery(), false);
for (const auto& [pos, c] : _world->chunks())
{
diff --git a/src/tile.cpp b/src/tile.cpp
index 56ac5746..b9ed5ab6 100644
--- a/src/tile.cpp
+++ b/src/tile.cpp
@@ -30,16 +30,16 @@ pass_mode_ref::operator pass_mode() const noexcept
}
bool operator==(const tile_proto& a, const tile_proto& b) noexcept {
- return a.ground_image() == b.ground_image() &&
- a.wall_north_image() == b.wall_north_image() &&
- a.wall_west_image() == b.wall_west_image() &&
- a.scenery_image() == b.scenery_image();
+ return a.ground() == b.ground() &&
+ a.wall_north() == b.wall_north() &&
+ a.wall_west() == b.wall_west() &&
+ a.scenery() == b.scenery();
};
-tile_image_proto tile_proto::ground_image() const noexcept { return { ground_atlas, ground_variant }; }
-tile_image_proto tile_proto::wall_north_image() const noexcept { return { wall_north_atlas, wall_north_variant }; }
-tile_image_proto tile_proto::wall_west_image() const noexcept { return { wall_west_atlas, wall_west_variant }; }
-scenery_proto tile_proto::scenery_image() const noexcept { return { scenery_atlas, scenery_frame }; }
+tile_image_proto tile_proto::ground() const noexcept { return { ground_atlas, ground_variant }; }
+tile_image_proto tile_proto::wall_north() const noexcept { return { wall_north_atlas, wall_north_variant }; }
+tile_image_proto tile_proto::wall_west() const noexcept { return { wall_west_atlas, wall_west_variant }; }
+scenery_proto tile_proto::scenery() const noexcept { return { scenery_atlas, scenery_frame }; }
tile_ref::tile_ref(struct chunk& c, std::uint8_t i) noexcept : _chunk{&c}, i{i} {}
diff --git a/src/tile.hpp b/src/tile.hpp
index dc635da6..23b50161 100644
--- a/src/tile.hpp
+++ b/src/tile.hpp
@@ -30,10 +30,10 @@ struct tile_proto final
scenery scenery_frame;
enum pass_mode pass_mode = pass_mode::pass_shoot_through;
- tile_image_proto ground_image() const noexcept;
- tile_image_proto wall_north_image() const noexcept;
- tile_image_proto wall_west_image() const noexcept;
- scenery_proto scenery_image() const noexcept;
+ tile_image_proto ground() const noexcept;
+ tile_image_proto wall_north() const noexcept;
+ tile_image_proto wall_west() const noexcept;
+ scenery_proto scenery() const noexcept;
friend bool operator==(const tile_proto& a, const tile_proto& b) noexcept;
};