wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src playturn.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src playturn.cpp
Date: Sun, 26 Sep 2004 06:00:48 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    04/09/26 09:48:51

Modified files:
        src            : playturn.cpp 

Log message:
        Switched to new logging system

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/playturn.cpp.diff?tr1=1.269&tr2=1.270&r1=text&r2=text

Patches:
Index: wesnoth/src/playturn.cpp
diff -u wesnoth/src/playturn.cpp:1.269 wesnoth/src/playturn.cpp:1.270
--- wesnoth/src/playturn.cpp:1.269      Sun Sep 19 14:00:51 2004
+++ wesnoth/src/playturn.cpp    Sun Sep 26 09:48:50 2004
@@ -1,4 +1,4 @@
-/* $Id: playturn.cpp,v 1.269 2004/09/19 14:00:51 ettin Exp $ */
+/* $Id: playturn.cpp,v 1.270 2004/09/26 09:48:50 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -417,12 +417,10 @@
                        cursor::set(cursor::NORMAL);
                } else {
                        const theme::menu* const m = 
gui_.get_theme().context_menu();
-                       if(m != NULL) {
-                               std::cerr << "found context menu\n";
+                       if (m != NULL)
                                show_menu(m->items(),event.x,event.y,true);
-                       } else {
-                               std::cerr << "no context menu found...\n";
-                       }
+                       else
+                               lg::warn(lg::display) << "no context menu 
found...\n";
                }
        } else if(is_middle_click(event) && event.state == SDL_PRESSED) {
                // clicked on a hex on the minimap? then initiate minimap 
scrolling
@@ -847,7 +845,7 @@
 }
 
 void turn_info::start_interactive_turn() {
-       std::cerr << "done gotos\n";
+       lg::info(lg::engine) << "done gotos\n";
        start_ncmd_ = recorder.ncommands();
 }
 
@@ -1203,7 +1201,8 @@
                player_info* const player = 
state_of_game_.get_player(teams_[team_num_-1].save_id());
 
                if(player == NULL) {
-                       std::cerr << "WARNING: trying to undo a recall for side 
" << team_num_ << ", which has no recall list!" << std::endl;
+                       lg::err(lg::engine) << "trying to undo a recall for 
side " << team_num_
+                               << ", which has no recall list!\n";
                } else {
                        // Undo a recall action
                        team& current_team = teams_[team_num_-1];
@@ -1285,7 +1284,8 @@
        if(action.is_recall()) {
                player_info 
*player=state_of_game_.get_player(teams_[team_num_-1].save_id());
                if(!player) {
-                       std::cerr << "WARNING: trying to redo a recall for side 
" << team_num_ << ", which has no recall list!" << std::endl;
+                       lg::err(lg::engine) << "trying to redo a recall for 
side " << team_num_
+                               << ", which has no recall list!\n";
                } else {
                        // Redo recall
                        std::vector<unit>& recall_list = 
player->available_units;
@@ -1601,7 +1601,7 @@
                const std::map<std::string,unit_type>::const_iterator
                                u_type = gameinfo_.unit_types.find(*it);
                if(u_type == gameinfo_.unit_types.end()) {
-                       std::cerr << "ERROR: could not find unit '" << *it << 
"'";
+                       lg::err(lg::engine) << "could not find unit '" << *it 
<< "'";
                        return;
                }
 
@@ -1751,7 +1751,8 @@
 
        player_info *player = 
state_of_game_.get_player(teams_[team_num_-1].save_id());
        if(!player) {
-               std::cerr << "WARNING: cannot recall a unit for side " << 
team_num_ << ", which has no recall list!" << std::endl;
+               lg::err(lg::engine) << "cannot recall a unit for side " << 
team_num_
+                       << ", which has no recall list!\n";
                return;
        }
 
@@ -1877,7 +1878,7 @@
                cfg["team_name"] = teams_[gui_.viewing_team()].team_name();
        }
 
-       std::cerr << "logging speech: '" << cfg.write() << "'\n";
+       lg::info(lg::config) << "logging speech: '" << cfg.write() << "'\n";
        recorder.speak(cfg);
        gui_.add_chat_message(cfg["description"],side,message,
                                  private_message ? display::MESSAGE_PRIVATE : 
display::MESSAGE_PUBLIC);
@@ -2445,7 +2446,7 @@
        if(cfg["side_drop"] != "") {
                const size_t side = atoi(cfg["side_drop"].c_str())-1;
                if(side >= teams_.size()) {
-                       std::cerr << "unknown side " << side << " is dropping 
game\n";
+                       lg::err(lg::network) << "unknown side " << side << " is 
dropping game\n";
                        throw network::error("");
                }
 
@@ -2571,7 +2572,7 @@
                do_command(textbox_.box->text());
                break;
        default:
-               std::cerr << "unknown textbox mode\n";
+               lg::err(lg::display) << "unknown textbox mode\n";
        }
 
        close_textbox();
@@ -2580,7 +2581,7 @@
 const unit_map& turn_info::visible_units() const
 {
        if(viewing_team().uses_shroud() == false && viewing_team().uses_fog() 
== false) {
-               std::cerr << "all units are visible...\n";
+               lg::info(lg::engine) << "all units are visible...\n";
                return units_;
        }
 
@@ -2591,7 +2592,7 @@
                }
        }
 
-       std::cerr << "number of visible units: " << visible_units_.size() << 
"\n";
+       lg::info(lg::engine) << "number of visible units: " << 
visible_units_.size() << "\n";
 
        return visible_units_;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]