summaryrefslogtreecommitdiff
path: root/src/particle.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <mana@crushnet.org>2010-03-07 20:30:38 +0100
committerPhilipp Sehmisch <mana@crushnet.org>2010-03-07 20:30:38 +0100
commit5ba23a83501dc267a0adbd17d0ae23def3acf089 (patch)
treee9c5f7ddb07d67ce55d763d0d8bdad5356debd8d /src/particle.cpp
parent8eafd18df42963c0aab1aef8911ce61d51448c16 (diff)
downloadMana-5ba23a83501dc267a0adbd17d0ae23def3acf089.tar.gz
Mana-5ba23a83501dc267a0adbd17d0ae23def3acf089.tar.bz2
Mana-5ba23a83501dc267a0adbd17d0ae23def3acf089.tar.xz
Mana-5ba23a83501dc267a0adbd17d0ae23def3acf089.zip
Added a property to particle files which says if they may be resized based on the dimensions in the map file or not.
Reviewed-by: Jared Adams
Diffstat (limited to 'src/particle.cpp')
-rw-r--r--src/particle.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/particle.cpp b/src/particle.cpp
index d3dbfd64..84161c9f 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -64,6 +64,7 @@ Particle::Particle(Map *map):
mAlpha(1.0f),
mAutoDelete(true),
mMap(map),
+ mAllowSizeAdjust(false),
mGravity(0.0f),
mRandomness(0),
mBounce(0.0f),
@@ -322,6 +323,8 @@ Particle *Particle::addEffect(const std::string &particleEffectFile,
int lifetime = XML::getProperty(effectChildNode, "lifetime", -1);
newParticle->setLifetime(lifetime);
+ bool resizeable = "false" != XML::getProperty(effectChildNode, "size-adjustable", "false");
+ newParticle->setAllowSizeAdjust(resizeable);
// Look for additional emitters for this particle
for_each_xml_child_node(emitterNode, effectChildNode)
@@ -380,10 +383,13 @@ Particle *Particle::addTextRiseFadeOutEffect(const std::string &text,
void Particle::adjustEmitterSize(int w, int h)
{
- for (EmitterIterator e = mChildEmitters.begin();
- e != mChildEmitters.end(); e++)
+ if (mAllowSizeAdjust)
{
- (*e)->adjustSize(w, h);
+ for (EmitterIterator e = mChildEmitters.begin();
+ e != mChildEmitters.end(); e++)
+ {
+ (*e)->adjustSize(w, h);
+ }
}
}