diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-04-04 20:04:13 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-04-04 20:04:13 +0100 |
commit | 352b00a1eeefba9cb1fddbb43d8d7d4fa94f3e25 (patch) | |
tree | 72b2f735ac62f3b10834e0e59c6a8686d753de09 /game/terrain.cpp | |
parent | Update normals only as required (diff) | |
download | ilt-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/terrain.cpp')
-rw-r--r-- | game/terrain.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/game/terrain.cpp b/game/terrain.cpp index 7f59b6c..91a228f 100644 --- a/game/terrain.cpp +++ b/game/terrain.cpp @@ -30,14 +30,14 @@ Terrain::generateMeshes() std::vector<Vertex> vertices; vertices.reserve(geoData->n_vertices()); std::map<GeoData::VertexHandle, size_t> vertexIndex; - std::transform(geoData->vertices_begin(), geoData->vertices_end(), std::back_inserter(vertices), + std::transform(geoData->vertices_sbegin(), geoData->vertices_end(), std::back_inserter(vertices), [this, &vertexIndex](const GeoData::VertexHandle v) { vertexIndex.emplace(v, vertexIndex.size()); const auto p = geoData->point(v); return Vertex {p, RelativePosition2D(p) / 10000.F, geoData->normal(v)}; }); std::for_each( - geoData->faces_begin(), geoData->faces_end(), [this, &vertexIndex, &indices](const GeoData::FaceHandle f) { + geoData->faces_sbegin(), geoData->faces_end(), [this, &vertexIndex, &indices](const GeoData::FaceHandle f) { std::transform(geoData->fv_begin(f), geoData->fv_end(f), std::back_inserter(indices), [&vertexIndex](const GeoData::VertexHandle v) { return vertexIndex[v]; |