From c9431f34e543dc0e6bf564e4ada9574072e92918 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 25 Feb 2023 21:47:56 +0100 Subject: convert to magnum vectors and use shorter syntax --- draw/anim.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'draw') diff --git a/draw/anim.cpp b/draw/anim.cpp index 566decb5..1e0d1bc4 100644 --- a/draw/anim.cpp +++ b/draw/anim.cpp @@ -32,7 +32,7 @@ void anim_mesh::add_clickable(tile_shader& shader, const Vector2i& win_size, const local_coords xy{i}; const auto& g = atlas->group(s.r); const auto& f = atlas->frame(s.r, s.frame); - const auto world_pos = TILE_SIZE20 * Vector3(xy.x, xy.y, 0) + Vector3(g.offset) + Vector3(s.offset[0], s.offset[1], 0); + const auto world_pos = TILE_SIZE20 * Vector3(Vector2(xy), 0) + Vector3(g.offset) + Vector3(Vector2(s.offset), 0); const Vector2ui offset((Vector2(shader.camera_offset()) + Vector2(win_size)*.5f) + shader.project(world_pos) - Vector2(f.ground)); clickable_scenery item = { @@ -129,7 +129,7 @@ void anim_mesh::draw(tile_shader& shader, anim_atlas& atlas, rotation r, std::si void anim_mesh::draw(tile_shader& shader, anim_atlas& atlas, rotation r, std::size_t frame, local_coords xy, Vector2b offset) { - const auto pos = Vector3(xy.x, xy.y, 0.f) * TILE_SIZE + Vector3(offset[0], offset[1], 0); + const auto pos = Vector3(Vector2(xy), 0) * TILE_SIZE + Vector3(Vector2(offset), 0); const float depth = tile_shader::depth_value(xy, tile_shader::scenery_depth_offset); draw(shader, atlas, r, frame, pos, depth); } -- cgit v1.2.3