diff options
Diffstat (limited to 'draw')
-rw-r--r-- | draw/wall.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/draw/wall.cpp b/draw/wall.cpp index 68f78821..353925f6 100644 --- a/draw/wall.cpp +++ b/draw/wall.cpp @@ -72,9 +72,12 @@ void wall_mesh::draw(tile_shader& shader, chunk& c) tex.bind(0); last_texture = &a.atlas->texture(); auto frame = a.frame; -#if 0 - static std::uint8_t f = 0; - frame.frame = f++ % a.atlas->info().nframes; +#if 1 + static std::size_t f = 0; + f++; + if (f > a.atlas->info().nframes * 3) + f = 0; + frame.frame = (scenery::frame_t)std::min(f, a.atlas->info().nframes - 1); #endif _anim_mesh.draw(shader, *a.atlas, a.atlas->frame(a.frame.r, frame.frame), local_coords{idx}); } |