summaryrefslogtreecommitdiffhomepage
path: root/src/tile-atlas.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-28 18:31:18 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-28 18:31:18 +0200
commit1b84fc144f77c4ebef6fdc0a476410420e0a95b3 (patch)
tree62d019065f4e704ca33b8808e6d76b2fec640da1 /src/tile-atlas.cpp
parent7c02d3b8f1e6ec4ee82bdf1220da431b1cd1231e (diff)
refactoring work
Diffstat (limited to 'src/tile-atlas.cpp')
-rw-r--r--src/tile-atlas.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tile-atlas.cpp b/src/tile-atlas.cpp
index 533cc8e9..e6df942f 100644
--- a/src/tile-atlas.cpp
+++ b/src/tile-atlas.cpp
@@ -1,5 +1,7 @@
#include "tile-atlas.hpp"
#include "compat/assert.hpp"
+#include "tile-image.hpp"
+#include <limits>
#include <Corrade/Containers/StringView.h>
#include <Magnum/Math/Color.h>
#include <Magnum/ImageView.h>
@@ -11,6 +13,7 @@ tile_atlas::tile_atlas(StringView name, const ImageView2D& image, Vector2ub tile
texcoords_{make_texcoords_array(Vector2ui(image.size()), tile_count)},
name_{name}, size_{image.size()}, dims_{tile_count}
{
+ fm_assert(num_tiles() <= std::numeric_limits<decltype(tile_image::variant)>::max());
fm_assert(dims_[0] > 0 && dims_[1] > 0);
fm_assert(size_ % Vector2ui{tile_count} == Vector2ui());
tex_.setWrapping(GL::SamplerWrapping::ClampToEdge)