summaryrefslogtreecommitdiffhomepage
path: root/draw/anim.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-18 23:42:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-18 23:42:07 +0100
commit4d9a82b720c8ce74b94f43f72ddd819ef21abbdf (patch)
treec0a5d21b8e19fbb60c286faec8e302e6f32b6679 /draw/anim.cpp
parent32b8c22828315292857e2cd9909fba620f30ff70 (diff)
pre-declare integer types without cstddef/cstdint
Diffstat (limited to 'draw/anim.cpp')
-rw-r--r--draw/anim.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/draw/anim.cpp b/draw/anim.cpp
index 4af20b8f..60e9b54c 100644
--- a/draw/anim.cpp
+++ b/draw/anim.cpp
@@ -51,12 +51,12 @@ void anim_mesh::draw(tile_shader& shader, chunk& c)
auto [mesh_] = c.ensure_scenery_mesh();
const auto& es = c.entities();
GL::MeshView mesh{mesh_};
- [[maybe_unused]] std::size_t draw_count = 0;
+ [[maybe_unused]] size_t draw_count = 0;
const auto size = es.size();
- const auto max_index = std::uint32_t(size*quad_index_count - 1);
+ const auto max_index = uint32_t(size*quad_index_count - 1);
- const auto do_draw = [&](std::size_t from, std::size_t to, anim_atlas* atlas) {
+ const auto do_draw = [&](size_t from, size_t to, anim_atlas* atlas) {
atlas->texture().bind(0);
mesh.setCount((int)(quad_index_count * (to-from)));
mesh.setIndexRange((int)(from*quad_index_count), 0, max_index);
@@ -64,14 +64,14 @@ void anim_mesh::draw(tile_shader& shader, chunk& c)
draw_count++;
};
- fm_debug_assert(std::size_t(mesh_.count()) <= size*quad_index_count);
+ fm_debug_assert(size_t(mesh_.count()) <= size*quad_index_count);
struct last_ {
- anim_atlas* atlas = nullptr; std::size_t run_from = 0;
+ anim_atlas* atlas = nullptr; size_t run_from = 0;
operator bool() const { return atlas; }
last_& operator=(std::nullptr_t) { atlas = nullptr; return *this; }
} last;
- std::size_t i = 0;
+ size_t i = 0;
for (auto k = 0_uz; k < size; k++)
{
@@ -111,7 +111,7 @@ void anim_mesh::draw(tile_shader& shader, chunk& c)
#endif
}
-void anim_mesh::draw(tile_shader& shader, anim_atlas& atlas, rotation r, std::size_t frame, const Vector3& center, float depth)
+void anim_mesh::draw(tile_shader& shader, anim_atlas& atlas, rotation r, size_t frame, const Vector3& center, float depth)
{
const auto pos = atlas.frame_quad(center, r, frame);
const auto& g = atlas.group(r);
@@ -124,7 +124,7 @@ void anim_mesh::draw(tile_shader& shader, anim_atlas& atlas, rotation r, std::si
shader.draw(_mesh);
}
-void anim_mesh::draw(tile_shader& shader, anim_atlas& atlas, rotation r, std::size_t frame, local_coords xy, Vector2b offset, float depth_offset)
+void anim_mesh::draw(tile_shader& shader, anim_atlas& atlas, rotation r, size_t frame, local_coords xy, Vector2b offset, float depth_offset)
{
const auto pos = Vector3(xy) * TILE_SIZE + Vector3(Vector2(offset), 0);
const float depth = tile_shader::depth_value(xy, depth_offset);