summaryrefslogtreecommitdiffhomepage
path: root/src/camera-offset.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-04-10 16:46:06 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-04-10 16:46:06 +0200
commit8ffe1eac74a76ab1de9bac6dfdd81104f19a0511 (patch)
treee322155e5638db120bc7f71664318fd2c786f1d3 /src/camera-offset.cpp
parent5fc2c1c191440e876a26696d8879110dacf63145 (diff)
update() other layers' entities when only one is visible
Diffstat (limited to 'src/camera-offset.cpp')
-rw-r--r--src/camera-offset.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/camera-offset.cpp b/src/camera-offset.cpp
index fb4724cc..e8c80861 100644
--- a/src/camera-offset.cpp
+++ b/src/camera-offset.cpp
@@ -16,10 +16,10 @@ with_shifted_camera_offset::with_shifted_camera_offset(tile_shader& shader, chun
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;
float depth_offset = shader.depth_tile_size*(cy*TILE_MAX_DIM*len_x*TILE_MAX_DIM + cx*TILE_MAX_DIM);
- const int z = c.z - chunk_min_z;
+ const int z = c.z - chunk_z_min;
depth_offset += tile_shader::depth_value(local_coords{z, z});
- if (c.z == chunk_max_z)
+ if (c.z == chunk_z_max)
depth_offset = 1;
_shader.set_camera_offset(offset, depth_offset);