summaryrefslogtreecommitdiff
path: root/src/particle.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-04-22 07:15:35 -0600
committerJared Adams <jaxad0127@gmail.com>2010-04-23 08:33:25 -0600
commitc22ea2f169f58e765fc699fcd71bfd3a3cd4f859 (patch)
tree9e19b57d562d3fe24cd69e6441db41162aa6d3e4 /src/particle.cpp
parent93d4de19fdffb6d568c907729449f169c3520c7b (diff)
downloadmana-c22ea2f169f58e765fc699fcd71bfd3a3cd4f859.tar.gz
mana-c22ea2f169f58e765fc699fcd71bfd3a3cd4f859.tar.bz2
mana-c22ea2f169f58e765fc699fcd71bfd3a3cd4f859.tar.xz
mana-c22ea2f169f58e765fc699fcd71bfd3a3cd4f859.zip
Add an Actor class to replace the Sprite class
The Actor class manages the Map reference, position vector, and alpha float. These are the common parts from it's children.
Diffstat (limited to 'src/particle.cpp')
-rw-r--r--src/particle.cpp15
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);