summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-07-24 08:26:14 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-07-24 08:26:14 +0200
commitcb2693700af90ebbd47d2026d69580b307008393 (patch)
treeae86a08371a746e35374ab12d83856923f87c964 /src
parent968905a4056d1ab7b13f15817a03f3e6dbb3fbea (diff)
now rename at_offset_() to at_offset()
Diffstat (limited to 'src')
-rw-r--r--src/chunk-walls.cpp14
-rw-r--r--src/chunk.cpp4
-rw-r--r--src/chunk.hpp4
3 files changed, 11 insertions, 11 deletions
diff --git a/src/chunk-walls.cpp b/src/chunk-walls.cpp
index 665390da..7d744ff9 100644
--- a/src/chunk-walls.cpp
+++ b/src/chunk-walls.cpp
@@ -186,27 +186,27 @@ GL::Mesh chunk::make_wall_mesh()
if (!is_west)
{
- if (auto t = at_offset_(pos, {-1, 0}); !(t && t->wall_north_atlas()))
+ if (auto t = at_offset(pos, {-1, 0}); !(t && t->wall_north_atlas()))
{
if (_walls->atlases[k+1]) // west on same tile
pillar_ok = true;
- if (auto t = at_offset_(pos, {0, -1}); t && t->wall_west_atlas())
+ if (auto t = at_offset(pos, {0, -1}); t && t->wall_west_atlas())
corner_ok = true;
}
if (side_ok)
- if (auto t = at_offset_(pos, {1, -1}); t && t->wall_west_atlas())
+ if (auto t = at_offset(pos, {1, -1}); t && t->wall_west_atlas())
side_ok = false;
if (side_ok)
- if (auto t = at_offset_(pos, {1, -1}); t && t->wall_west_atlas())
+ if (auto t = at_offset(pos, {1, -1}); t && t->wall_west_atlas())
side_ok = false;
}
else
{
- if (auto t = at_offset_(pos, {0, -1}); !(t && t->wall_west_atlas()))
- if (auto t = at_offset_(pos, {-1, 0}); t && t->wall_north_atlas())
+ if (auto t = at_offset(pos, {0, -1}); !(t && t->wall_west_atlas()))
+ if (auto t = at_offset(pos, {-1, 0}); t && t->wall_north_atlas())
corner_ok = true;
if (side_ok)
- if (auto t = at_offset_(pos, {-1, 1}); t && t->wall_north_atlas())
+ if (auto t = at_offset(pos, {-1, 1}); t && t->wall_north_atlas())
side_ok = false;
}
diff --git a/src/chunk.cpp b/src/chunk.cpp
index c116d991..0cb42ef6 100644
--- a/src/chunk.cpp
+++ b/src/chunk.cpp
@@ -41,7 +41,7 @@ tile_proto chunk::operator[](local_coords xy) const noexcept { return operator[]
chunk_coords_ chunk::coord() const noexcept { return _coord; }
-Optional<tile_ref> chunk::at_offset_(local_coords pos, Vector2i off)
+Optional<tile_ref> chunk::at_offset(local_coords pos, Vector2i off)
{
const auto coord = global_coords{_coord, pos};
const auto coord2 = coord + off;
@@ -56,7 +56,7 @@ Optional<tile_ref> chunk::at_offset_(local_coords pos, Vector2i off)
}
}
-Optional<tile_ref> chunk::at_offset_(tile_ref r, Vector2i off) { return at_offset_(local_coords{r.index()}, off); }
+Optional<tile_ref> chunk::at_offset(tile_ref r, Vector2i off) { return at_offset(local_coords{r.index()}, off); }
void chunk::mark_ground_modified() noexcept
{
diff --git a/src/chunk.hpp b/src/chunk.hpp
index cb5dca51..65730d42 100644
--- a/src/chunk.hpp
+++ b/src/chunk.hpp
@@ -34,8 +34,8 @@ public:
tile_proto operator[](local_coords xy) const noexcept;
chunk_coords_ coord() const noexcept;
- Optional<tile_ref> at_offset_(local_coords pos, Vector2i off);
- Optional<tile_ref> at_offset_(tile_ref r, Vector2i off);
+ Optional<tile_ref> at_offset(local_coords pos, Vector2i off);
+ Optional<tile_ref> at_offset(tile_ref r, Vector2i off);
using iterator = tile_iterator;
using const_iterator = tile_const_iterator;