aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx/animationresource.h
diff options
context:
space:
mode:
authorPaul Gilbert2010-08-23 00:32:45 +0000
committerEugene Sandulenko2010-10-12 23:14:56 +0000
commit5bd5790e5714403682bd254625c7b1dd9813b65d (patch)
tree91a9518e95202f00cf94acc458d24a0e26f0aff8 /engines/sword25/gfx/animationresource.h
parentee753bf0313e6fadf369b330bb169309cd5a84c6 (diff)
downloadscummvm-rg350-5bd5790e5714403682bd254625c7b1dd9813b65d.tar.gz
scummvm-rg350-5bd5790e5714403682bd254625c7b1dd9813b65d.tar.bz2
scummvm-rg350-5bd5790e5714403682bd254625c7b1dd9813b65d.zip
SWORD25: Converted AnimationResource to use SCUMMVM XMLParser. Removed tinyxml library
svn-id: r53281
Diffstat (limited to 'engines/sword25/gfx/animationresource.h')
-rw-r--r--engines/sword25/gfx/animationresource.h38
1 files changed, 27 insertions, 11 deletions
diff --git a/engines/sword25/gfx/animationresource.h b/engines/sword25/gfx/animationresource.h
index 2bc052c39c..ca0fd9ca23 100644
--- a/engines/sword25/gfx/animationresource.h
+++ b/engines/sword25/gfx/animationresource.h
@@ -39,13 +39,12 @@
// Includes
// -----------------------------------------------------------------------------
+#include "common/xmlparser.h"
#include "sword25/kernel/common.h"
#include "sword25/kernel/resource.h"
#include "sword25/gfx/animationdescription.h"
#include "sword25/gfx/animation.h"
-class TiXmlElement;
-
namespace Sword25 {
// -----------------------------------------------------------------------------
@@ -59,9 +58,9 @@ class PackageManager;
// Class Definition
// -----------------------------------------------------------------------------
-class AnimationResource : public Resource, public AnimationDescription {
+class AnimationResource : public Resource, public AnimationDescription, public Common::XMLParser {
public:
- AnimationResource(const Common::String &FileName);
+ AnimationResource(const Common::String &filename);
virtual ~AnimationResource();
virtual const Frame &GetFrame(unsigned int Index) const {
@@ -100,18 +99,35 @@ public:
private:
bool m_Valid;
- Common::Array<Frame> m_Frames;
-
- //@{
- /** @name Dokument-Parser Methoden */
+ Common::Array<Frame> m_Frames;
- bool ParseAnimationTag(TiXmlElement &AnimationTag, int &FPS, Animation::ANIMATION_TYPES &AnimationType);
- bool ParseFrameTag(TiXmlElement &FrameTag, Frame &Frame, PackageManager &PackageManager);
+ PackageManager * _pPackage;
- //@}
bool ComputeFeatures();
bool PrecacheAllFrames() const;
+
+ // Parser
+ CUSTOM_XML_PARSER(AnimationResource) {
+ XML_KEY(animation)
+ XML_PROP(fps, true)
+ XML_PROP(type, true)
+
+ XML_KEY(frame)
+ XML_PROP(file, true)
+ XML_PROP(hotspotx, true)
+ XML_PROP(hotspoty, true)
+ XML_PROP(fliph, false)
+ XML_PROP(flipv, false)
+ KEY_END()
+ KEY_END()
+ } PARSER_END()
+
+ bool parseBooleanKey(Common::String s, bool &result);
+
+ // Parser callback methods
+ bool parserCallback_animation(ParserNode *node);
+ bool parserCallback_frame(ParserNode *node);
};
} // End of namespace Sword25