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

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

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


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src show_dialog.cpp
Date: Tue, 28 Sep 2004 16:15:38 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    04/09/28 20:09:08

Modified files:
        src            : show_dialog.cpp 

Log message:
        Switched to the new logging system

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

Patches:
Index: wesnoth/src/show_dialog.cpp
diff -u wesnoth/src/show_dialog.cpp:1.95 wesnoth/src/show_dialog.cpp:1.96
--- wesnoth/src/show_dialog.cpp:1.95    Mon Sep 27 00:24:41 2004
+++ wesnoth/src/show_dialog.cpp Tue Sep 28 20:09:08 2004
@@ -1,4 +1,4 @@
-/* $Id: show_dialog.cpp,v 1.95 2004/09/27 00:24:41 ydirson Exp $ */
+/* $Id: show_dialog.cpp,v 1.96 2004/09/28 20:09:08 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -19,6 +19,7 @@
 #include "hotkeys.hpp"
 #include "image.hpp"
 #include "language.hpp"
+#include "log.hpp"
 #include "playlevel.hpp"
 #include "show_dialog.hpp"
 #include "language.hpp"
@@ -34,6 +35,9 @@
 #include <iostream>
 #include <numeric>
 
+#define ERR_DP lg::err(lg::display)
+#define LOG_DP lg::info(lg::display)
+
 namespace {
 bool is_in_dialog = false;
 }
@@ -129,7 +133,7 @@
 
        const surface bg(image::get_image(menu_background,image::UNSCALED));
        if(bg == NULL) {
-               std::cerr << "could not find dialog background '" << style << 
"'\n";
+               ERR_DP << "could not find dialog background '" << style << 
"'\n";
                return;
        }
 
@@ -247,7 +251,7 @@
 void draw_rectangle(int x, int y, int w, int h, Uint32 colour,surface target)
 {
        if(x < 0 || y < 0 || x+w >= target->w || y+h >= target->h) {
-               std::cerr << "Rectangle has illegal co-ordinates: " << x << "," 
<< y
+               ERR_DP << "Rectangle has illegal co-ordinates: " << x << "," << 
y
                          << "," << w << "," << h << "\n";
                return;
        }
@@ -268,7 +272,7 @@
                                  double alpha, surface target)
 {
        if(x < 0 || y < 0 || x+w >= target->w || y+h >= target->h) {
-               std::cerr << "Rectangle has illegal co-ordinates: " << x << "," 
<< y
+               ERR_DP << "Rectangle has illegal co-ordinates: " << x << "," << 
y
                          << "," << w << "," << h << "\n";
                return;
        }
@@ -368,7 +372,7 @@
        if(disp.update_locked())
                return -1;
 
-       std::cerr << "showing dialog '" << caption << "' '" << msg << "'\n";
+       LOG_DP << "showing dialog '" << caption << "' '" << msg << "'\n";
 
        //create the event context, but only activate it if we don't have 
preview panes.
        //the presence of preview panes indicates that the caller will create 
the context,
@@ -480,7 +484,7 @@
                        }
 
                } catch(button::error&) {
-                       std::cerr << "error initializing button!\n";
+                       ERR_DP << "error initializing button!\n";
                }
        }
 
@@ -569,9 +573,9 @@
        int xframe = maximum<int>(0,xloc >= 0 ? xloc : scr->w/2 - (frame_width 
+ left_preview_pane_width + right_preview_pane_width)/2);
        int yframe = maximum<int>(0,yloc >= 0 ? yloc : scr->h/2 - (frame_height 
+ above_preview_pane_height)/2);
 
-       //std::cerr << "above_preview_pane_height: " << 
above_preview_pane_height << "\n";
-       //std::cerr << "yframe: " << scr->h/2 << " - " << (frame_height + 
above_preview_pane_height)/2 << " = " << yframe << "\n";
-       //std::cerr << "frame_height: " << frame_height << "\n";
+       LOG_DP << "above_preview_pane_height: " << above_preview_pane_height << 
"; "
+               << "yframe: " << scr->h/2 << " - " << (frame_height + 
above_preview_pane_height)/2 << " = "
+               << yframe << "; " << "frame_height: " << frame_height << "\n";
 
        if(xloc <= -1 || yloc <= -1) {
                xloc = xframe + left_preview_pane_width;
@@ -904,7 +908,7 @@
        if(res_ != 0)
                return CONNECTION_COMPLETE;
        else if(network::current_transfer_stats().first != stats_.first) {
-               std::cerr << "continuing connection...\n";
+               lg::info(lg::network) << "continuing connection...\n";
                return CONNECTION_CONTINUING;
        } else
                return CONTINUE_DIALOG;




reply via email to

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