summaryrefslogtreecommitdiffhomepage
path: root/src/wall-atlas.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-11-27 09:59:46 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-11-27 09:59:46 +0100
commit8171d7f7cbc097c58a2097e14ce814d6a97d54bf (patch)
treec47d6e8b2dd7af82db0fa7c4cbfd19266986ec38 /src/wall-atlas.cpp
parent5f3d184276f6b4e13642018681cf33d2bc5b7638 (diff)
a
Diffstat (limited to 'src/wall-atlas.cpp')
-rw-r--r--src/wall-atlas.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/wall-atlas.cpp b/src/wall-atlas.cpp
index 721b7906..c8006b1b 100644
--- a/src/wall-atlas.cpp
+++ b/src/wall-atlas.cpp
@@ -54,27 +54,28 @@ void wall_atlas::validate(const wall_atlas& a, const ImageView2D& img) noexcept(
}
#endif
-Vector2i wall_atlas::expected_size(unsigned depth, Group_ group)
+Vector2ui wall_atlas::expected_size(unsigned depth, Group_ group)
{
- static_assert(iTILE_SIZE2.x() == iTILE_SIZE2.y());
- constexpr int half_tile = iTILE_SIZE2.x()/2;
+ constexpr auto size = Vector3ui{iTILE_SIZE};
+ constexpr auto half_tile = size.x()/2u;
+ static_assert(size.x() == size.y());
- fm_assert(depth > 0 && depth < 1<<16);
+ fm_assert(depth > 0 && depth < 1<<15);
CORRADE_ASSUME(group < Group_::COUNT);
- using enum Group_;
switch (group)
{
+ using enum Group_;
case overlay:
case wall:
- return { iTILE_SIZE.x(), iTILE_SIZE.z() };
+ return { size.x(), size.z() };
case top:
case side:
- return { (int)depth, iTILE_SIZE.z() };
+ return { depth, size.z() };
case corner_L:
- return { half_tile, iTILE_SIZE.z() };
+ return { half_tile, size.z() };
case corner_R:
- return { iTILE_SIZE2.x() - half_tile, iTILE_SIZE.z() };
+ return { size.x() - half_tile, size.z() };
default:
fm_assert(false);
}