blob: 30ae7b0b53fe25027db1ddbe1f8fe546dba1eec6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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::uint16_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
|