summaryrefslogtreecommitdiffhomepage
path: root/src/tile-image.hpp
blob: 907a465ceb5591540881e1778309ef4cb2bf66b1 (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
25
26
27
28
29
30
31
#pragma once
#include <memory>

namespace floormat {

struct tile_atlas;

using variant_t = uint8_t;

struct tile_image_proto final
{
    std::shared_ptr<tile_atlas> atlas;
    variant_t variant = 0;

    friend bool operator==(const tile_image_proto& a, const tile_image_proto& b) noexcept;
    operator bool() const noexcept;
};

struct tile_image_ref final
{
    std::shared_ptr<tile_atlas>& atlas;
    variant_t& variant;

    tile_image_ref(std::shared_ptr<tile_atlas>& atlas, variant_t& variant) noexcept;
    tile_image_ref(const tile_image_ref&) noexcept;
    tile_image_ref& operator=(const tile_image_proto& tile_image_proto) noexcept;
    operator tile_image_proto() const noexcept;
    operator bool() const noexcept;
};

} // namespace floormat