#pragma once #include "src/rotation.hpp" #include #include #include #include #include #include namespace floormat { struct wall_atlas; struct wall_frame { Vector2ui offset = { (unsigned)-1, (unsigned)-1 }; }; struct wall_frames { uint32_t index = (uint32_t)-1, count = (uint32_t)-1; Vector2ui pixel_size; Color4 tint_mult{1,1,1,1}; Color3 tint_add; uint8_t from_rotation = (uint8_t)-1; bool mirrored : 1 = false; ArrayView items(const wall_atlas& a) const; }; struct wall_frame_set { wall_frames wall, overlay, side, top; wall_frames corner_L, corner_R; }; struct wall_info { String name = "(unnamed)"_s; float depth = 1; }; struct wall_atlas final { wall_atlas(); wall_atlas(wall_info info, const ImageView2D& image, ArrayView rotations, ArrayView frames); ~wall_atlas() noexcept; static size_t enum_to_index(enum rotation x); const wall_frame_set& frameset(size_t i) const; const wall_frame_set& frameset(enum rotation r) const; const ArrayView array() const; StringView name() const; private: String _name; std::array _rotations; Array _array; GL::Texture2D _texture; wall_info _info; uint8_t _rotation_count = 0; }; } // namespace floormat