summaryrefslogtreecommitdiffhomepage
path: root/draw
diff options
context:
space:
mode:
Diffstat (limited to 'draw')
-rw-r--r--draw/anim.cpp8
-rw-r--r--draw/anim.hpp5
2 files changed, 6 insertions, 7 deletions
diff --git a/draw/anim.cpp b/draw/anim.cpp
index ad71611a..56824cf1 100644
--- a/draw/anim.cpp
+++ b/draw/anim.cpp
@@ -5,7 +5,7 @@
#include "main/clickable.hpp"
#include "src/chunk-scenery.hpp"
#include "src/scenery.hpp"
-#include <cstdio>
+#include <Corrade/Containers/GrowableArray.h>
#include <Corrade/Containers/ArrayViewStl.h>
#include <Corrade/Containers/Optional.h>
#include <Magnum/GL/MeshView.h>
@@ -33,7 +33,7 @@ std::array<UnsignedShort, 6> anim_mesh::make_index_array()
void anim_mesh::add_clickable(tile_shader& shader, const Vector2i& win_size,
object* s_, const chunk::topo_sort_data& data,
- std::vector<clickable>& list)
+ Array<clickable>& list)
{
const auto& s = *s_;
const auto& a = *s.atlas;
@@ -55,11 +55,11 @@ void anim_mesh::add_clickable(tile_shader& shader, const Vector2i& win_size,
.stride = a.info().pixel_size[0],
.mirrored = !g.mirror_from.isEmpty(),
};
- list.push_back(item);
+ arrayAppend(list, item);
}
}
-void anim_mesh::draw(tile_shader& shader, const Vector2i& win_size, chunk& c, std::vector<clickable>& list, bool draw_vobjs)
+void anim_mesh::draw(tile_shader& shader, const Vector2i& win_size, chunk& c, Array<clickable>& list, bool draw_vobjs)
{
constexpr auto quad_index_count = 6;
diff --git a/draw/anim.hpp b/draw/anim.hpp
index c9420eb4..e9ac5f89 100644
--- a/draw/anim.hpp
+++ b/draw/anim.hpp
@@ -3,7 +3,6 @@
#include "src/rotation.hpp"
#include "src/chunk.hpp"
#include <array>
-#include <vector>
#include <Corrade/Containers/Array.h>
#include <Corrade/Containers/ArrayView.h>
#include <Magnum/Magnum.h>
@@ -27,12 +26,12 @@ struct anim_mesh
{
anim_mesh();
- void draw(tile_shader& shader, const Vector2i& win_size, chunk& c, std::vector<clickable>& list, bool draw_vobjs);
+ void draw(tile_shader& shader, const Vector2i& win_size, chunk& c, Array<clickable>& list, bool draw_vobjs);
void draw(tile_shader& shader, anim_atlas& atlas, rotation r, size_t frame, const Vector3& pos, float depth);
void draw(tile_shader& shader, anim_atlas& atlas, rotation r, size_t frame, local_coords xy, Vector2b offset, float dpeth);
static void add_clickable(tile_shader& shader, const Vector2i& win_size,
object* s_, const chunk::topo_sort_data& data,
- std::vector<clickable>& list);
+ Array<clickable>& list);
private:
static std::array<UnsignedShort, 6> make_index_array();