diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-29 18:59:39 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-29 18:59:39 +0200 |
| commit | d9cf49f11a5767fab52994e5c38d58ba16b13af6 (patch) | |
| tree | 0d9adf6eb81bc75f0c1aaf616efe554ff6c64b56 /src/camera-offset.cpp | |
| parent | d309ed0b2ac06d7ba48322303d56bf39c8b57fe4 (diff) | |
use vectors without open-coding vector ops
Suggested by mosra.
Diffstat (limited to 'src/camera-offset.cpp')
| -rw-r--r-- | src/camera-offset.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/camera-offset.cpp b/src/camera-offset.cpp index 40bf66dd..f837fd1f 100644 --- a/src/camera-offset.cpp +++ b/src/camera-offset.cpp @@ -10,9 +10,7 @@ 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({double(x)*TILE_MAX_DIM*dTILE_SIZE[0], - double(y)*TILE_MAX_DIM*dTILE_SIZE[1], - 0}); + const auto offset = _offset + tile_shader::project(Vector3d(x, y, 0) * TILE_MAX_DIM20d); _shader.set_camera_offset(offset); } |
