From 459e94900d06ea79b7fb215880e336a8cba156ca Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 7 Dec 2023 09:27:52 +0100 Subject: wipshit --- src/tile-image.hpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'src/tile-image.hpp') diff --git a/src/tile-image.hpp b/src/tile-image.hpp index c93cc778..8b2c94e5 100644 --- a/src/tile-image.hpp +++ b/src/tile-image.hpp @@ -4,28 +4,37 @@ namespace floormat { class tile_atlas; +class wall_atlas; using variant_t = uint8_t; -struct tile_image_proto final +template +struct image_proto_ { - std::shared_ptr atlas; + std::shared_ptr atlas; variant_t variant = 0; - friend bool operator==(const tile_image_proto& a, const tile_image_proto& b) noexcept; + bool operator==(const image_proto_& b) const noexcept; operator bool() const noexcept; }; -struct tile_image_ref final +template +struct image_ref_ final { - std::shared_ptr& atlas; + std::shared_ptr& atlas; variant_t& variant; - tile_image_ref(std::shared_ptr& 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; + image_ref_(std::shared_ptr& atlas, variant_t& variant) noexcept; + image_ref_(const image_ref_&) noexcept; + image_ref_& operator=(const Proto& proto) noexcept; + operator Proto() const noexcept; operator bool() const noexcept; }; +using tile_image_proto = image_proto_; +using tile_image_ref = image_ref_; + +using wall_image_proto = image_proto_; +using wall_image_ref = image_ref_; + } // namespace floormat -- cgit v1.2.3