summaryrefslogtreecommitdiffhomepage
path: root/draw
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-21 10:53:32 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-21 10:53:49 +0100
commit15bbfc100a79a975f6024d6e2e6522c4e91f2cb5 (patch)
tree1fa630728c14b0973a042b50ec712f1303b82eff /draw
parent5dbee173b961792b42596cb792a50624555cc41b (diff)
src, draw: work on depth and z offsets
Diffstat (limited to 'draw')
-rw-r--r--draw/anim.cpp4
1 files changed, 3 insertions, 1 deletions
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