diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-03 15:48:07 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-03 15:48:07 +0100 |
commit | e2df578979a8796a41db92aba12dbe47b32bb8f5 (patch) | |
tree | 80bdb38b9e455d804a5cd04a77aee8949d3fb299 /src | |
parent | 3e7fd42b3dbf26d691e56619b4449918d6a74fee (diff) |
editor/imgui: add rotating scenery
Diffstat (limited to 'src')
-rw-r--r-- | src/chunk.inl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/chunk.inl b/src/chunk.inl index 5abc1e12..bdb4f8ae 100644 --- a/src/chunk.inl +++ b/src/chunk.inl @@ -8,7 +8,20 @@ template<typename F> void chunk::with_scenery_bbox_update(std::size_t i, F&& fun static_assert(std::is_invocable_v<F>); static_assert(std::is_convertible_v<decltype(fun()), bool> || std::is_same_v<void, decltype(fun())>); if (is_passability_modified()) - fun(); + { + auto& s = scenery_at(i); + auto r0 = s.r; + bool modified = true; + if constexpr(!std::is_same_v<void, std::decay_t<decltype(fun())>>) + modified = fun(); + else + fun(); + if (r0 != s.r) + { + fm_debug_assert(modified); + mark_scenery_modified(); + } + } else { bbox x0, x; |