]> granicus.if.org Git - nethack/commitdiff
BL_RESET usage for window port status line updating
authornhmall <nhmall@nethack.org>
Sun, 23 Sep 2018 02:41:02 +0000 (22:41 -0400)
committernhmall <nhmall@nethack.org>
Sun, 23 Sep 2018 02:41:02 +0000 (22:41 -0400)
Like BL_FLUSH, only send BL_RESET if the window port has
indicated it wants them via setting the appropriate WC2
bits in its window_procs structure. Update documentation.

doc/window.doc
include/winprocs.h
src/botl.c
win/X11/winX.c
win/tty/wintty.c
win/win32/mswproc.c

index a7141d4485c308655b0eecfb67375c75d825fd0e..04a74d7affdbe5bb951341e407c8b785428aeaf2 100644 (file)
@@ -774,8 +774,23 @@ to support:
   |  wraptext          | WC2_WRAPTEXT       | wc2_wraptext       |boolean |
   |  selectsaved       | WC2_SELECTSAVED    | wc2_selectsaved    |boolean |
   |  hitpointbar       | WC2_HITPOINTBAR    | wc2_hitpointbar    |boolean |
+  |  hitpointbar       | WC2_HITPOINTBAR    | wc2_hitpointbar    |boolean |
   +--------------------+--------------------+--------------------+--------+
 
+  more wincap2 for STATUS_HILITES support and control
+  +--------------------------------- +---------------------------+
+  | To inform the game engine        |                           |
+  | that the window port is equipped | bit to set in wincap mask |
+  | to receive the following in its  |                           |
+  | x_status_update() routine        |                           |
+  |----------------------------------+---------------------------+
+  | BL_FLUSH to render buffered      | WC2_FLUSH_STATUS          |
+  |          field changes now       |                           |
+  |----------------------------------+---------------------------+
+  | BL_RESET to indicate that all    | WC2_RESET_STATUS          |
+  |          fields should be redone |                           |
+  +----------------------------------+---------------------------+
+
 align_message  -- where to place message window (top, bottom, left, right)
 align_status   -- where to place status display (top, bottom, left, right).
 ascii_map      -- port should display an ascii map if it can.
index 3c19d4f03102e87c04b3f2cb3d82ae8e8cbb38d1..a0c490f11887f1d8d2351ba373f5efcf356a0a91 100644 (file)
@@ -214,7 +214,9 @@ extern
 #define WC2_HITPOINTBAR   0x0040L /* 07 show bar representing hit points */
 #define WC2_FLUSH_STATUS  0x0080L /* 08 call status_update(BL_FLUSH)
                                         after updating status window fields */
-                                  /* 24 free bits */
+#define WC2_RESET_STATUS  0x0100L /* 09 call status_update(BL_RESET) to indicate
+                                        draw everything */
+                                  /* 23 free bits */
 
 #define ALIGN_LEFT   1
 #define ALIGN_RIGHT  2
index 8ffe73c5ed6db752e637193dad556a01ac92daf6..721ad23166f83349559c894a290b282177eadf5e 100644 (file)
@@ -810,7 +810,8 @@ boolean *valsetlist;
      * the display, call status_update() with BL_FLUSH.
      *
      */
-    if (context.botlx)
+    if (context.botlx &&
+        (windowprocs.wincap2 & WC2_RESET_STATUS) != 0L)
         status_update(BL_RESET, (genericptr_t) 0, 0, 0,
                       NO_COLOR, &cond_hilites[0]);
     else if ((windowprocs.wincap2 & WC2_FLUSH_STATUS) != 0L)
index 5c1de3c1277076981049bdd77420076a0faf586b..891a76fa31da239edad13391b0a0429905355f5c 100644 (file)
@@ -100,7 +100,11 @@ struct window_procs X11_procs = {
     "X11",
     (WC_COLOR | WC_HILITE_PET | WC_ASCII_MAP | WC_TILED_MAP
      | WC_PLAYER_SELECTION | WC_PERM_INVENT | WC_MOUSE_SUPPORT),
-    0L, /* WC2 flag mask */
+    (0
+#if defined(STATUS_HILITES)
+    | WC2_FLUSH_STATUS | WC2_RESET_STATUS
+#endif
+    ),
     X11_init_nhwindows,
     X11_player_selection, X11_askname, X11_get_nh_event, X11_exit_nhwindows,
     X11_suspend_nhwindows, X11_resume_nhwindows, X11_create_nhwindow,
index 5c98c02992399f63ae736d72f5f929b6dac9d56a..7657b1186936bd9d8644238a41f4f4cc8318b27c 100644 (file)
@@ -67,6 +67,7 @@ struct window_procs tty_procs = {
 #endif
 #if defined(STATUS_HILITES)
      | WC2_HILITE_STATUS | WC2_HITPOINTBAR | WC2_FLUSH_STATUS
+     | WC2_RESET_STATUS
 #endif
      | WC2_DARKGRAY),
     tty_init_nhwindows, tty_player_selection, tty_askname, tty_get_nh_event,
index 77432f751f469bf2854049df11138708479ea1af..fea75b1772b4eb69f0dee639ccb9967fb3823c44 100644 (file)
@@ -88,7 +88,7 @@ struct window_procs mswin_procs = {
         | WC_VARY_MSGCOUNT | WC_WINDOWCOLORS | WC_PLAYER_SELECTION
         | WC_SPLASH_SCREEN | WC_POPUP_DIALOG | WC_MOUSE_SUPPORT,
 #ifdef STATUS_HILITES
-    WC2_HITPOINTBAR | WC2_FLUSH_STATUS | WC2_HILITE_STATUS |
+    WC2_HITPOINTBAR | WC2_FLUSH_STATUS | WC2_RESET_STATUS | WC2_HILITE_STATUS |
 #endif
     0L, mswin_init_nhwindows, mswin_player_selection, mswin_askname,
     mswin_get_nh_event, mswin_exit_nhwindows, mswin_suspend_nhwindows,