diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-20 23:30:21 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-20 23:30:21 +0000 |
commit | 2508112e2853e1a6c012b19c7232aa09f98d3969 (patch) | |
tree | 4e650d6d0d912eacd6c4e38561b175232e717529 /assetFactory/style.cpp | |
parent | Add persistence support for std::optional<>s (diff) | |
download | ilt-2508112e2853e1a6c012b19c7232aa09f98d3969.tar.bz2 ilt-2508112e2853e1a6c012b19c7232aa09f98d3969.tar.xz ilt-2508112e2853e1a6c012b19c7232aa09f98d3969.zip |
Move smooth property into Style and make it optional
This allows it to cascade down as faces are created and also be overridden as required
Diffstat (limited to 'assetFactory/style.cpp')
-rw-r--r-- | assetFactory/style.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/assetFactory/style.cpp b/assetFactory/style.cpp index d1d4adc..12346a6 100644 --- a/assetFactory/style.cpp +++ b/assetFactory/style.cpp @@ -19,6 +19,9 @@ void Style::applyStyle( ModelFactoryMesh & mesh, const ModelFactoryMesh::FaceHandle & face, EffectiveColour effectiveColour) const { + if (smooth.has_value()) { + mesh.property(mesh.smoothFaceProperty, face) = smooth.value(); + } if (texture.empty()) { if (effectiveColour.has_value()) { mesh.set_color(face, effectiveColour->get()); @@ -60,5 +63,6 @@ Style::persist(Persistence::PersistenceStore & store) } }; - return STORE_HELPER(colour, ColourParser) && STORE_MEMBER(texture) && STORE_MEMBER(textureRotation); + return STORE_HELPER(colour, ColourParser) && STORE_MEMBER(smooth) && STORE_MEMBER(texture) + && STORE_MEMBER(textureRotation); } |