diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-21 21:11:33 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-21 21:11:33 +0200 |
commit | df2073a5692c991e4fc43c926334983997d272af (patch) | |
tree | 60d959c0e1dd97f0b4e63eacc60c162fc4a3e670 /src/tile.hpp | |
parent | 04ee43ea683f5b9b591e10409b5e5a622e8a198a (diff) |
lots of refactoring types crap
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 |