summaryrefslogtreecommitdiffhomepage
path: root/src/chunk.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-03 19:40:11 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-03 20:34:02 +0100
commit3d7ae4c401d5bd6109a7fd25eb22e5bc77f0a4aa (patch)
tree7c673746944b85fbafae891ac69594326b15b517 /src/chunk.hpp
parent6d0a594e618f165eb2823bb31eb3cfe21ec1e7c5 (diff)
src: rework scenery updates
Diffstat (limited to 'src/chunk.hpp')
-rw-r--r--src/chunk.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/chunk.hpp b/src/chunk.hpp
index 3ec02130..a2fdf53f 100644
--- a/src/chunk.hpp
+++ b/src/chunk.hpp
@@ -56,10 +56,13 @@ struct chunk final
void mark_ground_modified() noexcept;
void mark_walls_modified() noexcept;
- void mark_scenery_modified() noexcept;
- bool is_passability_modified() const noexcept;
+ void mark_scenery_modified(bool collision_too = true) noexcept;
+ void mark_passability_modified() noexcept;
void mark_modified() noexcept;
+ bool is_passability_modified() const noexcept;
+ bool is_scenery_modified() const noexcept;
+
struct ground_mesh_tuple final {
GL::Mesh& mesh;
const ArrayView<const std::uint8_t> ids;
@@ -94,7 +97,9 @@ struct chunk final
const RTree* rtree() const noexcept;
RTree* rtree() noexcept;
- template<typename F> void with_scenery_bbox_update(std::size_t idx, F&& fun);
+ template<typename F>
+ requires requires(F fun) { fun(); }
+ void with_scenery_update(std::size_t idx, F&& fun);
private:
std::array<std::shared_ptr<tile_atlas>, TILE_COUNT> _ground_atlases;