From 883545889d94fea794ff2ba989d4e93be50b9a78 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 27 Feb 2023 17:58:04 +0100 Subject: src: add Vector3 conversion to {local,chunk}_coords --- 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 acde5279..779c5a46 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(Vector2(xy), 0) + Vector3(g.offset) + Vector3(Vector2(s.offset), 0); + const auto world_pos = TILE_SIZE20 * Vector3(xy) + 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(Vector2(xy), 0) * TILE_SIZE + Vector3(Vector2(offset), 0); + const auto pos = Vector3(xy) * 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