Introduce node iterator.

This commit is contained in:
Kim Kulling
2020-08-30 21:10:04 +02:00
parent 30a4eae17f
commit 6d5c388780
5 changed files with 172 additions and 100 deletions

View File

@@ -196,7 +196,7 @@ void AMFImporter::ParseNode_Volume(XmlNode &node) {
}
bool col_read = false;
for (pugi::xml_node currentNode : node.children()) {
for (XmlNode currentNode = node.first_child(); currentNode; currentNode = currentNode.next_sibling()) {
const std::string currentName = currentNode.name();
if (currentName == "color") {
if (col_read) Throw_MoreThanOnceDefined(currentName ,"color", "Only one color can be defined for <volume>.");
@@ -238,7 +238,7 @@ void AMFImporter::ParseNode_Triangle(XmlNode &node) {
// Check for child nodes
bool col_read = false, tex_read = false;
bool read_flag[3] = { false, false, false };
for (pugi::xml_node currentNode : node.children()) {
for (XmlNode currentNode = node.first_child(); currentNode; currentNode = currentNode.next_sibling()) {
const std::string currentName = currentNode.name();
if (currentName == "color") {
if (col_read) Throw_MoreThanOnceDefined(currentName , "color", "Only one color can be defined for <triangle>.");