diff options
author | Paul Gilbert | 2010-08-22 02:06:18 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 23:13:24 +0000 |
commit | b294e88f7e89a0b3d89b5d184e1b491eaddff70f (patch) | |
tree | 0b54d8bd083aa9783d023a2255fabc4ac4a3dbcd /engines/sword25/gfx/fontresource.h | |
parent | 2c6201683854d3f56c93f3f2ca1f826b1b2f450e (diff) | |
download | scummvm-rg350-b294e88f7e89a0b3d89b5d184e1b491eaddff70f.tar.gz scummvm-rg350-b294e88f7e89a0b3d89b5d184e1b491eaddff70f.tar.bz2 scummvm-rg350-b294e88f7e89a0b3d89b5d184e1b491eaddff70f.zip |
SWORD25: Converted FontResource to use ScummVM XML Parser
svn-id: r53277
Diffstat (limited to 'engines/sword25/gfx/fontresource.h')
-rw-r--r-- | engines/sword25/gfx/fontresource.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/engines/sword25/gfx/fontresource.h b/engines/sword25/gfx/fontresource.h index 786405fe11..cfb0251084 100644 --- a/engines/sword25/gfx/fontresource.h +++ b/engines/sword25/gfx/fontresource.h @@ -39,12 +39,11 @@ // Includes // ----------------------------------------------------------------------------- +#include "common/scummsys.h" +#include "common/rect.h" +#include "common/xmlparser.h" #include "sword25/kernel/common.h" #include "sword25/kernel/resource.h" -#include "common/rect.h" - -class TiXmlDocument; -class TiXmlElement; namespace Sword25 { @@ -58,7 +57,7 @@ class Kernel; // Klassendefinition // ----------------------------------------------------------------------------- -class FontResource : public Resource { +class FontResource : public Resource, Common::XMLParser { public: /** @brief Erzeugt eine neues Exemplar von BS_FontResource @@ -120,13 +119,34 @@ private: int _GapWidth; Common::Rect _CharacterRects[256]; + // Parser + CUSTOM_XML_PARSER(FontResource) { + XML_KEY(font) + XML_PROP(bitmap, true) + XML_PROP(lineheight, false) + XML_PROP(gap, false) + + XML_KEY(character) + XML_PROP(code, true) + XML_PROP(left, true) + XML_PROP(top, true) + XML_PROP(right, true) + XML_PROP(bottom, true) + KEY_END() + KEY_END() + } PARSER_END() + + // Parser callback methods + bool parserCallback_font(ParserNode *node); + bool parserCallback_character(ParserNode *node); + // ----------------------------------------------------------------------------- // Hilfsmethoden // ----------------------------------------------------------------------------- - bool _ParseXMLDocument(const Common::String &FileName, TiXmlDocument &Doc) const; - bool _ParseFontTag(TiXmlElement &Tag, Common::String &BitmapFileName, int &LineHeight, int &GapWidth) const; - bool _ParseCharacterTag(TiXmlElement &Tag, int &Code, Common::Rect &Rect) const; +// bool _ParseXMLDocument(const Common::String &FileName, TiXmlDocument &Doc) const; +// bool _ParseFontTag(TiXmlElement &Tag, Common::String &BitmapFileName, int &LineHeight, int &GapWidth) const; +// bool _ParseCharacterTag(TiXmlElement &Tag, int &Code, Common::Rect &Rect) const; }; } // End of namespace Sword25 |