Author: jhinrichs
Date: Sat Mar 1 00:45:56 2008
New Revision: 24166
URL: http://svn.gna.org/viewcvs/wesnoth?rev=24166&view=rev
Log:
This adds some debug output i found useful when tackling bugs.
Modified:
trunk/src/display.cpp
trunk/src/replay.cpp
Modified: trunk/src/display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=24166&r1=24165&r2=24166&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Sat Mar 1 00:45:56 2008
@@ -432,9 +432,11 @@
{
std::vector<gui::button> work;
+ DBG_DP << "creating buttons...\n";
const std::vector<theme::menu>& buttons = theme_.menus();
for(std::vector<theme::menu>::const_iterator i = buttons.begin(); i !=
buttons.end(); ++i) {
gui::button
b(screen_,i->title(),string_to_button_type(i->type()),i->image());
+ DBG_DP << "drawing button " << i->get_id() << "\n";
b.set_id(i->get_id());
const SDL_Rect& loc = i->location(screen_area());
b.set_location(loc.x,loc.y);
@@ -452,6 +454,7 @@
}
buttons_.swap(work);
+ DBG_DP << "buttons created\n";
}
gui::button::TYPE display::string_to_button_type(std::string type)
@@ -767,10 +770,16 @@
static void draw_panel(CVideo& video, const theme::panel& panel,
std::vector<gui::button>& buttons)
{
//log_scope("draw panel");
+ DBG_DP << "drawing panel " << panel.get_id() << "\n";
+
surface surf(image::get_image(panel.image()));
const SDL_Rect screen = screen_area();
SDL_Rect& loc = panel.location(screen);
+
+ DBG_DP << "panel location: x=" << loc.x << ", y=" << loc.y
+ << ", w=" << loc.w << ", h=" << loc.h << "\n";
+
if(!surf.null()) {
if(surf->w != loc.w || surf->h != loc.h) {
surf.assign(scale_surface(surf,loc.w,loc.h));
Modified: trunk/src/replay.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/replay.cpp?rev=24166&r1=24165&r2=24166&view=diff
==============================================================================
--- trunk/src/replay.cpp (original)
+++ trunk/src/replay.cpp Sat Mar 1 00:45:56 2008
@@ -1173,8 +1173,11 @@
replay::throw_error("illegal defender weapon
type in attack\n");
}
+ DBG_REPLAY << "Attacker XP (before attack): " <<
u->second.experience() << "\n";;
DELAY_END_LEVEL(delayed_exception, attack(disp, map,
teams, src, dst, weapon_num, def_weapon_num, units, state, gameinfo,
!get_replay_source().is_skipping()));
+
+ DBG_REPLAY << "Attacker XP (after attack): " <<
u->second.experience() << "\n";;
u = units.find(src);
tgt = units.find(dst);
@@ -1183,6 +1186,7 @@
advancing_units.push_back(u->first);
}
+ DBG_REPLAY << "advancing_units.size: " <<
advancing_units.size() << "\n";
if(tgt != units.end() && tgt->second.advances()) {
advancing_units.push_back(tgt->first);
}
@@ -1215,7 +1219,7 @@
} else {
if(! cfg->child("checksum")) {
- replay::throw_error("unrecognized action\n");
+ replay::throw_error("unrecognized action:\n" +
cfg->debug());
} else {
check_checksums(disp,units,*cfg);
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits