diff options
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 |