diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-07 14:15:25 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-07 14:15:25 +0200 |
commit | e1e539709d6e197cd2f2118e14598fd8c7b42c7b (patch) | |
tree | 1da9003870abfc85cac79d732fc48583ff9e520e /src/tile.hpp | |
parent | 405c6168198fe25eb791f048a37417e6cffb3c42 (diff) |
.
Diffstat (limited to 'src/tile.hpp')
-rw-r--r-- | src/tile.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tile.hpp b/src/tile.hpp index eadfa745..169c941b 100644 --- a/src/tile.hpp +++ b/src/tile.hpp @@ -1,4 +1,6 @@ #pragma once +#include "compat/defs.hpp" +#include "compat/assert.hpp" #include <Magnum/Magnum.h> #include <Magnum/Math/Vector3.h> #include <cstddef> @@ -27,14 +29,23 @@ struct tile final tile_image ground_image, wall_north, wall_west; pass_mode passability = pass_shoot_through; + + constexpr tile() = default; + DECLARE_DEPRECATED_COPY_OPERATOR(tile); }; 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::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; } }; +constexpr local_coords::local_coords(std::size_t x, std::size_t y) + : x{(std::uint8_t)x}, y{(std::uint8_t)y} +{ + ASSERT(x <= 0xff && y <= 0xff); +} + } //namespace Magnum::Examples |