diff options
Diffstat (limited to 'src/scenery.hpp')
-rw-r--r-- | src/scenery.hpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/scenery.hpp b/src/scenery.hpp index 04c54c22..a59d6990 100644 --- a/src/scenery.hpp +++ b/src/scenery.hpp @@ -4,6 +4,8 @@ namespace floormat { +struct anim_atlas; + enum class rotation : std::uint16_t { N, NE, E, SE, S, SW, W, NW, COUNT, @@ -17,15 +19,26 @@ struct scenery final frame_t frame : 12 = NO_FRAME; rotation r : 4 = rotation::N; - - constexpr operator bool() const noexcept; }; static_assert(sizeof(scenery) == sizeof(std::uint16_t)); -constexpr scenery::operator bool() const noexcept -{ - return frame == NO_FRAME; -} +struct scenery_proto final { + std::shared_ptr<anim_atlas> atlas; + scenery frame; + operator bool() const noexcept; +}; + +struct scenery_ref final { + std::shared_ptr<anim_atlas>& atlas; + scenery& frame; + + scenery_ref(std::shared_ptr<anim_atlas>& atlas, scenery& frame) noexcept; + scenery_ref(const scenery_ref&) noexcept; + scenery_ref(scenery_ref&&) noexcept; + scenery_ref& operator=(const scenery_proto& proto) noexcept; + operator scenery_proto() const noexcept; + operator bool() const noexcept; +}; } // namespace floormat |