From b04e9dbada7f82434774b8af02db5c1f975ea2d6 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 17 Oct 2013 20:06:14 +0000 Subject: Draw explosion particles for destroyed dynamic entities. --- src/render/particlesystem.cc | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/render') diff --git a/src/render/particlesystem.cc b/src/render/particlesystem.cc index 1487587..c085d5d 100644 --- a/src/render/particlesystem.cc +++ b/src/render/particlesystem.cc @@ -181,12 +181,16 @@ void ParticleSystem::draw(const float seconds) } break; - case core::Entity::Destroyed: + case core::Entity::Destroyed: if (ejector->explosion()) { ejector_active = true; } break; + case core::Entity::NoPower: + ejector_active = false; + break; + default: break; } @@ -197,6 +201,26 @@ void ParticleSystem::draw(const float seconds) if (dynamic->state() == core::Entity::NoPower) { ejector_active = false; } + + switch (dynamic->state()) { + case core::Entity::Impulse: + case core::Entity::ImpulseInitiate: + case core::Entity::Normal: + break; + + case core::Entity::Destroyed: + if (ejector->explosion()) { + ejector_active = true; + } + break; + + case core::Entity::NoPower: + ejector_active = false; + break; + + default: + break; + } } ejector->enable(ejector_active); } -- cgit v1.2.3