summaryrefslogtreecommitdiff
path: root/assetFactory/style.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-20 23:30:21 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-20 23:30:21 +0000
commit2508112e2853e1a6c012b19c7232aa09f98d3969 (patch)
tree4e650d6d0d912eacd6c4e38561b175232e717529 /assetFactory/style.cpp
parentAdd persistence support for std::optional<>s (diff)
downloadilt-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.cpp6
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);
}