diff options
Diffstat (limited to 'src/model/tags.h')
-rw-r--r-- | src/model/tags.h | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/src/model/tags.h b/src/model/tags.h index af1bc27..586fd21 100644 --- a/src/model/tags.h +++ b/src/model/tags.h @@ -117,7 +117,12 @@ public: /// light color inline const math::Color& color() const { return light_color; - }; + } + + /// true if the color was set + inline bool has_color() const { + return light_has_color; + } /// true if this is a strobe light inline bool strobe() const { @@ -166,7 +171,17 @@ public: /* ---- mutators ------------------------------------------- */ /** - * @brief set strobe color on or off + * @brief set the light color + * light color overrides engine color if the engine flag is set + * @see engine() + */ + inline void set_color(const math::Color& color) { + light_color.assign(color); + light_has_color = true; + } + + /** + * @brief set strobe on or off */ inline void set_strobe(const bool strobe) { light_strobe = strobe; @@ -227,14 +242,7 @@ public: inline void set_texture(size_t texture) { light_texture = texture; } - - /** - * @brief mutable reference to the color - */ - inline math::Color& get_color() { - return light_color; - } - + private: bool light_strobe; bool light_engine; @@ -248,6 +256,7 @@ private: float light_time; math::Color light_color; + bool light_has_color; size_t light_texture; }; @@ -338,6 +347,16 @@ public: inline bool engine() const { return particles_engine; } + + inline const math::Color & color() const { + return particles_color; + } + + /// true if the color was set + inline bool has_color() const { + return particles_has_color; + } + inline float scale() const { return particles_scale; @@ -374,6 +393,11 @@ public: inline void set_scale(const float scale) { particles_scale = scale; } + + inline void set_color(const math::Color &color) { + particles_color.assign(color); + particles_has_color = true; + } /* ---- actors --------------------------------------------- */ @@ -387,11 +411,13 @@ public: private: bool particles_entity; bool particles_engine; + bool particles_has_color; Cull particles_cull; float particles_scale; + math::Color particles_color; math::Axis particles_axis; std::string particles_script; }; |