mail[Wesnoth-commits] r40335 - /trunk/src/play_controller.cpp


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

Header


Content

Posted by guillaume . melquiond on December 22, 2009 - 14:53:
Author: silene
Date: Tue Dec 22 14:53:17 2009
New Revision: 40335

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40335&view=rev
Log:
Removed low-level conversions.

Modified:
    trunk/src/play_controller.cpp

Modified: trunk/src/play_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/play_controller.cpp?rev=40335&r1=40334&r2=40335&view=diff
==============================================================================
--- trunk/src/play_controller.cpp (original)
+++ trunk/src/play_controller.cpp Tue Dec 22 14:53:17 2009
@@ -466,9 +466,7 @@
        }
        gui_->set_playing_team(size_t(team_index));
 
-       std::stringstream player_number_str;
-       player_number_str << player_number_;
-       gamestate_.set_variable("side_number",player_number_str.str());
+       gamestate_.set_variable("side_number", str_cast(player_number_));
        gamestate_.last_selected = map_location::null_location;
 
        /**
@@ -492,12 +490,8 @@
 
        // If this is right after loading a game we don't need to fire events 
and such. It was already done before saving.
        if (!loading_game_) {
-               std::stringstream event_stream;
-               event_stream << turn();
-               const std::string turn_num = event_stream.str();
-               std::stringstream side_num_stream;
-               side_num_stream << (team_index+1);
-               const std::string side_num = side_num_stream.str();
+               std::string turn_num = str_cast(turn());
+               std::string side_num = str_cast(team_index + 1);
 
                if (turn() != previous_turn_)
                {
@@ -627,16 +621,11 @@
        game_events::pump();
 }
 
-void play_controller::finish_turn(){
-       std::stringstream event_stream;
-       event_stream << turn();
-
-       {
-               LOG_NG << "turn event..." << (recorder.is_skipping() ? 
"skipping" : "no skip") << "\n";
-               update_locker 
lock_display(gui_->video(),recorder.is_skipping());
-               const std::string turn_num = event_stream.str();
-               gamestate_.set_variable("turn_number",turn_num);
-       }
+void play_controller::finish_turn()
+{
+       LOG_NG << "turn event..." << (recorder.is_skipping() ? "skipping" : 
"no skip") << '\n';
+       update_locker lock_display(gui_->video(),recorder.is_skipping());
+       gamestate_.set_variable("turn_number", str_cast(turn()));
 }
 
 bool play_controller::enemies_visible() const




Related Messages


Powered by MHonArc, Updated Tue Dec 22 17:40:11 2009