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/particleemitter.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/particleemitter.cpp')
-rw-r--r-- | src/particleemitter.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 7f69afe83..0aea1eaca 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -38,6 +38,9 @@ static const float SIN45 = 0.707106781f; static const float DEG_RAD_FACTOR = 0.017453293f; +typedef std::vector<ImageSet*>::const_iterator ImageSetVectorCIter; +typedef std::list<ParticleEmitter>::const_iterator ParticleEmitterListCIter; + ParticleEmitter::ParticleEmitter(const XmlNodePtr emitterNode, Particle *const target, Map *const map, const int rotation, @@ -435,9 +438,7 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) mDeathEffect = o.mDeathEffect; mTempSets = o.mTempSets; - for (std::vector<ImageSet*>::const_iterator - i = mTempSets.begin(), i_end = mTempSets.end(); - i != i_end; ++ i) + FOR_EACH (ImageSetVectorCIter, i, mTempSets) { if (*i) (*i)->incRef(); @@ -453,9 +454,7 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) ParticleEmitter::~ParticleEmitter() { - for (std::vector<ImageSet*>::const_iterator - i = mTempSets.begin(), i_end = mTempSets.end(); - i != i_end; ++i) + FOR_EACH (ImageSetVectorCIter, i, mTempSets) { if (*i) (*i)->decRef(); @@ -576,13 +575,8 @@ std::list<Particle *> ParticleEmitter::createParticles(const int tick) newParticle->setFadeIn(mParticleFadeIn.value(tick)); newParticle->setAlpha(mParticleAlpha.value(tick)); - for (std::list<ParticleEmitter>::const_iterator - it = mParticleChildEmitters.begin(), - it_end = mParticleChildEmitters.end(); - it != it_end; ++it) - { + FOR_EACH (ParticleEmitterListCIter, it, mParticleChildEmitters) newParticle->addEmitter(new ParticleEmitter(*it)); - } if (!mDeathEffect.empty()) newParticle->setDeathEffect(mDeathEffect, mDeathEffectConditions); |