summaryrefslogtreecommitdiffhomepage
path: root/src/tile-image.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tile-image.hpp')
-rw-r--r--src/tile-image.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tile-image.hpp b/src/tile-image.hpp
new file mode 100644
index 00000000..deb04e9a
--- /dev/null
+++ b/src/tile-image.hpp
@@ -0,0 +1,24 @@
+#pragma once
+#include "compat/integer-types.hpp"
+#include <compare>
+#include <memory>
+
+namespace floormat {
+
+struct tile_atlas;
+
+struct tile_image final
+{
+ std::shared_ptr<tile_atlas> atlas;
+ std::uint8_t variant = (std::uint8_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;
+ }
+};
+
+} // namespace floormat