summaryrefslogtreecommitdiffhomepage
path: root/draw/anim.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-02-27 17:58:04 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-02-27 17:58:04 +0100
commit883545889d94fea794ff2ba989d4e93be50b9a78 (patch)
treedceeadbe482b9f14e861a3271fc9970600de0fed /draw/anim.cpp
parent670057cbec1ba8f01edf4c8ced4fded33a8f90eb (diff)
src: add Vector3 conversion to {local,chunk}_coords
Diffstat (limited to 'draw/anim.cpp')
-rw-r--r--draw/anim.cpp4
1 files changed, 2 insertions, 2 deletions
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);
}