diff options
Diffstat (limited to 'src/particle.cpp')
-rw-r--r-- | src/particle.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/particle.cpp b/src/particle.cpp index 84161c9f..398e6a9c 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -61,9 +61,7 @@ Particle::Particle(Map *map): mLifetimePast(0), mFadeOut(0), mFadeIn(0), - mAlpha(1.0f), mAutoDelete(true), - mMap(map), mAllowSizeAdjust(false), mGravity(0.0f), mRandomness(0), @@ -74,16 +72,12 @@ Particle::Particle(Map *map): mInvDieDistance(-1.0f), mMomentum(1.0f) { + setMap(map); Particle::particleCount++; - if (mMap) - setSpriteIterator(mMap->addSprite(this)); } Particle::~Particle() { - // Remove from map sprite list - if (mMap) - mMap->removeSprite(mSpriteIterator); // Delete child emitters and child particles clear(); Particle::particleCount--; @@ -393,13 +387,6 @@ void Particle::adjustEmitterSize(int w, int h) } } -void Particle::setMap(Map *map) -{ - mMap = map; - if (mMap) - setSpriteIterator(mMap->addSprite(this)); -} - void Particle::clear() { delete_all(mChildEmitters); |