summaryrefslogtreecommitdiff
path: root/src/particle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/particle.cpp')
-rw-r--r--src/particle.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/particle.cpp b/src/particle.cpp
index 84161c9f..e3c45a9f 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -63,7 +63,6 @@ Particle::Particle(Map *map):
mFadeIn(0),
mAlpha(1.0f),
mAutoDelete(true),
- mMap(map),
mAllowSizeAdjust(false),
mGravity(0.0f),
mRandomness(0),
@@ -74,16 +73,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--;
@@ -91,16 +86,17 @@ Particle::~Particle()
void Particle::setupEngine()
{
- Particle::maxCount = (int)config.getValue("particleMaxCount", 3000);
- Particle::fastPhysics = (int)config.getValue("particleFastPhysics", 0);
- Particle::emitterSkip = (int)config.getValue("particleEmitterSkip", 1) + 1;
- Particle::enabled = (bool)config.getValue("particleeffects", true);
+ Particle::maxCount = config.getIntValue("particleMaxCount");
+ Particle::fastPhysics = config.getIntValue("particleFastPhysics");
+ Particle::emitterSkip = config.getIntValue("particleEmitterSkip") + 1;
+ Particle::enabled = config.getBoolValue("particleeffects");
disableAutoDelete();
logger->log("Particle engine set up");
}
-void Particle::draw(Graphics *, int, int) const
+bool Particle::draw(Graphics *, int, int) const
{
+ return false;
}
bool Particle::update()
@@ -393,13 +389,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);