status_update distinguish new BL_RESET from BL_FLUSH

This adds BL_RESET to status_update to send a flag to a window
port that every field should be updated because something has
happened in the core to make current values shown to be
untrustworthy or potentially obliterated.

That is now distinguished from BL_FLUSH, which now has no
bearing on whether every field needs to be redone, and instead
can be used by a window port indicator that it is time to render
any buffered status field changes to the display.

tty port now sets WC2_FLUSH_STATUS indicator for BL_FLUSH support
and now does one rendering per bot() call, instead of up to 22.

Side note: The tty hitpoint bar code was relying on the old
behavior of redrawing everything upon BL_FLUSH apparently, so it
initially had some color change lag issues, corrected by marking
BL_STATUS as dirty (in need of updating) in tty_status_update()
whenever BL_HP was marked as dirty.
This commit is contained in:
nhmall
2018-09-03 08:18:18 -04:00
parent 0b32735ff8
commit a417d67572
6 changed files with 97 additions and 53 deletions

View File

@@ -107,9 +107,10 @@ wizard mode #wizidentify didn't disclose extra information for unID'd items if
make transformation message of a deliberate apply of a figurine seem a bit
less definite when blind and place unseen monster marker at the spot
you think it should be
ensure BL_FLUSH always gets sent down to the window port whenever bot() is
called with context.botlx set so that status updates work as
expected after full screen clear after a level change
add window port status_update() value BL_RESET to use as a flag to
redraw all status fields, distinguished from BL_FLUSH which now only
specifies that the bot() call has completed so any buffered changes
should now be rendered
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
@@ -125,7 +126,8 @@ tty: turn off an optimization that is the suspected cause of Windows reported
Platform- and/or Interface-Specific Fixes
-----------------------------------------
windows-gui: In nethackw, there could be conflicts between menu accelerators
and an extra choice accelerator to fix H7132.
and an extra choice accelerator to fix H7132.
windows-gui: recognize new BL_RESET in status_update; behavior currently the same
windows-tty: Specify both width and height when creating font for width testing
windows-tty: To counter lag problems that were occuring with the Win32 console
port, implement a console back buffer to reduce the number of calls
@@ -142,6 +144,8 @@ windows-tty: Use nhraykey by default if the players keyboard layout is
windows-tty: We now support changing altkeyhandler in game
windows: Added ntassert() mechanism for Windows based port use
tty: significant optimizations for performance and per field rendering
tty: use WC2_FLUSH_STATUS to buffer changes until BL_FLUSH is received
tty: support BL_RESET in status_update to force an update to all status fields
unix: Makefile.src and Makefile.utl inadvertently relied on a 'gnu make'
extension when using $(VERBOSEMAKE) to reduce build-time feedback;
replace with $(QUIETCC) which operates the same but defaults to

View File

@@ -412,6 +412,10 @@ status_update(int fldindex, genericptr_t ptr, int chg, int percentage, int color
BL_LEVELDESC, BL_EXP, BL_CONDITION
-- fldindex could also be BL_FLUSH (-1), which is not really
a field index, but is a special trigger to tell the
windowport that it should output all changes received
to this point. It marks the end of a bot() cycle.
-- fldindex could also be BL_RESET (-2), which is not really
a field index, but is a special advisory to to tell the
windowport that it should redisplay all its status fields,
even if no changes have been presented to it.
-- ptr is usually a "char *", unless fldindex is BL_CONDITION.