summaryrefslogtreecommitdiff
path: root/game/geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-04-04 20:04:13 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-04-04 20:04:13 +0100
commit352b00a1eeefba9cb1fddbb43d8d7d4fa94f3e25 (patch)
tree72b2f735ac62f3b10834e0e59c6a8686d753de09 /game/geoData.cpp
parentUpdate normals only as required (diff)
downloadilt-352b00a1eeefba9cb1fddbb43d8d7d4fa94f3e25.tar.bz2
ilt-352b00a1eeefba9cb1fddbb43d8d7d4fa94f3e25.tar.xz
ilt-352b00a1eeefba9cb1fddbb43d8d7d4fa94f3e25.zip
Don't garbage collect the terrain mesh
Use skipping iterators instead, GC would be implicit during save/load
Diffstat (limited to 'game/geoData.cpp')
-rw-r--r--game/geoData.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp
index 9211369..ed4303b 100644
--- a/game/geoData.cpp
+++ b/game/geoData.cpp
@@ -107,11 +107,11 @@ GeoData::createFlat(GlobalPosition2D lower, GlobalPosition2D upper, GlobalDistan
OpenMesh::FaceHandle
GeoData::findPoint(GlobalPosition2D p) const
{
- return findPoint(p, *faces_begin());
+ return findPoint(p, *faces_sbegin());
}
GeoData::PointFace::PointFace(const GlobalPosition2D p, const GeoData * mesh) :
- PointFace {p, mesh, *mesh->faces_begin()}
+ PointFace {p, mesh, *mesh->faces_sbegin()}
{
}
@@ -135,7 +135,7 @@ GeoData::PointFace::face(const GeoData * mesh, FaceHandle start) const
GeoData::FaceHandle
GeoData::PointFace::face(const GeoData * mesh) const
{
- return face(mesh, *mesh->faces_begin());
+ return face(mesh, *mesh->faces_sbegin());
}
namespace {
@@ -347,7 +347,7 @@ GeoData::triangleContainsPoint(const GlobalPosition2D p, FaceHandle face) const
GeoData::HalfedgeHandle
GeoData::findBoundaryStart() const
{
- return *std::find_if(halfedges_begin(), halfedges_end(), [this](const auto heh) {
+ return *std::find_if(halfedges_sbegin(), halfedges_end(), [this](const auto heh) {
return is_boundary(heh);
});
}
@@ -664,5 +664,4 @@ GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip)
// Tidy up
update_vertex_normals_only(VertexIter {*this, vertex_handle(initialVertexCount), true});
- garbage_collection();
}