From ab31f0ed81301c23d6847f3ca1513d4b90275de7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 8 Dec 2022 08:13:37 +0100 Subject: draw, main, src/chunk: batch scenery writes --- draw/anim.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'draw/anim.hpp') 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 #include #include @@ -9,6 +7,8 @@ #include #include #include +#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 struct clickable; +struct scenery; struct anim_mesh final { + using clickable_scenery = clickable; + 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& atlas, scenery& s, + std::vector& clickable); private: struct vertex_data final { -- cgit v1.2.3