From aebec6e9b095149252bf1e4642c211ae98efdf84 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 18 Oct 2022 01:55:30 +0200 Subject: a --- src/camera-offset.cpp | 5 ++--- src/camera-offset.hpp | 2 +- src/tile-defs.hpp | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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() diff --git a/src/camera-offset.hpp b/src/camera-offset.hpp index 927d5693..07b9f398 100644 --- a/src/camera-offset.hpp +++ b/src/camera-offset.hpp @@ -12,7 +12,7 @@ struct with_shifted_camera_offset final ~with_shifted_camera_offset(); private: tile_shader& _shader; // NOLINT - Vector2 _offset; + Vector2d _offset; }; } // namespace floormat diff --git a/src/tile-defs.hpp b/src/tile-defs.hpp index ec59e19f..df26fe8e 100644 --- a/src/tile-defs.hpp +++ b/src/tile-defs.hpp @@ -6,5 +6,6 @@ namespace floormat { constexpr inline std::size_t TILE_MAX_DIM = 16; constexpr inline std::size_t TILE_COUNT = TILE_MAX_DIM*TILE_MAX_DIM; constexpr inline float TILE_SIZE[3] = { 128, 128, 384 }; +constexpr inline double dTILE_SIZE[3] = { 128, 128, 384 }; } // namespace floormat -- cgit v1.2.3