summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-04-08 06:21:01 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-04-08 06:21:01 +0200
commit06794499ce99020203c7c45294dad0d81bdca13d (patch)
tree398e17c113cd4fae7be143df1d2ecf77e46a1c6b
parent382ba9ffeedc95039e8d4ec360cd389ae220159c (diff)
a
-rw-r--r--editor/tests/region-test.cpp2
-rw-r--r--src/chunk-region.cpp4
-rw-r--r--src/chunk-scenery.cpp4
-rw-r--r--src/chunk-scenery.hpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/editor/tests/region-test.cpp b/editor/tests/region-test.cpp
index 484ea5e0..1206b1eb 100644
--- a/editor/tests/region-test.cpp
+++ b/editor/tests/region-test.cpp
@@ -158,7 +158,7 @@ void region_test::do_region_extraction(app& a, chunk_coords_ coord)
{
auto C_coord = Vector2i{ Vector2i(C->coord.local()) * iTILE_SIZE2 + Vector2i(C->offset) };
result = {
- .region = c->make_pass_region(true, {&C_coord, 1}),
+ .region = c->make_pass_region(true, arrayView({C_coord})),
.c = coord,
.exists = true,
};
diff --git a/src/chunk-region.cpp b/src/chunk-region.cpp
index a787b79b..3c5a8746 100644
--- a/src/chunk-region.cpp
+++ b/src/chunk-region.cpp
@@ -132,12 +132,12 @@ auto default_region_predicate(chunk& c) noexcept
} // namespace
-auto chunk::make_pass_region(bool debug, ArrayView<Vector2i> positions) -> pass_region
+auto chunk::make_pass_region(bool debug, ArrayView<const Vector2i> positions) -> pass_region
{
return make_pass_region(default_region_predicate(*this), debug, positions);
}
-auto chunk::make_pass_region(const pred& f, bool debug, ArrayView<Vector2i> positions) -> pass_region
+auto chunk::make_pass_region(const pred& f, bool debug, ArrayView<const Vector2i> positions) -> pass_region
{
Timeline timeline;
timeline.start();
diff --git a/src/chunk-scenery.cpp b/src/chunk-scenery.cpp
index 3b816a9b..ca888588 100644
--- a/src/chunk-scenery.cpp
+++ b/src/chunk-scenery.cpp
@@ -173,8 +173,8 @@ auto chunk::ensure_scenery_mesh(scenery_scratch_buffers buffers) noexcept -> sce
}
GL::Mesh mesh{GL::MeshPrimitive::Triangles};
- auto vert_view = ArrayView<std::array<vertex, 4>>{scenery_vertexes, count};
- auto index_view = ArrayView<std::array<UnsignedShort, 6>>{scenery_indexes, count};
+ auto vert_view = ArrayView<const std::array<vertex, 4>>{scenery_vertexes, count};
+ auto index_view = ArrayView<const std::array<UnsignedShort, 6>>{scenery_indexes, count};
mesh.addVertexBuffer(GL::Buffer{vert_view}, 0, tile_shader::Position{}, tile_shader::TextureCoordinates{}, tile_shader::Depth{})
.setIndexBuffer(GL::Buffer{index_view}, 0, GL::MeshIndexType::UnsignedShort)
.setCount(int32_t(6 * count));
diff --git a/src/chunk-scenery.hpp b/src/chunk-scenery.hpp
index 89e40078..85bddd7a 100644
--- a/src/chunk-scenery.hpp
+++ b/src/chunk-scenery.hpp
@@ -30,7 +30,7 @@ struct chunk::object_draw_order
struct chunk::scenery_mesh_tuple {
GL::Mesh& mesh;
- ArrayView<object_draw_order> array;
+ ArrayView<const object_draw_order> array;
size_t size;
};