Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-11-18 19:21:57 +0000
committerStijn Buys <ingar@osirion.org>2010-11-18 19:21:57 +0000
commita3b3dbf3ced35ae4c0aca148d89509a12f785062 (patch)
tree6fc93069f70eb6059d056a00790be818df2c2f9f /src/model/tags.h
parent138dbc83d5720c8baa7270ece183ce356f619fce (diff)
Corrected default light and flare radius.
Suppoort for entity, engine and color keys in fx_particles and particle scripts. Have light, fx_flare and fx_particles color override engine color if the engine spawnflag is set.
Diffstat (limited to 'src/model/tags.h')
-rw-r--r--src/model/tags.h46
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;
};