summaryrefslogtreecommitdiff
path: root/src/particleemitter.h
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-10-26 02:32:25 +0000
committerIra Rice <irarice@gmail.com>2008-10-26 02:32:25 +0000
commitfe76762f26180fdbbbac6e16bfa02c8bde3be78b (patch)
tree78867b5e4af1eee3feb7f4c4b3387a7037f18227 /src/particleemitter.h
parentd9c8c729a1dc2f18c1a367eddfd2eb94b79ec190 (diff)
downloadmana-fe76762f26180fdbbbac6e16bfa02c8bde3be78b.tar.gz
mana-fe76762f26180fdbbbac6e16bfa02c8bde3be78b.tar.bz2
mana-fe76762f26180fdbbbac6e16bfa02c8bde3be78b.tar.xz
mana-fe76762f26180fdbbbac6e16bfa02c8bde3be78b.zip
Added Crush's recent Particle engine modifications from TMW.
Diffstat (limited to 'src/particleemitter.h')
-rw-r--r--src/particleemitter.h37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/particleemitter.h b/src/particleemitter.h
index c237c1ba..31346401 100644
--- a/src/particleemitter.h
+++ b/src/particleemitter.h
@@ -27,10 +27,11 @@
#include <list>
#include "utils/xml.h"
-#include "utils/minmax.h"
#include "resources/animation.h"
+#include "particleemitterprop.h"
+
class Image;
class Map;
class Particle;
@@ -66,7 +67,7 @@ class ParticleEmitter
* Spawns new particles
* @return: a list of created particles
*/
- std::list<Particle *> createParticles();
+ std::list<Particle *> createParticles(int tick);
/**
* Sets the target of the particles that are created
@@ -76,50 +77,50 @@ class ParticleEmitter
{ mParticleTarget = target; };
private:
- template <typename T> MinMax<T> readMinMax(xmlNodePtr propertyNode, T def);
+ template <typename T> ParticleEmitterProp<T> readParticleEmitterProp(xmlNodePtr propertyNode, T def);
/**
* initial position of particles:
*/
- MinMax<float> mParticlePosX, mParticlePosY, mParticlePosZ;
+ ParticleEmitterProp<float> mParticlePosX, mParticlePosY, mParticlePosZ;
/**
* initial vector of particles:
*/
- MinMax<float> mParticleAngleHorizontal, mParticleAngleVertical;
+ ParticleEmitterProp<float> mParticleAngleHorizontal, mParticleAngleVertical;
/**
* Initial velocity of particles
*/
- MinMax<float> mParticlePower;
+ ParticleEmitterProp<float> mParticlePower;
/*
* Vector changing of particles:
*/
- MinMax<float> mParticleGravity;
- MinMax<int> mParticleRandomness;
- MinMax<float> mParticleBounce;
+ ParticleEmitterProp<float> mParticleGravity;
+ ParticleEmitterProp<int> mParticleRandomness;
+ ParticleEmitterProp<float> mParticleBounce;
bool mParticleFollow;
/*
* Properties of targeting particles:
*/
Particle *mParticleTarget;
- MinMax<float> mParticleAcceleration;
- MinMax<float> mParticleDieDistance;
- MinMax<float> mParticleMomentum;
+ ParticleEmitterProp<float> mParticleAcceleration;
+ ParticleEmitterProp<float> mParticleDieDistance;
+ ParticleEmitterProp<float> mParticleMomentum;
/*
* Behavior over time of the particles:
*/
- MinMax<int> mParticleLifetime;
- MinMax<int> mParticleFadeOut;
- MinMax<int> mParticleFadeIn;
+ ParticleEmitterProp<int> mParticleLifetime;
+ ParticleEmitterProp<int> mParticleFadeOut;
+ ParticleEmitterProp<int> mParticleFadeIn;
Map *mMap; /**< Map the particles are spawned on */
- MinMax<int> mOutput; /**< Number of particles spawned per update */
- MinMax<int> mOutputPause; /**< Pause in frames between two spawns */
+ ParticleEmitterProp<int> mOutput; /**< Number of particles spawned per update */
+ ParticleEmitterProp<int> mOutputPause; /**< Pause in frames between two spawns */
int mOutputPauseLeft;
/*
@@ -127,7 +128,7 @@ class ParticleEmitter
*/
Image *mParticleImage; /**< Particle image, if used */
Animation mParticleAnimation; /**< Filename of particle animation file */
- MinMax<float> mParticleAlpha; /**< Opacity of the graphical representation of the particles */
+ ParticleEmitterProp<float> mParticleAlpha; /**< Opacity of the graphical representation of the particles */
/** List of emitters the spawned particles are equipped with */
std::list<ParticleEmitter> mParticleChildEmitters;