diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-06-23 14:44:20 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-06-23 14:44:20 +0000 |
commit | 4ec7db55c227d3c38f2358fa74ff2649d6583391 (patch) | |
tree | 20f784d7a90b1a22b377ffd0d55fb3251986b5e2 /src/particleemitter.cpp | |
parent | 6e9aa693c6f07c99e5b84ee35570a14efe4df393 (diff) | |
download | mana-4ec7db55c227d3c38f2358fa74ff2649d6583391.tar.gz mana-4ec7db55c227d3c38f2358fa74ff2649d6583391.tar.bz2 mana-4ec7db55c227d3c38f2358fa74ff2649d6583391.tar.xz mana-4ec7db55c227d3c38f2358fa74ff2649d6583391.zip |
Implemented "alpha" particle property.
Diffstat (limited to 'src/particleemitter.cpp')
-rw-r--r-- | src/particleemitter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 6f66b632..8f46c32b 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -61,6 +61,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * mParticleFadeOut.set(0); mParticleFadeIn.set(0); mOutput.set(1); + mParticleAlpha.set(1.0f); for_each_xml_child_node(propertyNode, emitterNode) { @@ -153,6 +154,10 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * { mParticleFadeIn = readMinMax(propertyNode, 0); } + else if (name == "alpha") + { + mParticleAlpha = readMinMax(propertyNode, 1.0f); + } else { logger->log("Particle Engine: Warning, unknown emitter property \"%s\"", @@ -260,6 +265,7 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) mParticleLifetime = o.mParticleLifetime; mParticleFadeOut = o.mParticleFadeOut; mParticleFadeIn = o.mParticleFadeIn; + mParticleAlpha = o.mParticleAlpha; mMap = o.mMap; mOutput = o.mOutput; mParticleImage = o.mParticleImage; @@ -343,6 +349,7 @@ ParticleEmitter::createParticles() newParticle->setLifetime(mParticleLifetime.value()); newParticle->setFadeOut(mParticleFadeOut.value()); newParticle->setFadeIn(mParticleFadeIn.value()); + newParticle->setAlpha(mParticleAlpha.value()); for (std::list<ParticleEmitter>::iterator i = mParticleChildEmitters.begin(); i != mParticleChildEmitters.end(); |