summaryrefslogtreecommitdiff
path: root/assetFactory/use.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-02-24 19:30:30 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-02-24 19:30:30 +0000
commit7d0decccaac3aa564b549d91a36279e7aca0814e (patch)
tree749ceff26556ed201a055b8d8a70636b50c562f7 /assetFactory/use.cpp
parentSupport for model colours mixed with textures (diff)
downloadilt-7d0decccaac3aa564b549d91a36279e7aca0814e.tar.bz2
ilt-7d0decccaac3aa564b549d91a36279e7aca0814e.tar.xz
ilt-7d0decccaac3aa564b549d91a36279e7aca0814e.zip
Support for recursive colouring of asset factory faces
Updates colours in sample model.
Diffstat (limited to 'assetFactory/use.cpp')
-rw-r--r--assetFactory/use.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/assetFactory/use.cpp b/assetFactory/use.cpp
index 1f28332..a6fac5c 100644
--- a/assetFactory/use.cpp
+++ b/assetFactory/use.cpp
@@ -5,8 +5,9 @@ Shape::CreatedFaces
Use::createMesh(ModelFactoryMesh & mesh, const Mutation::Matrix & mutation) const
{
auto faces = type->createMesh(mesh, mutation * getMatrix());
+ applyStyle(mesh, {this}, faces);
for (const auto & [name, faceController] : faceControllers) {
- faceController->apply(mesh, name, faces);
+ faceController->apply(mesh, {this}, name, faces);
}
return faces;
}
@@ -27,6 +28,6 @@ bool
Use::persist(Persistence::PersistenceStore & store)
{
return STORE_TYPE && STORE_HELPER(type, Lookup) && STORE_MEMBER(position) && STORE_MEMBER(scale)
- && STORE_MEMBER(rotation) && STORE_MEMBER(colour)
+ && STORE_MEMBER(rotation) && Style::persist(store)
&& STORE_NAME_HELPER("face", faceControllers, Persistence::MapByMember<FaceControllers>);
}