diff options
Diffstat (limited to 'src/resources/spritedef.h')
-rw-r--r-- | src/resources/spritedef.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 55d7f459..121f23cc 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -71,28 +71,26 @@ class SpriteDef : public Resource { public: /** - * Constructor. + * Loads a sprite definition file. */ - SpriteDef(const std::string &idPath, - const std::string &file, int variant); + static SpriteDef *load(std::string const &file, int variant); /** - * Destructor. + * Returns the specified action. */ - ~SpriteDef(); + Action *getAction(SpriteAction action) const; + + private: /** - * Returns the specified action. + * Constructor. */ - Action* - getAction(SpriteAction action) const; + SpriteDef(): mAction(NULL), mDirection(DIRECTION_DOWN), mLastTime(0) {} - private: /** - * Loads a sprite definition file. + * Destructor. */ - void - load(const std::string &file, int variant); + ~SpriteDef(); /** * Loads an imageset element. @@ -121,6 +119,11 @@ class SpriteDef : public Resource includeSprite(xmlNodePtr includeNode); /** + * Complete missing actions by copying existing ones. + */ + void substituteActions(); + + /** * When there are no animations defined for the action "complete", its * animations become a copy of those of the action "with". */ |