diff options
Diffstat (limited to 'draw/anim.hpp')
-rw-r--r-- | draw/anim.hpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/draw/anim.hpp b/draw/anim.hpp index e11d45ae..263d851d 100644 --- a/draw/anim.hpp +++ b/draw/anim.hpp @@ -1,7 +1,5 @@ #pragma once - #include "local-coords.hpp" -#include "scenery.hpp" #include <array> #include <Corrade/Containers/ArrayViewStl.h> #include <Magnum/Magnum.h> @@ -9,6 +7,8 @@ #include <Magnum/Math/Vector3.h> #include <Magnum/GL/Mesh.h> #include <Magnum/GL/Buffer.h> +#include "src/scenery.hpp" +#include "main/clickable.hpp" //namespace floormat::Serialize { struct anim_frame; } @@ -17,13 +17,21 @@ namespace floormat { struct tile_shader; struct anim_atlas; struct chunk; -//using anim_frame = Serialize::anim_frame; +template<typename Atlas, typename T> struct clickable; +struct scenery; struct anim_mesh final { + using clickable_scenery = clickable<anim_atlas, scenery>; + anim_mesh(); - void draw(tile_shader& shader, anim_atlas& atlas, rotation r, std::size_t frame, local_coords xy); + + void draw(tile_shader& shader, chunk& c); void draw(tile_shader& shader, anim_atlas& atlas, rotation r, std::size_t frame, const Vector3& pos, float depth); + void draw(tile_shader& shader, anim_atlas& atlas, rotation r, std::size_t frame, local_coords xy); + static void add_clickable(tile_shader& shader, const Vector2i& win_size, + chunk_coords c, std::uint8_t i, const std::shared_ptr<anim_atlas>& atlas, scenery& s, + std::vector<clickable_scenery>& clickable); private: struct vertex_data final { |