diff --git a/source/graphics/MapReader.cpp b/source/graphics/MapReader.cpp index fa701ec57e..dbf5429f4e 100644 --- a/source/graphics/MapReader.cpp +++ b/source/graphics/MapReader.cpp @@ -442,8 +442,8 @@ private: XMBElementList nodes; // children of root // loop counters - int node_idx; - int entity_idx; + size_t node_idx; + size_t entity_idx; // # entities+nonentities processed and total (for progress calc) int completed_jobs, total_jobs; @@ -500,8 +500,8 @@ void CXMLReader::Init(const VfsPath& xml_filename) // (used when calculating progress) completed_jobs = 0; total_jobs = 0; - for (int i = 0; i < nodes.Count; i++) - total_jobs += nodes.Item(i).GetChildNodes().Count; + for (XMBElement node : nodes) + total_jobs += node.GetChildNodes().size(); // Find the maximum entity ID, so we can safely allocate new IDs without conflicts @@ -967,12 +967,12 @@ int CXMLReader::ReadEntities(XMBElement parent, double end_time) CSimulation2& sim = *m_MapReader.pSimulation2; CmpPtr cmpPlayerManager(sim, SYSTEM_ENTITY); - while (entity_idx < entities.Count) + while (entity_idx < entities.size()) { // all new state at this scope and below doesn't need to be // wrapped, since we only yield after a complete iteration. - XMBElement entity = entities.Item(entity_idx++); + XMBElement entity = entities[entity_idx++]; ENSURE(entity.GetNodeName() == el_entity); XMBAttributeList attrs = entity.GetAttributes(); @@ -1100,9 +1100,8 @@ int CXMLReader::ReadEntities(XMBElement parent, double end_time) void CXMLReader::ReadXML() { - for (int i = 0; i < nodes.Count; ++i) + for (XMBElement node : nodes) { - XMBElement node = nodes.Item(i); CStr name = xmb_file.GetElementString(node.GetNodeName()); if (name == "Terrain") { @@ -1153,9 +1152,9 @@ int CXMLReader::ProgressiveReadEntities() int ret; - while (node_idx < nodes.Count) + while (node_idx < nodes.size()) { - XMBElement node = nodes.Item(node_idx); + XMBElement node = nodes[node_idx]; CStr name = xmb_file.GetElementString(node.GetNodeName()); if (name == "Entities") { diff --git a/source/graphics/ObjectBase.cpp b/source/graphics/ObjectBase.cpp index 556b0f6086..2ab9217e46 100644 --- a/source/graphics/ObjectBase.cpp +++ b/source/graphics/ObjectBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Wildfire Games. +/* Copyright (C) 2015 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -109,9 +109,7 @@ bool CObjectBase::Load(const VfsPath& pathname) XERO_ITER_EL(root, child) { if (child.GetNodeName() == el_group) - { - variantGroupSizes.push_back(child.GetChildNodes().Count); - } + variantGroupSizes.push_back(child.GetChildNodes().size()); } m_VariantGroups.resize(variantGroupSizes.size()); diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp index 97c5b4448b..be2e2970a4 100644 --- a/source/gui/CGUI.cpp +++ b/source/gui/CGUI.cpp @@ -989,12 +989,8 @@ void CGUI::Xeromyces_ReadRootObjects(XMBElement Element, CXeromyces* pFile, boos // Iterate main children // they should all be or