ManaPlus
|
#include <particleemitter.h>
Public Member Functions | |
ParticleEmitter (const xmlNode *const emitterNode, Particle *const target, Map *const map, const int rotation, const std::string &dyePalettes) | |
ParticleEmitter (const ParticleEmitter &o) | |
ParticleEmitter & | operator= (const ParticleEmitter &o) |
~ParticleEmitter () | |
void | createParticles (const int tick, std::vector< Particle * > &newParticles) |
void | setTarget (Particle *const target) |
void | adjustSize (const int w, const int h) |
Static Private Member Functions | |
template<typename T > | |
static ParticleEmitterProp< T > | readParticleEmitterProp (xmlNode *const propertyNode, T def) |
static ImageSet * | getImageSet (xmlNode *const node) |
Every Particle can have one or more particle emitters that create new particles when they are updated
Definition at line 44 of file particleemitter.h.
ParticleEmitter::ParticleEmitter | ( | const xmlNode *const | emitterNode, |
Particle *const | target, | ||
Map *const | map, | ||
const int | rotation, | ||
const std::string & | dyePalettes | ||
) |
Definition at line 54 of file particleemitter.cpp.
References Animation::addFrame(), Animation::addTerminator(), CAST_S8, ParticleEmitterProp< T >::changeAmplitude, AliveStatus::DEAD_FLOOR, AliveStatus::DEAD_IMPACT, AliveStatus::DEAD_OTHER, AliveStatus::DEAD_SKY, AliveStatus::DEAD_TIMEOUT, DEG_RAD_FACTOR, for_each_xml_child_node, ImageSet::get(), XML::getBoolProperty(), ImageSet::getHeight(), Loader::getImage(), getImageSet(), XML::getIntProperty(), XML::getProperty(), Loader::getSubImage(), ImageSet::getWidth(), Dye::instantiate(), Logger::log(), Logger::log1(), logger, mapTileSize, ParticleEmitterProp< T >::maxVal, mDeathEffect, mDeathEffectConditions, ParticleEmitterProp< T >::minVal, mOutput, mOutputPause, mOutputPauseLeft, mParticleAcceleration, mParticleAlpha, mParticleAngleHorizontal, mParticleAngleVertical, mParticleAnimation, mParticleBounce, mParticleChildEmitters, mParticleDieDistance, mParticleFadeIn, mParticleFadeOut, mParticleFollow, mParticleGravity, mParticleImage, mParticleLifetime, mParticleMomentum, mParticlePosX, mParticlePosY, mParticlePosZ, mParticlePower, mParticleRandomness, mParticleRotation, mParticleTarget, mTempSets, readParticleEmitterProp(), ParticleEmitterProp< T >::set(), SIN45, anonymous_namespace{stringutils.cpp}::start, and ParticleEmitterProp< T >::value().
Referenced by createParticles().
ParticleEmitter::ParticleEmitter | ( | const ParticleEmitter & | o | ) |
Copy Constructor (necessary for reference counting of particle images)
Definition at line 369 of file particleemitter.cpp.
ParticleEmitter::~ParticleEmitter | ( | ) |
Destructor.
Definition at line 456 of file particleemitter.cpp.
References FOR_EACH, mParticleImage, and mTempSets.
void ParticleEmitter::adjustSize | ( | const int | w, |
const int | h | ||
) |
Changes the size of the emitter so that the effect fills a rectangle of this size
Definition at line 606 of file particleemitter.cpp.
References CAST_S32, ParticleEmitterProp< T >::maxVal, ParticleEmitterProp< T >::minVal, mOutput, mParticlePosX, mParticlePosY, and ParticleEmitterProp< T >::set().
void ParticleEmitter::createParticles | ( | const int | tick, |
std::vector< Particle * > & | newParticles | ||
) |
Spawns new particles
Definition at line 514 of file particleemitter.cpp.
References Particle::addEmitter(), ParticleType::Animation, AttributesEnum::find(), FOR_EACH, ImageParticle::imageParticleCountByName, ParticleEngine::maxCount, mDeathEffect, mDeathEffectConditions, Animation::mFrames, mMap, mOutput, mOutputPause, mOutputPauseLeft, Particle::moveTo(), mParticleAcceleration, mParticleAlpha, mParticleAngleHorizontal, mParticleAngleVertical, mParticleAnimation, mParticleBounce, mParticleChildEmitters, mParticleDieDistance, mParticleFadeIn, mParticleFadeOut, mParticleFollow, mParticleGravity, mParticleImage, mParticleLifetime, mParticleMomentum, mParticlePosX, mParticlePosY, mParticlePosZ, mParticlePower, mParticleRandomness, mParticleRotation, mParticleTarget, ParticleEngine::particleCount, ParticleEmitter(), Particle::setAlpha(), Particle::setBounce(), Particle::setDeathEffect(), Particle::setDestination(), Particle::setDieDistance(), Particle::setFadeIn(), Particle::setFadeOut(), Particle::setFollow(), Particle::setGravity(), Particle::setLifetime(), Actor::setMap(), Particle::setRandomness(), Particle::setVelocity(), and ParticleEmitterProp< T >::value().
|
staticprivate |
Definition at line 374 of file particleemitter.cpp.
References Loader::getImage(), Loader::getImageSet(), XML::getProperty(), Loader::getSubImage(), and Loader::getSubImageSet().
Referenced by ParticleEmitter().
ParticleEmitter & ParticleEmitter::operator= | ( | const ParticleEmitter & | o | ) |
Assignment operator that calls the copy constructor
Definition at line 411 of file particleemitter.cpp.
References FOR_EACH, mDeathEffect, mDeathEffectConditions, mMap, mOutput, mOutputPause, mOutputPauseLeft, mParticleAcceleration, mParticleAlpha, mParticleAngleHorizontal, mParticleAngleVertical, mParticleAnimation, mParticleBounce, mParticleChildEmitters, mParticleDieDistance, mParticleFadeIn, mParticleFadeOut, mParticleFollow, mParticleGravity, mParticleImage, mParticleLifetime, mParticleMomentum, mParticlePosX, mParticlePosY, mParticlePosZ, mParticlePower, mParticleRandomness, mParticleRotation, mParticleTarget, and mTempSets.
|
staticprivate |
Definition at line 473 of file particleemitter.cpp.
References ParticleChangeFunc::FUNC_SAW, ParticleChangeFunc::FUNC_SINE, ParticleChangeFunc::FUNC_SQUARE, ParticleChangeFunc::FUNC_TRIANGLE, XML::getDoubleProperty(), XML::getProperty(), ParticleEmitterProp< T >::set(), and ParticleEmitterProp< T >::setFunction().
Referenced by ParticleEmitter().
|
inline |
Sets the target of the particles that are created
Definition at line 79 of file particleemitter.h.
References mParticleTarget.
|
private |
Definition at line 159 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 168 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 133 of file particleemitter.h.
Referenced by createParticles(), and operator=().
|
private |
Definition at line 136 of file particleemitter.h.
Referenced by adjustSize(), createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 139 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 166 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 121 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 154 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
initial vector of particles:
Definition at line 102 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 103 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 148 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 115 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 162 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 122 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 130 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 129 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 170 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 113 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 145 of file particleemitter.h.
Referenced by createParticles(), operator=(), ParticleEmitter(), and ~ParticleEmitter().
|
private |
Definition at line 128 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 123 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
initial position of particles:
Definition at line 97 of file particleemitter.h.
Referenced by adjustSize(), createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 97 of file particleemitter.h.
Referenced by adjustSize(), createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 97 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Initial velocity of particles
Definition at line 108 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 114 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 151 of file particleemitter.h.
Referenced by createParticles(), operator=(), and ParticleEmitter().
|
private |
Definition at line 120 of file particleemitter.h.
Referenced by createParticles(), operator=(), ParticleEmitter(), and setTarget().
|
private |
Definition at line 164 of file particleemitter.h.
Referenced by operator=(), ParticleEmitter(), and ~ParticleEmitter().