summaryrefslogtreecommitdiffhomepage
path: root/loader
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-22 18:46:52 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-22 18:46:52 +0100
commit51ebc370743b07926ce0a50232a1a65c6b6b27b5 (patch)
tree9c38ee65e32c6a760065ef33fe078847d7ea2d48 /loader
parenta917bb7c28b383c3c684bf75732188bfff0060bb (diff)
finally it works
Diffstat (limited to 'loader')
-rw-r--r--loader/atlas.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/loader/atlas.cpp b/loader/atlas.cpp
index 4a5c6cfa..fdafc39e 100644
--- a/loader/atlas.cpp
+++ b/loader/atlas.cpp
@@ -5,6 +5,7 @@
#include "src/anim-atlas.hpp"
#include <Corrade/Containers/ArrayViewStl.h>
#include <Corrade/Containers/Pair.h>
+#include <Corrade/Containers/StridedArrayView.h>
#include <Corrade/Containers/StringView.h>
#include <Corrade/Utility/Path.h>
#include <Magnum/Trade/ImageData.h>
@@ -40,6 +41,10 @@ std::shared_ptr<anim_atlas> loader_impl::anim_atlas(StringView name)
fm_assert(!anim_info.groups.empty());
fm_assert(anim_info.nframes > 0);
fm_assert(anim_info.nframes == 1 || anim_info.fps > 0);
+ const auto size = tex.pixels().size();
+ const auto width = size[1], height = size[0];
+ using Vector2uz = Math::Vector2<std::size_t>;
+ fm_assert(Vector2uz{anim_info.pixel_size} == Vector2uz(width, height));
auto atlas = std::make_shared<struct anim_atlas>(path, tex, std::move(anim_info));
return anim_atlas_map[atlas->name()] = atlas;