summaryrefslogtreecommitdiff
path: root/assetFactory
diff options
context:
space:
mode:
Diffstat (limited to 'assetFactory')
-rw-r--r--assetFactory/faceController.cpp8
-rw-r--r--assetFactory/faceController.h1
-rw-r--r--assetFactory/style.cpp6
-rw-r--r--assetFactory/style.h1
4 files changed, 8 insertions, 8 deletions
diff --git a/assetFactory/faceController.cpp b/assetFactory/faceController.cpp
index bafbee2..2367f8d 100644
--- a/assetFactory/faceController.cpp
+++ b/assetFactory/faceController.cpp
@@ -48,12 +48,10 @@ FaceController::applySingle(ModelFactoryMesh & mesh, const StyleStack & parents,
faces.merge(std::move(newFaces));
}
else {
- mesh.property(mesh.smoothFaceProperty, faceHandle) = smooth;
applyStyle(mesh, parents + this, faceHandle);
}
}
for (const auto & [faceName, faceHandle] : controlledFaces) {
- mesh.property(mesh.smoothFaceProperty, faceHandle) = smooth;
applyStyle(mesh, parents + this, faceHandle);
}
}
@@ -89,9 +87,8 @@ FaceController::extrude(ModelFactoryMesh & mesh, const std::string & faceName, O
auto & newFaceName = mesh.property(mesh.nameFaceProperty, newFace);
newFaceName = getAdjacentFaceName(mesh, ofrange, newFace);
newFaces.emplace(newFaceName, newFace);
- mesh.property(mesh.smoothFaceProperty, newFace) = smooth;
}
- mesh.property(mesh.smoothFaceProperty, newFaces.emplace(faceName, mesh.add_face(vertices))->second) = smooth;
+ newFaces.emplace(faceName, mesh.add_face(vertices));
return newFaces;
}
@@ -99,7 +96,6 @@ FaceController::extrude(ModelFactoryMesh & mesh, const std::string & faceName, O
bool
FaceController::persist(Persistence::PersistenceStore & store)
{
- return STORE_TYPE && STORE_MEMBER(id) && Style::persist(store) && STORE_MEMBER(type) && STORE_MEMBER(smooth)
- && Mutation::persist(store)
+ return STORE_TYPE && STORE_MEMBER(id) && Style::persist(store) && STORE_MEMBER(type) && Mutation::persist(store)
&& STORE_NAME_HELPER("face", faceControllers, Persistence::MapByMember<FaceControllers>);
}
diff --git a/assetFactory/faceController.h b/assetFactory/faceController.h
index 962a516..851292a 100644
--- a/assetFactory/faceController.h
+++ b/assetFactory/faceController.h
@@ -17,7 +17,6 @@ public:
std::string id;
std::string type;
- bool smooth {false};
FaceControllers faceControllers;
private:
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);
}
diff --git a/assetFactory/style.h b/assetFactory/style.h
index f3bc707..d931f98 100644
--- a/assetFactory/style.h
+++ b/assetFactory/style.h
@@ -31,6 +31,7 @@ public:
static EffectiveColour getColour(const StyleStack & parents);
ColourAlpha colour {};
+ std::optional<bool> smooth;
std::string texture;
std::string textureRotation; // Multiples of 90deg, no int/enum support