diff options
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 |
