summaryrefslogtreecommitdiff
path: root/src/particle.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-25 02:26:34 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-25 02:26:34 +0300
commitc9f43996f3147100627ee2c6f9da993ceb160113 (patch)
tree7577f02f4658b19e05d586f66b67a9a4f5fedb7e /src/particle.cpp
parent8e19f9b9d792cf4d3d3b022fd26a258c3d3d97bf (diff)
downloadplus-c9f43996f3147100627ee2c6f9da993ceb160113.tar.gz
plus-c9f43996f3147100627ee2c6f9da993ceb160113.tar.bz2
plus-c9f43996f3147100627ee2c6f9da993ceb160113.tar.xz
plus-c9f43996f3147100627ee2c6f9da993ceb160113.zip
Improve iterators part 2.
Diffstat (limited to 'src/particle.cpp')
-rw-r--r--src/particle.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/particle.cpp b/src/particle.cpp
index 0d771a15e..c1f2d9edd 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -203,12 +203,12 @@ bool Particle::update()
// Update child emitters
if ((mLifetimePast - 1) % Particle::emitterSkip == 0)
{
- for (EmitterConstIterator e = mChildEmitters.begin();
- e != mChildEmitters.end(); ++e)
+ for (EmitterConstIterator e = mChildEmitters.begin(),
+ e2 = mChildEmitters.end(); e != e2; ++ e)
{
Particles newParticles = (*e)->createParticles(mLifetimePast);
- for (ParticleConstIterator p = newParticles.begin();
- p != newParticles.end(); ++p)
+ for (ParticleConstIterator p = newParticles.begin(),
+ p2 = newParticles.end(); p != p2; ++ p)
{
(*p)->moveBy(mPos);
mChildParticles.push_back (*p);
@@ -234,8 +234,8 @@ bool Particle::update()
// Update child particles
- for (ParticleIterator p = mChildParticles.begin();
- p != mChildParticles.end(); )
+ for (ParticleIterator p = mChildParticles.begin(),
+ p2 = mChildParticles.end(); p != p2; )
{
//move particle with its parent if desired
if ((*p)->doesFollow())
@@ -261,8 +261,8 @@ bool Particle::update()
void Particle::moveBy(const Vector &change)
{
mPos += change;
- for (ParticleConstIterator p = mChildParticles.begin();
- p != mChildParticles.end(); ++p)
+ for (ParticleConstIterator p = mChildParticles.begin(),
+ p2 = mChildParticles.end(); p != p2; ++p)
{
if ((*p)->doesFollow())
(*p)->moveBy(change);
@@ -454,8 +454,8 @@ void Particle::adjustEmitterSize(int w, int h)
{
if (mAllowSizeAdjust)
{
- for (EmitterConstIterator e = mChildEmitters.begin();
- e != mChildEmitters.end(); ++e)
+ for (EmitterConstIterator e = mChildEmitters.begin(),
+ e2 = mChildEmitters.end(); e != e2; ++e)
{
(*e)->adjustSize(w, h);
}