BL_RESET usage for window port status line updating

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.
This commit is contained in:
nhmall
2018-09-22 22:41:02 -04:00
parent 18d56724f9
commit 21a81d0294
6 changed files with 27 additions and 4 deletions

View 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.

View 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

View 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)

View 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,

View 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,

View 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,