ManaPlus
|
#include <animation.h>
Public Types | |
typedef std::vector< Frame > | Frames |
typedef Frames::iterator | FramesIter |
typedef Frames::const_iterator | FramesCIter |
typedef Frames::reverse_iterator | FramesRevIter |
Public Member Functions | |
Animation () | |
Animation (const std::string &name) | |
void | addFrame (Image *const image, const int delay, const int offsetX, const int offsetY, const int rand) |
void | addTerminator (const int rand) |
size_t | getLength () const |
void | addJump (const std::string &name, const int rand) |
void | addLabel (const std::string &name) |
void | addGoto (const std::string &name, const int rand) |
void | addPause (const int delay, const int rand) |
void | setLastFrameDelay (const int delay) |
int | calcMemoryLocal () const |
std::string | getCounterName () const |
Public Member Functions inherited from MemoryCounter | |
MemoryCounter () | |
virtual | ~MemoryCounter () |
int | calcMemory (const int level) const |
virtual int | calcMemoryChilds (const int level) const |
Protected Attributes | |
Frames | mFrames |
std::string | mName |
int | mDuration |
Friends | |
class | AnimatedSprite |
class | ParticleEmitter |
class | SimpleAnimation |
An animation consists of several frames, each with their own delay and offset.
Definition at line 41 of file animation.h.
typedef std::vector<Frame> Animation::Frames |
Definition at line 83 of file animation.h.
typedef Frames::const_iterator Animation::FramesCIter |
Definition at line 85 of file animation.h.
typedef Frames::iterator Animation::FramesIter |
Definition at line 84 of file animation.h.
typedef Frames::reverse_iterator Animation::FramesRevIter |
Definition at line 86 of file animation.h.
Animation::Animation | ( | ) |
|
explicit |
Definition at line 38 of file animation.cpp.
void Animation::addFrame | ( | Image *const | image, |
const int | delay, | ||
const int | offsetX, | ||
const int | offsetY, | ||
const int | rand | ||
) |
Appends a new animation at the end of the sequence.
Definition at line 46 of file animation.cpp.
References FrameType::ANIMATION.
Referenced by SpriteDef::addSequence(), SimpleAnimation::initializeAnimation(), SpriteDef::loadAnimation(), ParticleEmitter::ParticleEmitter(), ProgressIndicator::ProgressIndicator(), and MapReader::readTileset().
void Animation::addGoto | ( | const std::string & | name, |
const int | rand | ||
) |
Definition at line 73 of file animation.cpp.
References FrameType::GOTO.
Referenced by SpriteDef::loadAnimation().
void Animation::addJump | ( | const std::string & | name, |
const int | rand | ||
) |
Definition at line 61 of file animation.cpp.
References FrameType::JUMP.
Referenced by SpriteDef::loadAnimation().
void Animation::addLabel | ( | const std::string & | name | ) |
Definition at line 67 of file animation.cpp.
References FrameType::LABEL.
Referenced by SpriteDef::loadAnimation().
void Animation::addPause | ( | const int | delay, |
const int | rand | ||
) |
Definition at line 79 of file animation.cpp.
References FrameType::PAUSE.
Referenced by SpriteDef::loadAnimation().
void Animation::addTerminator | ( | const int | rand | ) |
Appends an animation terminator that states that the animation should not loop.
Definition at line 56 of file animation.cpp.
Referenced by SimpleAnimation::initializeAnimation(), SpriteDef::loadAnimation(), and ParticleEmitter::ParticleEmitter().
|
virtual |
Reimplemented from MemoryCounter.
Definition at line 98 of file animation.cpp.
References Animation(), FOR_EACH, mFrames, and Frame::nextAction.
|
inlinevirtual |
|
inline |
Returns the length of this animation in frames.
Definition at line 70 of file animation.h.
References mFrames.
Referenced by AnimatedSprite::getFrameCount(), SimpleAnimation::getLength(), AnimatedSprite::play(), MapReader::readTileset(), SimpleAnimation::setFrame(), and SimpleAnimation::update().
void Animation::setLastFrameDelay | ( | const int | delay | ) |
Definition at line 85 of file animation.cpp.
References FrameType::ANIMATION.
Referenced by Action::setLastFrameDelay().
|
friend |
Definition at line 43 of file animation.h.
|
friend |
Definition at line 44 of file animation.h.
|
friend |
Definition at line 45 of file animation.h.
|
protected |
Definition at line 101 of file animation.h.
|
protected |
Definition at line 99 of file animation.h.
Referenced by calcMemoryLocal(), ParticleEmitter::createParticles(), getLength(), AnimatedSprite::reset(), SimpleAnimation::setFrame(), SimpleAnimation::SimpleAnimation(), and SimpleAnimation::update().
|
protected |
Definition at line 100 of file animation.h.
Referenced by getCounterName().