From 48071e171de41a23197c7328ba038331a936e0eb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 19 Jan 2013 15:25:24 +0300 Subject: Replace for to FOR_EACH in some classes. --- src/particle.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/particle.cpp') diff --git a/src/particle.cpp b/src/particle.cpp index 666821b93..a14fac698 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -204,12 +204,10 @@ bool Particle::update() // Update child emitters if ((mLifetimePast - 1) % Particle::emitterSkip == 0) { - for (EmitterConstIterator e = mChildEmitters.begin(), - e2 = mChildEmitters.end(); e != e2; ++ e) + FOR_EACH (EmitterConstIterator, e, mChildEmitters) { Particles newParticles = (*e)->createParticles(mLifetimePast); - for (ParticleConstIterator p = newParticles.begin(), - p2 = newParticles.end(); p != p2; ++ p) + FOR_EACH (ParticleConstIterator, p, newParticles) { (*p)->moveBy(mPos); mChildParticles.push_back (*p); @@ -262,8 +260,7 @@ bool Particle::update() void Particle::moveBy(const Vector &change) { mPos += change; - for (ParticleConstIterator p = mChildParticles.begin(), - p2 = mChildParticles.end(); p != p2; ++p) + FOR_EACH (ParticleConstIterator, p, mChildParticles) { if ((*p)->doesFollow()) (*p)->moveBy(change); @@ -461,11 +458,8 @@ void Particle::adjustEmitterSize(const int w, const int h) { if (mAllowSizeAdjust) { - for (EmitterConstIterator e = mChildEmitters.begin(), - e2 = mChildEmitters.end(); e != e2; ++e) - { + FOR_EACH (EmitterConstIterator, e, mChildEmitters) (*e)->adjustSize(w, h); - } } } -- cgit v1.2.3-60-g2f50