diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-11-20 12:27:56 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-11-20 12:27:56 +0000 |
commit | ca58ec1faedca0081ecd233f2cefa1ba783cebf4 (patch) | |
tree | 11216c01bb8867a9bd4ad6d4b8bdefc3c61a952a /src/resources/spritedef.h | |
parent | 5a7abdafdac8f6ddd7972cadbc7e20563a0a29fc (diff) | |
download | mana-ca58ec1faedca0081ecd233f2cefa1ba783cebf4.tar.gz mana-ca58ec1faedca0081ecd233f2cefa1ba783cebf4.tar.bz2 mana-ca58ec1faedca0081ecd233f2cefa1ba783cebf4.tar.xz mana-ca58ec1faedca0081ecd233f2cefa1ba783cebf4.zip |
Merged revisions 3642,3662-3664,3667 via svnmerge from
https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/trunk
........
r3642 | gmelquio | 2007-10-19 19:46:46 +0200 (Fri, 19 Oct 2007) | 1 line
Factored code between resource handlers. Implemented failure-friendly sprite loader.
........
r3662 | gmelquio | 2007-10-21 21:01:16 +0200 (Sun, 21 Oct 2007) | 1 line
Added persistent positioning.
........
r3663 | gmelquio | 2007-10-21 21:03:43 +0200 (Sun, 21 Oct 2007) | 1 line
Fixed missing pixels at bottom and right.
........
r3664 | gmelquio | 2007-10-21 21:05:56 +0200 (Sun, 21 Oct 2007) | 1 line
Changed to use default values when restoring missing settings.
........
r3667 | gmelquio | 2007-10-21 22:09:08 +0200 (Sun, 21 Oct 2007) | 1 line
Fixed invisible text in dropboxes and shopboxes.
........
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". */ |