#include <spritedef.h>
Definition at line 78 of file spritedef.h.
Public Member Functions | |
Action * | getAction (SpriteAction action) const |
Returns the specified action. | |
Static Public Member Functions | |
static SpriteDef * | load (const std::string &file, int variant) |
Loads a sprite definition file. | |
static SpriteAction | makeSpriteAction (const std::string &action) |
Converts a string into a SpriteAction enum. | |
static SpriteDirection | makeSpriteDirection (const std::string &direction) |
Converts a string into a SpriteDirection enum. | |
Private Types | |
typedef std::map< std::string, ImageSet * > | ImageSets |
typedef ImageSets::iterator | ImageSetIterator |
typedef std::map< SpriteAction, Action * > | Actions |
Private Member Functions | |
SpriteDef () | |
Constructor. | |
~SpriteDef () | |
Destructor. | |
void | loadSprite (xmlNodePtr spriteNode, int variant, const std::string &palettes="") |
Loads a sprite element. | |
void | loadImageSet (xmlNodePtr node, const std::string &palettes) |
Loads an imageset element. | |
void | loadAction (xmlNodePtr node, int variant_offset) |
Loads an action element. | |
void | loadAnimation (xmlNodePtr animationNode, Action *action, ImageSet *imageSet, int variant_offset) |
Loads an animation element. | |
void | includeSprite (xmlNodePtr includeNode) |
Include another sprite into this one. | |
void | substituteActions () |
Complete missing actions by copying existing ones. | |
void | substituteAction (SpriteAction complete, SpriteAction with) |
When there are no animations defined for the action "complete", its animations become a copy of those of the action "with". | |
Private Attributes | |
ImageSets | mImageSets |
Actions | mActions |
typedef std::map<std::string, ImageSet*> SpriteDef::ImageSets [private] |
Definition at line 152 of file spritedef.h.
typedef ImageSets::iterator SpriteDef::ImageSetIterator [private] |
Definition at line 153 of file spritedef.h.
typedef std::map<SpriteAction, Action*> SpriteDef::Actions [private] |
Definition at line 155 of file spritedef.h.
SpriteDef::SpriteDef | ( | ) | [inline, private] |
SpriteDef::~SpriteDef | ( | ) | [private] |
SpriteDef * SpriteDef::load | ( | const std::string & | file, | |
int | variant | |||
) | [static] |
Action * SpriteDef::getAction | ( | SpriteAction | action | ) | const |
SpriteAction SpriteDef::makeSpriteAction | ( | const std::string & | action | ) | [static] |
SpriteDirection SpriteDef::makeSpriteDirection | ( | const std::string & | direction | ) | [static] |
void SpriteDef::loadSprite | ( | xmlNodePtr | spriteNode, | |
int | variant, | |||
const std::string & | palettes = "" | |||
) | [private] |
void SpriteDef::loadImageSet | ( | xmlNodePtr | node, | |
const std::string & | palettes | |||
) | [private] |
void SpriteDef::loadAction | ( | xmlNodePtr | node, | |
int | variant_offset | |||
) | [private] |
void SpriteDef::includeSprite | ( | xmlNodePtr | includeNode | ) | [private] |
void SpriteDef::substituteActions | ( | ) | [private] |
void SpriteDef::substituteAction | ( | SpriteAction | complete, | |
SpriteAction | with | |||
) | [private] |
When there are no animations defined for the action "complete", its animations become a copy of those of the action "with".
Definition at line 290 of file spritedef.cpp.
ImageSets SpriteDef::mImageSets [private] |
Definition at line 157 of file spritedef.h.
Actions SpriteDef::mActions [private] |
Definition at line 158 of file spritedef.h.