mail[Wesnoth-commits] r33875 - /trunk/src/mapgen.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on March 20, 2009 - 08:06:
Author: silene
Date: Fri Mar 20 08:06:50 2009
New Revision: 33875

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33875&view=rev
Log:
Removed config::child_list.

Modified:
    trunk/src/mapgen.cpp

Modified: trunk/src/mapgen.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mapgen.cpp?rev=33875&r1=33874&r2=33875&view=diff
==============================================================================
--- trunk/src/mapgen.cpp (original)
+++ trunk/src/mapgen.cpp Fri Mar 20 08:06:50 2009
@@ -19,6 +19,7 @@
 
 #include "global.hpp"
 
+#include "foreach.hpp"
 #include "gettext.hpp"
 #include "language.hpp"
 #include "log.hpp"
@@ -745,9 +746,8 @@
 
        std::vector<terrain_height_mapper> height_conversion;
 
-       const config::child_list& height_cfg = cfg.get_children("height");
-       for(config::child_list::const_iterator h = height_cfg.begin(); h != 
height_cfg.end(); ++h) {
-               height_conversion.push_back(terrain_height_mapper(**h));
+       foreach (const config &h, cfg.child_range("height")) {
+               height_conversion.push_back(terrain_height_mapper(h));
        }
 
        terrain_map terrain(width, t_translation::t_list(height, grassland));
@@ -880,9 +880,8 @@
        LOG_NG << (SDL_GetTicks() - ticks) << "\n"; ticks = SDL_GetTicks();
 
        std::vector<terrain_converter> converters;
-       const config::child_list& converter_items = 
cfg.get_children("convert");
-       for(config::child_list::const_iterator cv = converter_items.begin(); 
cv != converter_items.end(); ++cv) {
-               converters.push_back(terrain_converter(**cv));
+       foreach (const config &cv, cfg.child_range("convert")) {
+               converters.push_back(terrain_converter(cv));
        }
 
        LOG_NG << "created terrain converters\n";




Related Messages


Powered by MHonArc, Updated Fri Mar 20 08:20:31 2009