diff options
Diffstat (limited to 'src/particle')
-rw-r--r-- | src/particle/particle.cpp | 7 | ||||
-rw-r--r-- | src/particle/particleemitter.cpp | 9 | ||||
-rw-r--r-- | src/particle/particleemitter.h | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp index 9dee09754..b487e5ffb 100644 --- a/src/particle/particle.cpp +++ b/src/particle/particle.cpp @@ -203,8 +203,11 @@ bool Particle::update() { FOR_EACH (EmitterConstIterator, e, mChildEmitters) { - Particles newParticles = (*e)->createParticles(mLifetimePast); - FOR_EACH (ParticleConstIterator, it, newParticles) + std::vector<Particle*> newParticles; + (*e)->createParticles(mLifetimePast, newParticles); + FOR_EACH (std::vector<Particle*>::const_iterator, + it, + newParticles) { Particle *const p = *it; p->moveBy(mPos); diff --git a/src/particle/particleemitter.cpp b/src/particle/particleemitter.cpp index af9b32fe4..5cba3ba54 100644 --- a/src/particle/particleemitter.cpp +++ b/src/particle/particleemitter.cpp @@ -483,14 +483,13 @@ ParticleEmitter::readParticleEmitterProp(XmlNodePtrConst propertyNode, T def) return retval; } -std::list<Particle *> ParticleEmitter::createParticles(const int tick) +void ParticleEmitter::createParticles(const int tick, + std::vector<Particle*> &newParticles) { - std::list<Particle *> newParticles; - if (mOutputPauseLeft > 0) { mOutputPauseLeft --; - return newParticles; + return; } mOutputPauseLeft = mOutputPause.value(tick); @@ -574,8 +573,6 @@ std::list<Particle *> ParticleEmitter::createParticles(const int tick) newParticles.push_back(newParticle); } - - return newParticles; } void ParticleEmitter::adjustSize(const int w, const int h) diff --git a/src/particle/particleemitter.h b/src/particle/particleemitter.h index 395f09ac4..41381b6e1 100644 --- a/src/particle/particleemitter.h +++ b/src/particle/particleemitter.h @@ -66,9 +66,9 @@ class ParticleEmitter final /** * Spawns new particles - * @return: a list of created particles */ - std::list<Particle *> createParticles(const int tick); + void createParticles(const int tick, + std::vector<Particle*> &newParticles); /** * Sets the target of the particles that are created |