From 15bbfc100a79a975f6024d6e2e6522c4e91f2cb5 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 21 Mar 2023 10:53:32 +0100 Subject: src, draw: work on depth and z offsets --- draw/anim.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'draw') diff --git a/draw/anim.cpp b/draw/anim.cpp index afdaa344..7f1d5cda 100644 --- a/draw/anim.cpp +++ b/draw/anim.cpp @@ -84,8 +84,10 @@ void anim_mesh::draw(tile_shader& shader, chunk& c) } if (e.is_dynamic()) { + const auto depth = e.depth_offset(); + const auto depth1 = depth[1]*TILE_MAX_DIM + depth[0]; //Debug{} << "draw-dyn" << e.atlas->name() << e.ordinal() << Vector2i(e.coord.local()); - draw(shader, atlas, e.r, e.frame, e.coord.local(), e.offset, tile_shader::scenery_depth_offset); + draw(shader, atlas, e.r, e.frame, e.coord.local(), e.offset, depth1 + tile_shader::scenery_depth_offset); last = nullptr; } else -- cgit v1.2.3