From 28ba97727326c05c9347b50b0114f01c0ec8b1df Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 22 Nov 2023 09:47:25 +0100 Subject: a --- src/tile-atlas.hpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/tile-atlas.hpp') diff --git a/src/tile-atlas.hpp b/src/tile-atlas.hpp index 45251c6d..1a06db4a 100644 --- a/src/tile-atlas.hpp +++ b/src/tile-atlas.hpp @@ -1,5 +1,6 @@ #pragma once #include "src/pass-mode.hpp" +#include "src/quads.hpp" #include #include #include @@ -10,11 +11,22 @@ namespace floormat { -struct tile_atlas final +class tile_atlas final { using quad = std::array; using texcoords = std::array; + static std::unique_ptr make_texcoords_array(Vector2ui pixel_size, Vector2ub tile_count); + static texcoords make_texcoords(Vector2ui pixel_size, Vector2ub tile_count, size_t i); + + std::unique_ptr texcoords_; + GL::Texture2D tex_; + String path_, name_; + Vector2ui size_; + Vector2ub dims_; + Optional passability; + +public: // todo remove Optional when wall atlases are fully implemented -sh 20231122 tile_atlas(StringView path, StringView name, const ImageView2D& img, Vector2ub tile_count, Optional pass_mode); @@ -28,17 +40,6 @@ struct tile_atlas final Optional pass_mode() const; // todo remove later enum pass_mode pass_mode(enum pass_mode p) const; void set_pass_mode(enum pass_mode p); // todo remove later - -private: - static std::unique_ptr make_texcoords_array(Vector2ui pixel_size, Vector2ub tile_count); - static texcoords make_texcoords(Vector2ui pixel_size, Vector2ub tile_count, size_t i); - - std::unique_ptr texcoords_; - GL::Texture2D tex_; - String path_, name_; - Vector2ui size_; - Vector2ub dims_; - Optional passability; }; -- cgit v1.2.3