diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-10 23:04:15 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-11 14:20:10 +0200 |
commit | 87ebad7f6e6e552ec190b57f656aed53aa861e07 (patch) | |
tree | 3a37e92d7096d3b7b869553270d8c6f7d959da48 /src | |
parent | e76bd9d8a6a8e4226ae3dd492439d66ab977d006 (diff) |
clean up some defs
Diffstat (limited to 'src')
-rw-r--r-- | src/chunk-scenery.cpp | 2 | ||||
-rw-r--r-- | src/scenery.cpp | 2 | ||||
-rw-r--r-- | src/tile-defs.hpp | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/chunk-scenery.cpp b/src/chunk-scenery.cpp index 6fc48821..5c0c90c6 100644 --- a/src/chunk-scenery.cpp +++ b/src/chunk-scenery.cpp @@ -111,7 +111,7 @@ auto chunk::make_topo_sort_data(object& e, uint32_t mesh_idx) -> topo_sort_data const auto bb_min = tile_shader::project(Vector3(Vector2(bb_min_[0], bb_max_[1]), 0)); const auto bb_max = tile_shader::project(Vector3(Vector2(bb_max_[0], bb_min_[1]), 0)); const auto bb_len = bb_max[0] - bb_min[0]; - if (bb_len >= 1 && f.size[0] > uiTILE_SIZE[0]) + if (bb_len >= 1 && f.size[0] > (unsigned)iTILE_SIZE[0]) { data.slope = (bb_max[1]-bb_min[1])/bb_len; data.bb_min = Vector2s(bb_min - px_start); diff --git a/src/scenery.cpp b/src/scenery.cpp index 22c7083a..29198b0f 100644 --- a/src/scenery.cpp +++ b/src/scenery.cpp @@ -74,6 +74,8 @@ void scenery::update(size_t, float dt) Vector2 scenery::ordinal_offset(Vector2b offset) const { + constexpr auto bTILE_SIZE = Vector2b(iTILE_SIZE2); + if (sc_type == scenery_type::door) { constexpr auto off_closed_ = Vector2b(0, -bTILE_SIZE[1]/2+2); diff --git a/src/tile-defs.hpp b/src/tile-defs.hpp index 031c2c56..2736cd08 100644 --- a/src/tile-defs.hpp +++ b/src/tile-defs.hpp @@ -4,17 +4,15 @@ namespace floormat { -constexpr inline unsigned char TILE_MAX_DIM = 16; +constexpr inline uint32_t TILE_MAX_DIM = 16; constexpr inline size_t TILE_COUNT = size_t{TILE_MAX_DIM}*size_t{TILE_MAX_DIM}; constexpr inline auto TILE_MAX_DIM20d = Magnum::Math::Vector3<double> { TILE_MAX_DIM, TILE_MAX_DIM, 0 }; constexpr inline auto iTILE_SIZE = Magnum::Math::Vector3<Int> { 64, 64, 192 }; -constexpr inline auto uiTILE_SIZE = Magnum::Math::Vector3<UnsignedInt> { iTILE_SIZE }; -constexpr inline auto bTILE_SIZE = Magnum::Math::Vector3<Byte> { iTILE_SIZE }; -constexpr inline auto iTILE_SIZE2 = Magnum::Math::Vector2<Int> { iTILE_SIZE[0], iTILE_SIZE[1] }; +constexpr inline auto iTILE_SIZE2 = Magnum::Math::Vector2<Int> { iTILE_SIZE.x(), iTILE_SIZE.y() }; constexpr inline auto TILE_SIZE = Magnum::Math::Vector3<float> { iTILE_SIZE }; constexpr inline auto dTILE_SIZE = Magnum::Math::Vector3<double> { iTILE_SIZE }; constexpr inline auto TILE_SIZE2 = Magnum::Math::Vector2<float> { iTILE_SIZE2 }; -constexpr inline auto TILE_SIZE20 = Magnum::Math::Vector3<float> { (float)iTILE_SIZE[0], (float)iTILE_SIZE[1], 0 }; +constexpr inline auto TILE_SIZE20 = Magnum::Math::Vector3<float> { (float)iTILE_SIZE.x(), (float)iTILE_SIZE.y(), 0 }; } // namespace floormat |