diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-02 03:23:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-02 03:23:05 +0200 |
commit | 35cf1d65b454985c38b1e00a91670663b1583670 (patch) | |
tree | 1e47893775fbea27a79bf799fb99360b954a85ca /tile.hpp | |
parent | 5ec89ae3a42308dd5e43e5fed207824918123023 (diff) |
a
Diffstat (limited to 'tile.hpp')
-rw-r--r-- | tile.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -10,6 +10,8 @@ namespace Magnum::Examples { struct tile_atlas; constexpr inline Vector3 TILE_SIZE = { 50, 50, 50 }; +constexpr inline std::size_t TILE_MAX_DIM = 16; +constexpr inline std::size_t TILE_COUNT = TILE_MAX_DIM*TILE_MAX_DIM; struct tile_image final { @@ -28,4 +30,12 @@ struct tile final pass_mode passability = pass_shoot_through; }; +struct local_coords final { + std::uint8_t x = 0, y = 0; + constexpr local_coords() = default; + local_coords(std::size_t x, std::size_t y); + constexpr local_coords(std::uint8_t x, std::uint8_t y) : x{x}, y{y} {} + constexpr std::size_t to_index() const { return y*TILE_MAX_DIM + x; } +}; + } //namespace Magnum::Examples |