emitter delay and system deletion

This commit is contained in:
Henrique Santiago
2011-12-15 21:48:15 -02:00
parent 9a5be9c4d8
commit 435161df62
8 changed files with 125 additions and 26 deletions

View File

@@ -22,8 +22,11 @@
#include "particle.h"
#include "particlesystem.h"
#include <framework/core/declarations.h>
#include <framework/ui/declarations.h>
ParticleSystem::ParticleSystem()
{
m_finished = false;
}
bool ParticleSystem::load(const OTMLNodePtr& node)
{
@@ -50,6 +53,12 @@ void ParticleSystem::render()
void ParticleSystem::update()
{
// check if finished
if(m_particles.empty() && m_emitters.empty()) {
m_finished = true;
return;
}
// update emitters
for(auto it = m_emitters.begin(), end = m_emitters.end(); it != end;) {
const ParticleEmitterPtr& emitter = *it;