diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-30 13:59:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-20 21:58:39 +0300 |
commit | bc3a7cf853510ffe1e42dc683f854d360f6528c7 (patch) | |
tree | 9898f13eafc3e1a20388d8d592bfcc05c8f50ba7 /src/resources/beingcommon.cpp | |
parent | a058af57bddd4a4394401cc75d33461e17aab8c1 (diff) | |
download | manaverse-bc3a7cf853510ffe1e42dc683f854d360f6528c7.tar.gz manaverse-bc3a7cf853510ffe1e42dc683f854d360f6528c7.tar.bz2 manaverse-bc3a7cf853510ffe1e42dc683f854d360f6528c7.tar.xz manaverse-bc3a7cf853510ffe1e42dc683f854d360f6528c7.zip |
Add pugixml backend incomplete.
Add some defines for xml nodes manipulation.
With pugixml backend no xml writing.
Diffstat (limited to 'src/resources/beingcommon.cpp')
-rw-r--r-- | src/resources/beingcommon.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/resources/beingcommon.cpp b/src/resources/beingcommon.cpp index 92411a895..999b19980 100644 --- a/src/resources/beingcommon.cpp +++ b/src/resources/beingcommon.cpp @@ -105,12 +105,11 @@ bool BeingCommon::readObjectNodes(XmlNodePtrConst &spriteNode, { if (xmlNameEqual(spriteNode, "sprite")) { - if (!spriteNode->xmlChildrenNode) + if (!XmlHaveChildContent(spriteNode)) return true; SpriteReference *const currentSprite = new SpriteReference; - currentSprite->sprite = reinterpret_cast<const char*>( - spriteNode->xmlChildrenNode->content); + currentSprite->sprite = XmlChildContent(spriteNode); currentSprite->variant = XML::getProperty( spriteNode, "variant", 0); @@ -119,15 +118,14 @@ bool BeingCommon::readObjectNodes(XmlNodePtrConst &spriteNode, } else if (xmlNameEqual(spriteNode, "sound")) { - if (!spriteNode->xmlChildrenNode) + if (!XmlHaveChildContent(spriteNode)) return true; const std::string event = XML::getProperty( spriteNode, "event", ""); const int delay = XML::getProperty( spriteNode, "delay", 0); - const char *const filename = reinterpret_cast<const char*>( - spriteNode->xmlChildrenNode->content); + const char *const filename = XmlChildContent(spriteNode); if (event == "hit") { @@ -209,11 +207,10 @@ bool BeingCommon::readObjectNodes(XmlNodePtrConst &spriteNode, } else if (xmlNameEqual(spriteNode, "particlefx")) { - if (!spriteNode->xmlChildrenNode) + if (!XmlHaveChildContent(spriteNode)) return true; - display.particles.push_back(reinterpret_cast<const char*>( - spriteNode->xmlChildrenNode->content)); + display.particles.push_back(XmlChildContent(spriteNode)); return true; } return false; |