Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/particles.cc')
-rw-r--r--src/render/particles.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/render/particles.cc b/src/render/particles.cc
index 6681a4f..d5db8cf 100644
--- a/src/render/particles.cc
+++ b/src/render/particles.cc
@@ -104,6 +104,7 @@ ParticleScript *ParticleScript::load(const std::string &label)
ParticleScript *script = 0;
std::string strval;
float pitch, yaw, roll = 0.0f;
+ bool b;
while (inifile.getline()) {
@@ -173,12 +174,19 @@ ParticleScript *ParticleScript::load(const std::string &label)
} else if (inifile.got_key_float("timeout", script->particlescript_timeout)) {
continue;
} else if (inifile.got_key_color("color", script->particlescript_color)) {
- script->particlescript_has_color = true;
continue;
} else if (inifile.got_key_bool("engine", script->particlescript_engine)) {
continue;
} else if (inifile.got_key_bool("entity", script->particlescript_entity)) {
continue;
+ } else if (inifile.got_key_bool("entitysecond", script->particlescript_entity_second)) {
+ continue;
+ } else if (inifile.got_key_bool("entitythird", b)) {
+ if (b) {
+ script->particlescript_entity = true;
+ script->particlescript_entity_second = true;
+ }
+ continue;
} else if (inifile.got_key_float("angle", yaw)) {
if (yaw == model::ANGLEUP) {
@@ -251,8 +259,8 @@ ParticleScript *ParticleScript::load(const std::string &label)
ParticleScript::ParticleScript(const std::string & label) : particlescript_label(label)
{
particlescript_entity = false;
+ particlescript_entity_second = false;
particlescript_engine = false;
- particlescript_has_color = true;
particlescript_radius = 1.0f;
particlescript_alpha = 1.0f;
@@ -295,12 +303,12 @@ ParticleSystem::ParticleSystem(const ParticleScript *script, const core::Entity
// allow the script to override itself
if (particlesystem_script->entity()) {
particlesystem_color.assign(entity->color());
- }
- if (particlesystem_script->has_color()) {
- particlesystem_color.assign(particlesystem_script->color());
- }
- if (particlesystem_script->engine()) {
+ } else if (particlesystem_script->entity_second()) {
+ particlesystem_color.assign(entity->color_second());
+ } else if (particlesystem_script->engine()) {
particlesystem_color.assign(entity->model()->enginecolor());
+ } else {
+ particlesystem_color.assign(particlesystem_script->color());
}
particlesystem_axis.assign(particlesystem_script->axis());