From 5b7f5f2de723d30d3461f653e90fa4ae95941786 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 3 Mar 2023 19:52:55 +0000 Subject: Split Asset into its own file --- assetFactory/asset.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 assetFactory/asset.h (limited to 'assetFactory/asset.h') diff --git a/assetFactory/asset.h b/assetFactory/asset.h new file mode 100644 index 0000000..d86b804 --- /dev/null +++ b/assetFactory/asset.h @@ -0,0 +1,17 @@ +#pragma once + +#include "factoryMesh.h" +#include "persistence.h" +#include + +class Asset : public Persistence::Persistable, public StdTypeDefs { +public: + std::string id; + std::string name; + + FactoryMesh::Collection meshes; + +protected: + friend Persistence::SelectionPtrBase>; + bool persist(Persistence::PersistenceStore & store) override; +}; -- cgit v1.2.3 From 29ce7770c3e8373d2efea0b47fe50a13a81e75a2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 4 Mar 2023 14:17:00 +0000 Subject: Add Asset helpers to construct OpenGL ready meshes from Asset Factory meshes during load --- assetFactory/asset.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'assetFactory/asset.h') diff --git a/assetFactory/asset.h b/assetFactory/asset.h index d86b804..8dd1ecb 100644 --- a/assetFactory/asset.h +++ b/assetFactory/asset.h @@ -12,6 +12,28 @@ public: FactoryMesh::Collection meshes; protected: + struct MeshConstruct : public Persistence::SelectionPtrBase { + using Persistence::SelectionPtrBase::setValue; + + MeshConstruct(Mesh::Ptr & m); + + void endObject(Persistence::Stack & stk) override; + + FactoryMesh::Ptr fmesh; + Mesh::Ptr & out; + }; + + struct MeshArrayConstruct : public Persistence::SelectionPtrBase { + using Persistence::SelectionPtrBase::setValue; + + MeshArrayConstruct(std::span m); + + void endObject(Persistence::Stack & stk) override; + + FactoryMesh::Ptr fmesh; + std::span out; + }; + friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; }; -- cgit v1.2.3 From 54ddcd3da0916b6a46f5fcf3f33ff0fbffe375ce Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 4 Mar 2023 14:27:23 +0000 Subject: Support and load factory asset directly into a RailVehicleClass instance --- assetFactory/asset.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'assetFactory/asset.h') diff --git a/assetFactory/asset.h b/assetFactory/asset.h index 8dd1ecb..e3318e4 100644 --- a/assetFactory/asset.h +++ b/assetFactory/asset.h @@ -9,8 +9,6 @@ public: std::string id; std::string name; - FactoryMesh::Collection meshes; - protected: struct MeshConstruct : public Persistence::SelectionPtrBase { using Persistence::SelectionPtrBase::setValue; -- cgit v1.2.3