diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-02-27 07:29:42 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-02-27 12:37:20 +0100 |
commit | f60c3734e38408b97e10e29a6c1d8780770d5b79 (patch) | |
tree | 20f778f31725b8960d13a04388757b2f53fa0164 /src/anim-atlas.cpp | |
parent | 48b8e559cd72c95a5f72de625a608e85026e3785 (diff) |
compat/prelude: add operator""_uz() for size_t
Diffstat (limited to 'src/anim-atlas.cpp')
-rw-r--r-- | src/anim-atlas.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/anim-atlas.cpp b/src/anim-atlas.cpp index 655bcf5e..ffade2d6 100644 --- a/src/anim-atlas.cpp +++ b/src/anim-atlas.cpp @@ -29,7 +29,7 @@ decltype(anim_atlas::_group_indices) anim_atlas::make_group_indices(const anim_d 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; const auto ngroups = a.groups.size(); - for (std::size_t i = 0; i < ngroups; i++) + for (auto i = 0_uz; i < ngroups; i++) array[rotation_to_index(a.groups[i].name)] = std::uint8_t(i); return array; } @@ -140,10 +140,10 @@ BitArray anim_atlas::make_bitmask(const ImageView2D& tex) fm_assert(tex.pixelSize() == 4); fm_assert(pixels.stride()[1] == 4); - for (std::size_t j = 0; j < height; j++) + for (auto j = 0_uz; j < height; j++) { constexpr unsigned char amin = 32; - std::size_t i = 0; + auto i = 0_uz; for (; i < width0; i += 8) { const auto src_idx = (j*stride + i*4)+3, dst_idx = (height-j-1)*width + i>>3; @@ -179,7 +179,7 @@ rotation anim_atlas::next_rotation_from(rotation r) const noexcept for (auto i = std::size_t(r)+1; i < count; i++) if (_group_indices[i] != 0xff) return rotation(i); - for (std::size_t i = 0; i < count; i++) + for (auto i = 0_uz; i < count; i++) if (_group_indices[i] != 0xff) return rotation(i); fm_abort("where did the rotations go?!"); @@ -206,7 +206,7 @@ bool anim_atlas::check_rotation(rotation r) const noexcept rotation anim_atlas::first_rotation() const noexcept { - for (std::size_t i = 0; i < rot_count; i++) + for (auto i = 0_uz; i < rot_count; i++) if (_group_indices[i] == 0) return rotation(i); fm_abort("unreachable! can't find first rotation"); |