summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--game/geoData.h3
-rw-r--r--game/surface.cpp7
-rw-r--r--game/surface.h11
3 files changed, 20 insertions, 1 deletions
diff --git a/game/geoData.h b/game/geoData.h
index e3e9bcb..7a2344d 100644
--- a/game/geoData.h
+++ b/game/geoData.h
@@ -3,6 +3,7 @@
#include "collections.h" // IWYU pragma: keep IterableCollection
#include "config/types.h"
#include "ray.h"
+#include "surface.h"
#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
#include <filesystem>
#include <glm/vec2.hpp>
@@ -22,7 +23,7 @@ class GeoData : public OpenMesh::TriMesh_ArrayKernelT<GeoDataTraits> {
private:
GeoData();
- OpenMesh::FPropHandleT<int> surface;
+ OpenMesh::FPropHandleT<const Surface *> surface;
public:
static GeoData loadFromAsciiGrid(const std::filesystem::path &);
diff --git a/game/surface.cpp b/game/surface.cpp
new file mode 100644
index 0000000..007a9a4
--- /dev/null
+++ b/game/surface.cpp
@@ -0,0 +1,7 @@
+#include "surface.h"
+
+bool
+Surface::persist(Persistence::PersistenceStore & store)
+{
+ return STORE_TYPE && STORE_MEMBER(colorBias) && STORE_MEMBER(quality) && Asset::persist(store);
+}
diff --git a/game/surface.h b/game/surface.h
new file mode 100644
index 0000000..ccc5c6c
--- /dev/null
+++ b/game/surface.h
@@ -0,0 +1,11 @@
+#pragma once
+
+#include "assetFactory/asset.h"
+
+struct Surface : public Asset {
+ friend Persistence::SelectionPtrBase<std::shared_ptr<Surface>>;
+ bool persist(Persistence::PersistenceStore & store) override;
+
+ glm::vec3 colorBias;
+ float quality;
+};