diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-11 19:19:44 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-11 19:19:44 +0100 |
commit | e990e7c14228acf7090db19adb8ed4643e54aeb3 (patch) | |
tree | 425e43ede626c65cdcd511b6ed6a9769b2af4344 /src | |
parent | c93b3616adbf26673fc928fdfbbec814fec41c75 (diff) |
waaa
Diffstat (limited to 'src')
-rw-r--r-- | src/ground-atlas.hpp | 2 | ||||
-rw-r--r-- | src/tile.cpp | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ground-atlas.hpp b/src/ground-atlas.hpp index 83b4705c..38832f9b 100644 --- a/src/ground-atlas.hpp +++ b/src/ground-atlas.hpp @@ -16,7 +16,7 @@ struct ground_def { String name; Vector2ub size; - pass_mode pass; + pass_mode pass = pass_mode::pass; }; class ground_atlas; diff --git a/src/tile.cpp b/src/tile.cpp index c5eda401..91fb73aa 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -1,5 +1,6 @@ #include "tile.hpp" #include "chunk.hpp" +#include "src/ground-atlas.hpp" namespace floormat { @@ -7,9 +8,13 @@ namespace floormat { static_assert(iTILE_SIZE2.x() == iTILE_SIZE2.y()); bool operator==(const tile_proto& a, const tile_proto& b) noexcept { - return a.ground() == b.ground() && - a.wall_north() == b.wall_north() && - a.wall_west() == b.wall_west(); + if (const auto &A = a.ground(), &B = b.ground(); A != B) + return false; + if (const auto &A = a.wall_north(), &B = b.wall_north(); A != B) + return false; + if (const auto &A = a.wall_west(), &B = b.wall_west(); A != B) + return false; + return true; }; tile_image_proto tile_proto::ground() const noexcept { return { ground_atlas, ground_variant }; } |