From bc3a7cf853510ffe1e42dc683f854d360f6528c7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 30 Nov 2015 13:59:45 +0300 Subject: Add pugixml backend incomplete. Add some defines for xml nodes manipulation. With pugixml backend no xml writing. --- src/particle/particle.cpp | 14 ++++---------- src/particle/particleemitter.cpp | 5 ++--- 2 files changed, 6 insertions(+), 13 deletions(-) (limited to 'src/particle') diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp index 2555cfb23..f22f11252 100644 --- a/src/particle/particle.cpp +++ b/src/particle/particle.cpp @@ -338,11 +338,8 @@ Particle *Particle::addEffect(const std::string &restrict particleEffectFile, else if ((node = XML::findFirstChildByName(effectChildNode, "image"))) { std::string imageSrc; - if (node && node->xmlChildrenNode) - { - imageSrc = reinterpret_cast( - node->xmlChildrenNode->content); - } + if (node && XmlHaveChildContent(node)) + imageSrc = XmlChildContent(node); if (!imageSrc.empty() && !dyePalettes.empty()) Dye::instantiate(imageSrc, dyePalettes); Image *const img = resourceManager->getImage(imageSrc); @@ -393,11 +390,8 @@ Particle *Particle::addEffect(const std::string &restrict particleEffectFile, else if (xmlNameEqual(emitterNode, "deatheffect")) { std::string deathEffect; - if (node && node->xmlChildrenNode) - { - deathEffect = reinterpret_cast( - emitterNode->xmlChildrenNode->content); - } + if (node && XmlHaveChildContent(node)) + deathEffect = XmlChildContent(emitterNode); char deathEffectConditions = 0x00; if (XML::getBoolProperty(emitterNode, "on-floor", true)) diff --git a/src/particle/particleemitter.cpp b/src/particle/particleemitter.cpp index 7ee3a4252..a512cff94 100644 --- a/src/particle/particleemitter.cpp +++ b/src/particle/particleemitter.cpp @@ -317,10 +317,9 @@ ParticleEmitter::ParticleEmitter(const XmlNodePtrConst emitterNode, } else if (xmlNameEqual(propertyNode, "deatheffect")) { - if (!propertyNode->xmlChildrenNode) + if (!XmlHaveChildContent(propertyNode)) continue; - mDeathEffect = reinterpret_cast( - propertyNode->xmlChildrenNode->content); + mDeathEffect = XmlChildContent(propertyNode); mDeathEffectConditions = 0x00; if (XML::getBoolProperty(propertyNode, "on-floor", true)) { -- cgit v1.2.3-60-g2f50