From 0ee9b8c6036899f95dfd54f151cb60a03645f87a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 12 Mar 2023 01:05:18 +0000 Subject: Support loading texture references into faces --- assetFactory/style.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'assetFactory/style.h') diff --git a/assetFactory/style.h b/assetFactory/style.h index e8fd012..84e5dab 100644 --- a/assetFactory/style.h +++ b/assetFactory/style.h @@ -28,6 +28,8 @@ public: } ColourAlpha colour {}; + std::string texture; + std::string textureRotation; // Multiples of 90deg, no int/enum support protected: bool persist(Persistence::PersistenceStore & store); -- cgit v1.2.3 From 0d5b57f31e17b8e46979d8c29b5a3205fbdbd44b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 12 Mar 2023 01:29:38 +0000 Subject: Dedupe looking up the style stack for colour --- assetFactory/style.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'assetFactory/style.h') diff --git a/assetFactory/style.h b/assetFactory/style.h index 84e5dab..8c64276 100644 --- a/assetFactory/style.h +++ b/assetFactory/style.h @@ -27,6 +27,8 @@ public: return {}; } + static std::optional> getColour(const StyleStack & parents); + ColourAlpha colour {}; std::string texture; std::string textureRotation; // Multiples of 90deg, no int/enum support -- cgit v1.2.3 From 7bf24d23a7db872f7bd13060da9817a9ee5f816c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 12 Mar 2023 01:36:50 +0000 Subject: Dedupe applying style to a face --- assetFactory/style.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'assetFactory/style.h') 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; using Colour = glm::vec3; using ColourAlpha = glm::vec4; + using EffectiveColour = std::optional>; 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> 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; }; -- cgit v1.2.3 From 2508112e2853e1a6c012b19c7232aa09f98d3969 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 20 Mar 2023 23:30:21 +0000 Subject: 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 --- assetFactory/style.h | 1 + 1 file changed, 1 insertion(+) (limited to 'assetFactory/style.h') 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 smooth; std::string texture; std::string textureRotation; // Multiples of 90deg, no int/enum support -- cgit v1.2.3