mail[Wesnoth-commits] r33909 - /trunk/src/playsingle_controller.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:09:
Author: silene
Date: Fri Mar 20 08:09:01 2009
New Revision: 33909

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

Modified:
    trunk/src/playsingle_controller.cpp

Modified: trunk/src/playsingle_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playsingle_controller.cpp?rev=33909&r1=33908&r2=33909&view=diff
==============================================================================
--- trunk/src/playsingle_controller.cpp (original)
+++ trunk/src/playsingle_controller.cpp Fri Mar 20 08:09:01 2009
@@ -239,10 +239,8 @@
        LOG_NG << "in playsingle_controller::play_scenario()...\n";
 
        // Start music.
-       const config::child_list& m = level_.get_children("music");
-       config::child_list::const_iterator i;
-       for (i = m.begin(); i != m.end(); i++) {
-               sound::play_music_config(**i);
+       foreach (const config &m, level_.child_range("music")) {
+               sound::play_music_config(m);
        }
        sound::commit_music_changes();
 
@@ -254,17 +252,18 @@
        gui_->labels().read(level_, game_events::get_state_of_game());
 
        // Find a list of 'items' (i.e. overlays) on the level, and add them
-       const config::child_list& overlays = level_.get_children("item");
-       for(config::child_list::const_iterator overlay = overlays.begin(); 
overlay != overlays.end(); ++overlay) {
-               gui_->add_overlay(map_location(**overlay, 
game_events::get_state_of_game()), (**overlay)["image"], (**overlay)["halo"], 
(**overlay)["team_name"], utils::string_bool((**overlay)["visible_in_fog"], 
true));
+       foreach (const config &overlay, level_.child_range("item"))
+       {
+               gui_->add_overlay(
+                       map_location(overlay, 
game_events::get_state_of_game()),
+                       overlay["image"], overlay["halo"], 
overlay["team_name"],
+                       utils::string_bool(overlay["visible_in_fog"], true));
        }
 
        // Read sound sources
        assert(soundsources_manager_ != NULL);
-       const config::child_list& snd_sources = 
level_.get_children("sound_source");
-       for(config::child_list::const_iterator i = snd_sources.begin(); i != 
snd_sources.end(); ++i) {
-               assert(*i != NULL);
-               soundsource::sourcespec spec(**i);
+       foreach (const config &s, level_.child_range("sound_source")) {
+               soundsource::sourcespec spec(s);
                soundsources_manager_->add(spec);
        }
 




Related Messages


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