diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-08 08:27:59 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-08 08:29:12 +0100 |
commit | 6bf9eefac1ce5e17efeb344d498499d38ae64296 (patch) | |
tree | 1b44a0c206905566083fcbc98dd5c3e493ea2847 /draw | |
parent | ab31f0ed81301c23d6847f3ca1513d4b90275de7 (diff) |
draw: add some asserts
Diffstat (limited to 'draw')
-rw-r--r-- | draw/anim.cpp | 1 | ||||
-rw-r--r-- | draw/floor.cpp | 1 | ||||
-rw-r--r-- | draw/wall.cpp | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/draw/anim.cpp b/draw/anim.cpp index df3011da..6c7bb965 100644 --- a/draw/anim.cpp +++ b/draw/anim.cpp @@ -54,6 +54,7 @@ void anim_mesh::draw(tile_shader& shader, chunk& c) anim_atlas* bound = nullptr; [[maybe_unused]] std::size_t draw_count = 0; + fm_debug_assert(std::size_t(mesh_.count()) == size*quad_index_count); const auto do_draw = [&](std::size_t i, anim_atlas* atlas, std::uint32_t max_index, bool force) { if (!force && atlas == last.atlas) diff --git a/draw/floor.cpp b/draw/floor.cpp index 5b5a515f..fe585977 100644 --- a/draw/floor.cpp +++ b/draw/floor.cpp @@ -19,6 +19,7 @@ void floor_mesh::draw(tile_shader& shader, chunk& c) GL::MeshView mesh{mesh_}; [[maybe_unused]] std::size_t draw_count = 0; + fm_debug_assert(std::size_t(mesh_.count()) == size*quad_index_count); const auto do_draw = [&](std::size_t i, tile_atlas* atlas, std::uint32_t max_index) { if (atlas == last.atlas) diff --git a/draw/wall.cpp b/draw/wall.cpp index 85365844..51b91705 100644 --- a/draw/wall.cpp +++ b/draw/wall.cpp @@ -21,6 +21,7 @@ void wall_mesh::draw(tile_shader& shader, chunk& c) struct { tile_atlas* atlas = nullptr; std::size_t pos = 0; } last; GL::MeshView mesh{mesh_}; [[maybe_unused]] std::size_t draw_count = 0; + fm_debug_assert(std::size_t(mesh_.count()) == size*quad_index_count); const auto do_draw = [&](std::size_t i, tile_atlas* atlas, std::uint32_t max_index) { if (atlas == last.atlas) |