summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wall-atlas.cpp19
-rw-r--r--src/wall-atlas.hpp2
2 files changed, 11 insertions, 10 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);
}
diff --git a/src/wall-atlas.hpp b/src/wall-atlas.hpp
index 333dd47c..4832047e 100644
--- a/src/wall-atlas.hpp
+++ b/src/wall-atlas.hpp
@@ -149,7 +149,7 @@ public:
static size_t enum_to_index(enum rotation x);
//static void validate(const wall_atlas& a, const ImageView2D& img) noexcept(false);
- static Vector2i expected_size(unsigned depth, Group_ group);
+ static Vector2ui expected_size(unsigned depth, Group_ group);
struct dir_tuple
{