[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src theme.cpp titlescreen.cpp
From: |
Isaac Clerencia |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src theme.cpp titlescreen.cpp |
Date: |
Tue, 05 Oct 2004 19:18:18 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Isaac Clerencia <address@hidden> 04/10/05 23:11:35
Modified files:
src : theme.cpp titlescreen.cpp
Log message:
Switch to the new logging system
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/theme.cpp.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/titlescreen.cpp.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
Patches:
Index: wesnoth/src/theme.cpp
diff -u wesnoth/src/theme.cpp:1.17 wesnoth/src/theme.cpp:1.18
--- wesnoth/src/theme.cpp:1.17 Mon Sep 27 00:24:41 2004
+++ wesnoth/src/theme.cpp Tue Oct 5 23:11:35 2004
@@ -1,11 +1,14 @@
#include "font.hpp"
#include "language.hpp"
+#include "log.hpp"
#include "sdl_utils.hpp"
#include "theme.hpp"
#include "util.hpp"
#include <cstdlib>
+#define LOG_DP lg::info(lg::display)
+
namespace {
const SDL_Rect empty_rect = {0,0,0,0};
const int XDim = 1024;
@@ -221,9 +224,9 @@
for(i = resolutions.begin(); i != resolutions.end(); ++i) {
const int width = atoi((**i)["width"].c_str());
const int height = atoi((**i)["height"].c_str());
- std::cerr << "comparing resolution " << screen.w << "," <<
screen.h << " to " << width << "," << height << "\n";
+ LOG_DP << "comparing resolution " << screen.w << "," <<
screen.h << " to " << width << "," << height << "\n";
if(screen.w >= width && screen.h >= height) {
- std::cerr << "loading theme: " << width << "," <<
height << "\n";
+ LOG_DP << "loading theme: " << width << "," << height
<< "\n";
current = i;
result = true;
break;
@@ -238,7 +241,7 @@
if(current == resolutions.end()) {
if(!resolutions.empty())
- std::cerr << "ERROR: No valid resolution found\n";
+ LOG_DP << "ERROR: No valid resolution found\n";
return false;
}
@@ -285,13 +288,13 @@
const config::child_list& menu_list = cfg.get_children("menu");
for(config::child_list::const_iterator m = menu_list.begin(); m !=
menu_list.end(); ++m) {
const menu new_menu(**m);
- //std::cerr << "adding menu: " << (new_menu.is_context() ? "is
context" : "not context") << "\n";
+ LOG_DP << "adding menu: " << (new_menu.is_context() ? "is
context" : "not context") << "\n";
if(new_menu.is_context())
context_ = new_menu;
else
menus_.push_back(new_menu);
- //std::cerr << "done adding menu...\n";
+ LOG_DP << "done adding menu...\n";
}
return result;
Index: wesnoth/src/titlescreen.cpp
diff -u wesnoth/src/titlescreen.cpp:1.20 wesnoth/src/titlescreen.cpp:1.21
--- wesnoth/src/titlescreen.cpp:1.20 Fri Sep 24 23:25:09 2004
+++ wesnoth/src/titlescreen.cpp Tue Oct 5 23:11:35 2004
@@ -6,6 +6,7 @@
#include "hotkeys.hpp"
#include "key.hpp"
#include "language.hpp"
+#include "log.hpp"
#include "preferences.hpp"
#include "sdl_utils.hpp"
#include "show_dialog.hpp"
@@ -15,13 +16,15 @@
#include "SDL_ttf.h"
+#define LOG_DP lg::info(lg::display)
+
namespace {
void fade_logo(display& screen, int xpos, int ypos)
{
const surface
logo(image::get_image(game_config::game_logo,image::UNSCALED));
if(logo == NULL) {
- std::cerr << "Could not find game logo\n";
+ LOG_DP << "Could not find game logo\n";
return;
}
@@ -37,9 +40,9 @@
CKey key;
bool last_button = key[SDLK_ESCAPE] || key[SDLK_SPACE];
- //std::cerr << "fading logo in....\n";
+ LOG_DP << "fading logo in....\n";
- //std::cerr << "logo size: " << logo->w << "," << logo->h << "\n";
+ LOG_DP << "logo size: " << logo->w << "," << logo->h << "\n";
const video_change_detector disp_change_detector(screen.video());
@@ -74,7 +77,7 @@
}
- //std::cerr << "logo faded in\n";
+ LOG_DP << "logo faded in\n";
faded_in = true;
}
@@ -130,17 +133,17 @@
const surface
title_surface(scale_surface(title_surface_unscaled,screen.x(),screen.y()));
if(title_surface == NULL) {
- std::cerr << "Could not find title image\n";
+ LOG_DP << "Could not find title image\n";
} else {
screen.blit_surface(0,0,title_surface);
update_rect(screen.screen_area());
- //std::cerr << "displayed title image\n";
+ LOG_DP << "displayed title image\n";
}
fade_logo(screen,(game_config::title_logo_x*screen.x())/1024,(game_config::title_logo_y*screen.y())/768);
- //std::cerr << "faded logo\n";
+ LOG_DP << "faded logo\n";
const std::string& version_str = _("Version") + std::string(" ") +
game_config::version;
@@ -156,7 +159,7 @@
font::NORMAL_COLOUR,version_str,0,versiony);
}
- //std::cerr << "drew version number\n";
+ LOG_DP << "drew version number\n";
//members of this array must correspond to the enumeration TITLE_RESULT
static const char* button_labels[] = { N_("TitleScreen
button^Tutorial"),
@@ -190,7 +193,7 @@
buttons.push_back(button(screen,sgettext(button_labels[b])));
buttons.back().set_location(menu_xbase + b*menu_xincr,
menu_ybase + b*menu_yincr);
buttons.back().set_help_string(sgettext(help_button_labels[b]));
- //std::cerr << "set help string for '" << button_labels[b] <<
"' -> '" << sgettext(help_button_labels[b]) << "'\n";
+ LOG_DP << "set help string for '" << button_labels[b] << "' ->
'" << sgettext(help_button_labels[b]) << "'\n";
max_width = maximum<size_t>(max_width,buttons.back().width());
}
@@ -229,7 +232,7 @@
events::raise_draw_event();
- //std::cerr << "drew buttons dialog\n";
+ LOG_DP << "drew buttons dialog\n";
CKey key;
@@ -237,7 +240,7 @@
update_whole_screen();
- std::cerr << "entering interactive loop...\n";
+ LOG_DP << "entering interactive loop...\n";
for(;;) {
for(size_t b = 0; b != buttons.size(); ++b) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src theme.cpp titlescreen.cpp,
Isaac Clerencia <=