summaryrefslogtreecommitdiffhomepage
path: root/src/camera-offset.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-08 15:59:19 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-08 15:59:19 +0200
commit3570e2f5aefdd0b5d262fe99ccd8b4a54aa79b83 (patch)
treedd6f1b9f1cc4fbd4ac74de7b6e0cd90900c75330 /src/camera-offset.cpp
parentc908c0cc43211d9937340b2a0704e8c53241b035 (diff)
fix wall z>0 clipping over z=0 scenery
Diffstat (limited to 'src/camera-offset.cpp')
-rw-r--r--src/camera-offset.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/camera-offset.cpp b/src/camera-offset.cpp
index 88ebd0e4..f7cf23a4 100644
--- a/src/camera-offset.cpp
+++ b/src/camera-offset.cpp
@@ -14,8 +14,9 @@ with_shifted_camera_offset::with_shifted_camera_offset(tile_shader& shader, chun
const auto offset = _camera + tile_shader::project(Vector3d(c.x, c.y, 0) * chunk_size);
first.x -= 8; first.y -= 8; last.x += 8; last.y += 8; // Z levels
auto len_x = (float)(last.x - first.x), cx = (float)(c.x - first.x), cy = (float)(c.y - first.y);
- cx += c.z; cy += c.z;
- const float depth_offset = shader.depth_tile_size*(cy*TILE_MAX_DIM*len_x*TILE_MAX_DIM + cx*TILE_MAX_DIM);
+ //cx += c.z; cy += c.z;
+ float depth_offset = shader.depth_tile_size*(cy*TILE_MAX_DIM*len_x*TILE_MAX_DIM + cx*TILE_MAX_DIM);
+ depth_offset += tile_shader::depth_value(local_coords{1*c.z, 1*c.z});
_shader.set_camera_offset(offset, depth_offset);
}