diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-01-19 15:25:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-01-20 17:05:57 +0300 |
commit | 48071e171de41a23197c7328ba038331a936e0eb (patch) | |
tree | 73c7ef1da8e5dd76469d75c0336d88c3371e4263 /src/particle.cpp | |
parent | d07fba228b5251862ad670e1d4f079c9456fab4b (diff) | |
download | manaverse-48071e171de41a23197c7328ba038331a936e0eb.tar.gz manaverse-48071e171de41a23197c7328ba038331a936e0eb.tar.bz2 manaverse-48071e171de41a23197c7328ba038331a936e0eb.tar.xz manaverse-48071e171de41a23197c7328ba038331a936e0eb.zip |
Replace for to FOR_EACH in some classes.
Diffstat (limited to 'src/particle.cpp')
-rw-r--r-- | src/particle.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
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); - } } } |