summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-12-01 06:57:01 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-12-01 06:57:14 +0100
commitb025c445ec226a279f7ec5d56ac320a0d53bf2cf (patch)
treeeb2395438d0ba544085d448dbf130c434a6a7c27 /src
parentc472b8d4d2719537ccf7b11f80717ca0cf3c22c2 (diff)
a
Diffstat (limited to 'src')
-rw-r--r--src/wall-atlas.cpp42
-rw-r--r--src/wall-atlas.hpp1
2 files changed, 0 insertions, 43 deletions
diff --git a/src/wall-atlas.cpp b/src/wall-atlas.cpp
index c8006b1b..d617f341 100644
--- a/src/wall-atlas.cpp
+++ b/src/wall-atlas.cpp
@@ -12,48 +12,6 @@ namespace floormat {
wall_atlas::wall_atlas() noexcept = default;
wall_atlas::~wall_atlas() noexcept = default;
-#if 0
-void wall_atlas::validate(const wall_atlas& a, const ImageView2D& img) noexcept(false)
-{
- // todo
-
- const auto pixels = img.pixels();
- const auto size = pixels.size();
- const auto width = size[1], height = size[0];
-
- fm_soft_assert(width * height > 0);
-
- for (const auto& frame : a.raw_frame_array())
- {
- fm_soft_assert(frame.offset < Vector2ui{(unsigned)width, (unsigned)height});
- fm_soft_assert((int)frame.offset.y() + iTILE_SIZE.z() <= (int)height);
- fm_soft_assert((int)frame.offset.x() < iTILE_SIZE2.x());
- // todo check frame offset + size based on wall_atlas::expected_size()
- }
-
- const auto frame_count = a.raw_frame_array().size();
- bool got_group = false;
-
- for (auto [_str, _group, tag] : Direction::groups)
- {
- const auto* dir = a.direction((size_t)tag);
- if (!dir)
- continue;
- const auto* g = a.group(dir, tag);
- if (!g)
- continue;
- got_group = true;
- fm_soft_assert(g->count > 0 == g->index < (uint32_t)-1);
- if (g->count > 0)
- {
- fm_soft_assert(g->index < frame_count);
- fm_soft_assert(g->index + g->count <= frame_count);
- }
- }
- fm_soft_assert(got_group);
-}
-#endif
-
Vector2ui wall_atlas::expected_size(unsigned depth, Group_ group)
{
constexpr auto size = Vector3ui{iTILE_SIZE};
diff --git a/src/wall-atlas.hpp b/src/wall-atlas.hpp
index 31f62388..f3b659a4 100644
--- a/src/wall-atlas.hpp
+++ b/src/wall-atlas.hpp
@@ -149,7 +149,6 @@ public:
GL::Texture2D& texture();
static size_t enum_to_index(enum rotation x);
- //static void validate(const wall_atlas& a, const ImageView2D& img) noexcept(false);
static Vector2ui expected_size(unsigned depth, Group_ group);
struct dir_tuple