From 74a241680dcb8e543c7e2ab70eb0cfe00d01f22a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 1 Apr 2026 20:31:29 +0100 Subject: Move spot/point light persistence wrappers to assetFactory --- assetFactory/lights.cpp | 14 ++++++++++++++ assetFactory/lights.h | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 assetFactory/lights.cpp create mode 100644 assetFactory/lights.h (limited to 'assetFactory') diff --git a/assetFactory/lights.cpp b/assetFactory/lights.cpp new file mode 100644 index 0000000..ec8e17e --- /dev/null +++ b/assetFactory/lights.cpp @@ -0,0 +1,14 @@ +#include "lights.h" + +bool +SpotLight::persist(Persistence::PersistenceStore & store) +{ + return STORE_TYPE && STORE_MEMBER(position) && STORE_MEMBER(direction) && STORE_MEMBER(colour) && STORE_MEMBER(kq) + && STORE_MEMBER(arc); +} + +bool +PointLight::persist(Persistence::PersistenceStore & store) +{ + return STORE_TYPE && STORE_MEMBER(position) && STORE_MEMBER(colour) && STORE_MEMBER(kq); +} diff --git a/assetFactory/lights.h b/assetFactory/lights.h new file mode 100644 index 0000000..8657d85 --- /dev/null +++ b/assetFactory/lights.h @@ -0,0 +1,18 @@ +#pragma once + +#include "gfx/models/lights.h" +#include "persistence.h" +#include "stdTypeDefs.h" + +struct SpotLight : Persistence::Persistable, SpotLightDef, StdTypeDefs { +private: + friend Persistence::SelectionPtrBase>; + bool persist(Persistence::PersistenceStore & store) override; +}; + +struct PointLight : Persistence::Persistable, PointLightDef, StdTypeDefs { +private: + friend Persistence::SelectionPtrBase>; + bool persist(Persistence::PersistenceStore & store) override; +}; + -- cgit v1.3