summaryrefslogtreecommitdiffhomepage
path: root/src/camera-offset.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-18 01:55:30 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-18 01:55:30 +0200
commitaebec6e9b095149252bf1e4642c211ae98efdf84 (patch)
treedfb9919de3fa8bb1a7ff99c9cb3fcbf17186e7c2 /src/camera-offset.cpp
parent2ce80cb4a85cc47dc10f0b70839b2d0f2381cca8 (diff)
a
Diffstat (limited to 'src/camera-offset.cpp')
-rw-r--r--src/camera-offset.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/camera-offset.cpp b/src/camera-offset.cpp
index 0bf51c3f..63de0b8b 100644
--- a/src/camera-offset.cpp
+++ b/src/camera-offset.cpp
@@ -12,11 +12,10 @@ with_shifted_camera_offset::with_shifted_camera_offset(tile_shader& shader, shor
_shader{shader},
_offset{shader.camera_offset()}
{
- const auto offset = _offset + tile_shader::project({float(x)*TILE_MAX_DIM*TILE_SIZE[0]*.5f,
- float(y)*TILE_MAX_DIM*TILE_SIZE[1]*.5f,
+ const auto offset = _offset + tile_shader::project({-double(x)*TILE_MAX_DIM*dTILE_SIZE[0],
+ double(y)*TILE_MAX_DIM*dTILE_SIZE[1],
0});
_shader.set_camera_offset(offset);
- ASSERT(std::abs(offset[0]) < 1 << 24 && std::abs(offset[1]) < 1 << 24);
}
with_shifted_camera_offset::~with_shifted_camera_offset()