summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--game/geoData.cpp9
-rw-r--r--game/geoData.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp
index d15a51b..5771a2f 100644
--- a/game/geoData.cpp
+++ b/game/geoData.cpp
@@ -66,6 +66,7 @@ GeoData::loadFromAsciiGrid(const std::filesystem::path & input)
});
}
}
+ mesh.generation++;
mesh.updateAllVertexNormals();
return mesh;
@@ -106,6 +107,7 @@ GeoData::createFlat(GlobalPosition2D lower, GlobalPosition2D upper, GlobalDistan
}
mesh.updateAllVertexNormals();
+ mesh.generation++;
return mesh;
}
@@ -601,6 +603,13 @@ GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip, const
surfaceStripWalk(surfaceStripWalk, findPoint(strip.front().centroid()));
updateAllVertexNormals(newOrChangedVerts);
+ generation++;
+}
+
+size_t
+GeoData::getGeneration() const
+{
+ return generation;
}
void
diff --git a/game/geoData.h b/game/geoData.h
index 01582a6..8eda99a 100644
--- a/game/geoData.h
+++ b/game/geoData.h
@@ -84,6 +84,7 @@ public:
};
void setHeights(std::span<const GlobalPosition3D> triangleStrip, const SetHeightsOpts &);
+ [[nodiscard]] size_t getGeneration() const;
[[nodiscard]] auto
getExtents() const
@@ -128,4 +129,5 @@ protected:
private:
GlobalPosition3D lowerExtent {}, upperExtent {};
+ size_t generation {};
};