reduce flashing w/options simple menu iterations

This commit is contained in:
nhmall
2023-12-03 01:15:04 -05:00
parent 7d22a2c7b9
commit 713eafc8c8
3 changed files with 12 additions and 4 deletions
+1
View File
@@ -1039,6 +1039,7 @@ enum docrt_flags_bits {
docrtRefresh = 1, /* redraw_map(), draw what we think the map shows */ docrtRefresh = 1, /* redraw_map(), draw what we think the map shows */
docrtMapOnly = 2, /* ORed with Recalc or Refresh; draw the map but not docrtMapOnly = 2, /* ORed with Recalc or Refresh; draw the map but not
* status or perminv */ * status or perminv */
docrtNocls = 4,
}; };
typedef struct { typedef struct {
+4 -2
View File
@@ -1614,7 +1614,8 @@ docrt_flags(int refresh_flags)
coordxy x, y; coordxy x, y;
register struct rm *lev; register struct rm *lev;
boolean maponly = (refresh_flags & docrtMapOnly) != 0, boolean maponly = (refresh_flags & docrtMapOnly) != 0,
redrawonly = (refresh_flags & docrtRefresh) != 0; redrawonly = (refresh_flags & docrtRefresh) != 0,
nocls = (refresh_flags & docrtNocls) != 0;
if (!u.ux || gp.program_state.in_docrt) if (!u.ux || gp.program_state.in_docrt)
return; /* display isn't ready yet */ return; /* display isn't ready yet */
@@ -1646,7 +1647,8 @@ docrt_flags(int refresh_flags)
* + fills the physical screen with the symbol for rock * + fills the physical screen with the symbol for rock
* + clears the glyph buffer * + clears the glyph buffer
*/ */
cls(); if (!nocls)
cls();
/* display memory */ /* display memory */
for (x = 1; x < COLNO; x++) { for (x = 1; x < COLNO; x++) {
+7 -2
View File
@@ -8666,7 +8666,8 @@ doset_simple_menu(void)
int int
doset_simple(void) doset_simple(void)
{ {
int pickedone = 0; int pickedone = 0,
opt_crt_flags = docrtNocls;
if (iflags.menu_requested) { if (iflags.menu_requested) {
/* doset() checks for 'm' and calls doset_simple(); clear the /* doset() checks for 'm' and calls doset_simple(); clear the
@@ -8690,14 +8691,18 @@ doset_simple(void)
if (go.opt_need_redraw) { if (go.opt_need_redraw) {
check_gold_symbol(); check_gold_symbol();
reglyph_darkroom(); reglyph_darkroom();
docrt(); docrt_flags(opt_crt_flags);
flush_screen(1); flush_screen(1);
} }
if (go.opt_need_promptstyle) if (go.opt_need_promptstyle)
adjust_menu_promptstyle(WIN_INVEN, &iflags.menu_headings); adjust_menu_promptstyle(WIN_INVEN, &iflags.menu_headings);
/*
* I don't think the status window requires updating between
* simplemenu iterations.
if (gc.context.botl || gc.context.botlx) { if (gc.context.botl || gc.context.botlx) {
bot(); bot();
} }
*/
} while (pickedone > 0); } while (pickedone > 0);
give_opt_msg = TRUE; give_opt_msg = TRUE;
return ECMD_OK; return ECMD_OK;