summaryrefslogtreecommitdiffhomepage
path: root/draw/anim.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-02-27 07:29:42 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-02-27 12:37:20 +0100
commitf60c3734e38408b97e10e29a6c1d8780770d5b79 (patch)
tree20f778f31725b8960d13a04388757b2f53fa0164 /draw/anim.cpp
parent48b8e559cd72c95a5f72de625a608e85026e3785 (diff)
compat/prelude: add operator""_uz() for size_t
Diffstat (limited to 'draw/anim.cpp')
-rw-r--r--draw/anim.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/draw/anim.cpp b/draw/anim.cpp
index 1e0d1bc4..acde5279 100644
--- a/draw/anim.cpp
+++ b/draw/anim.cpp
@@ -68,12 +68,12 @@ void anim_mesh::draw(tile_shader& shader, chunk& c)
Optional<last_> last;
const auto max_index = std::uint32_t(size*quad_index_count - 1);
- std::size_t last_id = 0;
- for (std::size_t k = 0; k < size; k++)
+ auto last_id = 0_uz;
+ for (auto k = 0_uz; k < size; k++)
{
auto id = ids[k];
auto [atlas, s] = c[id].scenery();
- for (std::size_t i = last_id+1; i < id; i++)
+ for (auto i = last_id+1; i < id; i++)
if (auto [atlas, s] = c[i].scenery();
atlas && atlas->info().fps > 0)
{
@@ -103,7 +103,7 @@ void anim_mesh::draw(tile_shader& shader, chunk& c)
draw(shader, *atlas, s.r, s.frame, local_coords{i}, s.offset);
}
else
- for (std::size_t i = 0; i < TILE_COUNT; i++)
+ for (auto i = 0_uz; i < TILE_COUNT; i++)
if (auto [atlas, s] = c[i].scenery(); atlas)
draw(shader, *atlas, s.r, s.frame, local_coords{i}, s.offset);
@@ -120,7 +120,7 @@ void anim_mesh::draw(tile_shader& shader, anim_atlas& atlas, rotation r, std::si
const auto& g = atlas.group(r);
const auto texcoords = atlas.texcoords_for_frame(r, frame, !g.mirror_from.isEmpty());
quad_data array;
- for (std::size_t i = 0; i < 4; i++)
+ for (auto i = 0_uz; i < 4; i++)
array[i] = { pos[i], texcoords[i], depth };
_vertex_buffer.setSubData(0, array);
atlas.texture().bind(0);