diff options
Diffstat (limited to 'src/tile.hpp')
-rw-r--r-- | src/tile.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tile.hpp b/src/tile.hpp index 067df3c7..499acd97 100644 --- a/src/tile.hpp +++ b/src/tile.hpp @@ -12,9 +12,15 @@ struct tile_atlas; struct tile_image final { std::shared_ptr<tile_atlas> atlas; - std::uint8_t variant = 0xff; + std::size_t variant = (std::size_t)-1; explicit operator bool() const noexcept { return !!atlas; } + + std::strong_ordering operator<=>(const tile_image& o) const noexcept + { + const auto ret = atlas.get() <=> o.atlas.get(); + return ret != std::strong_ordering::equal ? ret : variant <=> o.variant; + } }; struct tile final |