summaryrefslogtreecommitdiffhomepage
path: root/src/chunk.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-12-07 17:50:50 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-12-08 08:29:12 +0100
commit9a6a923c68afc4e9b6f47164c7ae9b2ed67bcf77 (patch)
tree9123a47535b14f38fa8a171797fafdf492987920 /src/chunk.hpp
parentea90834553ca195049c41892c1356e157ec6d203 (diff)
src, draw: don't overallocate ground & wall vbo's
Diffstat (limited to 'src/chunk.hpp')
-rw-r--r--src/chunk.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/chunk.hpp b/src/chunk.hpp
index 3a6ea3df..c061d070 100644
--- a/src/chunk.hpp
+++ b/src/chunk.hpp
@@ -63,11 +63,13 @@ struct chunk final
struct ground_mesh_tuple final {
GL::Mesh& mesh; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
- const std::array<std::uint8_t, TILE_COUNT>& ids; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
+ const ArrayView<const std::uint8_t> ids; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
+ const std::size_t size;
};
struct wall_mesh_tuple final {
GL::Mesh& mesh; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
- const std::array<std::uint16_t, TILE_COUNT*2>& ids; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
+ const ArrayView<const std::uint16_t> ids; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
+ const std::size_t size;
};
ground_mesh_tuple ensure_ground_mesh() noexcept;