diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-15 19:27:53 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-15 19:27:53 +0100 |
commit | 785293f4bf1beec65d23be0612e545e4c26ec366 (patch) | |
tree | f250c34d82977116498b8049c8055fc3981478ab /src/chunk.cpp | |
parent | a5acc700d6a3a9b050864cf78a0f9f2305babdff (diff) |
b
Diffstat (limited to 'src/chunk.cpp')
-rw-r--r-- | src/chunk.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/chunk.cpp b/src/chunk.cpp index a819de6c..19d79b3a 100644 --- a/src/chunk.cpp +++ b/src/chunk.cpp @@ -2,6 +2,7 @@ #include "object.hpp" #include "world.hpp" #include "tile-iterator.hpp" +#include "RTree.h" #include <algorithm> #include <Corrade/Containers/GrowableArray.h> #include <Magnum/GL/Context.h> @@ -120,7 +121,10 @@ void chunk::mark_modified() noexcept mark_passability_modified(); } -chunk::chunk(class world& w, chunk_coords_ ch) noexcept : _world{&w}, _coord{ch} +chunk::chunk(class world& w, chunk_coords_ ch) noexcept : + _world{&w}, + _rtree{InPlaceInit}, + _coord{ch} { } @@ -129,7 +133,7 @@ chunk::~chunk() noexcept _teardown = true; arrayResize(_objects, 0); arrayShrink(_objects); - _rtree.RemoveAll(); + _rtree->RemoveAll(); } chunk::chunk(chunk&&) noexcept = default; |