diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-03 16:28:59 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-03 16:28:59 +0100 |
commit | 903bff00419464cf4f683ed8ed12877f90aecb6d (patch) | |
tree | 8ec6562488e9758c3e2e62f04cc90eb4e396ceb6 /src | |
parent | 4d444201a168a2d07b77cd48032e9f813df9c4fc (diff) |
.
Diffstat (limited to 'src')
-rw-r--r-- | src/wall-atlas.cpp | 3 | ||||
-rw-r--r-- | src/wall-atlas.hpp | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/wall-atlas.cpp b/src/wall-atlas.cpp index 9b711f60..685125cd 100644 --- a/src/wall-atlas.cpp +++ b/src/wall-atlas.cpp @@ -47,7 +47,8 @@ StringView wall_atlas::name() const { return _info.name; } ArrayView<const wall_frame> wall_frames::items(const wall_atlas& a) const { - fm_debug_assert(index != (uint32_t)-1); + fm_assert(index < a.array().size()); + fm_debug_assert(count != (uint32_t)-1); return { a.array() + index, count }; } diff --git a/src/wall-atlas.hpp b/src/wall-atlas.hpp index 02d0ce91..4706a47b 100644 --- a/src/wall-atlas.hpp +++ b/src/wall-atlas.hpp @@ -18,13 +18,15 @@ struct wall_frame struct wall_frames { - uint32_t index = (uint32_t)-1, count = (uint32_t)-1; + ArrayView<const wall_frame> items(const wall_atlas& a) const; + + uint32_t index = (uint32_t)-1, count = (uint32_t)-1; // not serialized + Vector2ui pixel_size; Color4 tint_mult{1,1,1,1}; Color3 tint_add; uint8_t from_rotation = (uint8_t)-1; bool mirrored : 1 = false; - ArrayView<const wall_frame> items(const wall_atlas& a) const; }; struct wall_frame_set |