Loose ends of the display-reference crusade, and a debug output hook.
authorMartin Read <martin@blackswordsonics.com>
Wed, 19 Feb 2014 13:31:04 +0000 (13:31 +0000)
committerMartin Read <martin@blackswordsonics.com>
Wed, 19 Feb 2014 13:31:04 +0000 (13:31 +0000)
* 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
log.cc
monsters.cc
notify-local-tty.cc
notify.hh

index aeccb8d..99516db 100644 (file)
@@ -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 (file)
--- 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)
     {
index fc9a5b3..f6debe4 100644 (file)
@@ -230,7 +230,6 @@ void death_drop(int mon)
     default:
         break;
     }
-    map_updated = 1;
 }
 
 bool Mon::can_pass(Coord c) const
index 3129cd1..4fe0a3a 100644 (file)
@@ -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
index 9dc0230..77ad492 100644 (file)
--- 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