summaryrefslogtreecommitdiff
path: root/assetFactory/style.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-12 01:36:50 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-12 19:43:14 +0000
commit7bf24d23a7db872f7bd13060da9817a9ee5f816c (patch)
tree8bb9f0c9da747aa5bcb4d0b76230e3f0a1f4a166 /assetFactory/style.h
parentDedupe looking up the style stack for colour (diff)
downloadilt-7bf24d23a7db872f7bd13060da9817a9ee5f816c.tar.bz2
ilt-7bf24d23a7db872f7bd13060da9817a9ee5f816c.tar.xz
ilt-7bf24d23a7db872f7bd13060da9817a9ee5f816c.zip
Dedupe applying style to a face
Diffstat (limited to 'assetFactory/style.h')
-rw-r--r--assetFactory/style.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/assetFactory/style.h b/assetFactory/style.h
index 8c64276..f3bc707 100644
--- a/assetFactory/style.h
+++ b/assetFactory/style.h
@@ -12,6 +12,7 @@ public:
using StyleStack = std::vector<const Style *>;
using Colour = glm::vec3;
using ColourAlpha = glm::vec4;
+ using EffectiveColour = std::optional<std::reference_wrapper<const ColourAlpha>>;
void applyStyle(ModelFactoryMesh &, const StyleStack & parents, const Shape::CreatedFaces &) const;
void applyStyle(ModelFactoryMesh &, const StyleStack & parents, const ModelFactoryMesh::FaceHandle &) const;
@@ -27,7 +28,7 @@ public:
return {};
}
- static std::optional<std::reference_wrapper<const ColourAlpha>> getColour(const StyleStack & parents);
+ static EffectiveColour getColour(const StyleStack & parents);
ColourAlpha colour {};
std::string texture;
@@ -35,4 +36,5 @@ public:
protected:
bool persist(Persistence::PersistenceStore & store);
+ void applyStyle(ModelFactoryMesh &, const ModelFactoryMesh::FaceHandle &, EffectiveColour) const;
};