From c43afadb467602e95a269201ee9e61d0cf0c8982 Mon Sep 17 00:00:00 2001 From: Martin Read Date: Wed, 19 Feb 2014 13:31:04 +0000 Subject: [PATCH] Loose ends of the display-reference crusade, and a debug output hook. * display.hh: Moved query_wizmode_death prototype to notify.hh * log.cc: Crusade loose ends replaced with a notification call. * monsters.cc: Crusade loose ends purged. * notify-local-tty.cc, notify.h: New notification for load complete; new debug function for printing an arbitrary string. --- display.hh | 1 - log.cc | 4 +--- monsters.cc | 1 - notify-local-tty.cc | 14 ++++++++++++++ notify.hh | 5 +++++ 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/display.hh b/display.hh index aeccb8d..99516db 100644 --- a/display.hh +++ b/display.hh @@ -55,7 +55,6 @@ extern void press_enter(void); extern void pressanykey(void); extern void show_discoveries(void); extern void touch_one_screen(Coord c); -extern bool query_wizmode_death(void); extern void welcome(void); /* "I've changed things that need to be redisplayed" flags. */ diff --git a/log.cc b/log.cc index 2c4a90d..8909a19 100644 --- a/log.cc +++ b/log.cc @@ -241,9 +241,7 @@ int load_game(void) rebuild_mapmons(); fclose(fp); look_around_you(); - status_updated = 1; - map_updated = 1; - hard_redraw = 1; + notify_load_complete(); int i = unlinkat(datadir_fd, "victrix-abyssi.sav", 0); if (i == -1) { diff --git a/monsters.cc b/monsters.cc index fc9a5b3..f6debe4 100644 --- a/monsters.cc +++ b/monsters.cc @@ -230,7 +230,6 @@ void death_drop(int mon) default: break; } - map_updated = 1; } bool Mon::can_pass(Coord c) const diff --git a/notify-local-tty.cc b/notify-local-tty.cc index 3129cd1..4fe0a3a 100644 --- a/notify-local-tty.cc +++ b/notify-local-tty.cc @@ -986,6 +986,15 @@ void notify_change_of_depth(void) print_msg("Welcome to level %d of the Abyss.\n", depth); } +void notify_load_complete(void) +{ + status_updated = 1; + map_updated = 1; + hard_redraw = 1; + display_update(); + print_msg("Game successfully restored.\n"); +} + /* Debugging notifications */ void debug_bad_monspell(int spell) @@ -1158,5 +1167,10 @@ void debug_control_flow(char const *func, int line) print_msg(Msg_prio::Bug, "BUG: control flow passed through unexpected line %d in function %s\n", line, func); } +void debug_arbitrary_string(char const *func, int line, char const *s) +{ + print_msg(Msg_prio::Bug, "DEBUG:%s:%d:%s\n", func, line, s); +} + /* notify-local-tty.cc */ // vim:cindent diff --git a/notify.hh b/notify.hh index 9dc0230..77ad492 100644 --- a/notify.hh +++ b/notify.hh @@ -160,6 +160,7 @@ void notify_hellfire_hit(bool resisted); void notify_fov(void); void notify_tick(void); void notify_change_of_depth(void); +void notify_load_complete(void); // Debugging notifications void debug_move_oob(Coord c); @@ -196,8 +197,12 @@ void debug_unimplemented_radiance_order(int order); void debug_save_unlink_failed(void); void debug_attacking_with_wielded_nonweapon(void); void debug_control_flow(char const *func, int line); +void debug_arbitrary_string(char const *func, int line, char const *s); + +bool query_wizmode_death(void); #define DEBUG_CONTROL_FLOW() debug_control_flow(__FUNCTION__, __LINE__) +#define DEBUG_ARBITRARY(s) debug_arbitrary_string(__FUNCTION__, __LINE__, (s)) // Provisional object designs class Notify_uattkm -- 2.11.0