From cf9e0d943488609acf54e6f0ed42890d8eed5231 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 17 Apr 2020 16:45:41 -0700 Subject: [PATCH] map updating change to fix tty --- doc/fixes37.0 | 2 ++ src/display.c | 22 +++++++--------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index a88a79209..f856561e4 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -186,6 +186,8 @@ teleport feedback "you materialize at another location" was given too soon moving around underwater tty: redraw unexplored locations as S_unexplored rather than after map has been partially overwritten by popup menu or text display +tty: previous change resulted in remnants of previous level being shown on + new level after level change when S_unexplored is X11: was still initializing map to 'stone' instead of 'unexplored' after they became separate glyphs X11: for text map without color, add support for black&white ice; draw it in diff --git a/src/display.c b/src/display.c index d7763e4fc..c6b8c0f9b 100644 --- a/src/display.c +++ b/src/display.c @@ -1606,9 +1606,9 @@ int x, y, glyph; } \ } -static const gbuf_entry nul_gbuf = { 0, GLYPH_UNEXPLORED }; +static const gbuf_entry nul_gbuf = { 1, GLYPH_UNEXPLORED }; /* - * Turn the 3rd screen into UNEXPLORED. + * Turn the 3rd screen into UNEXPLORED that needs to be refreshed. */ void clear_glyph_buffer() @@ -1621,11 +1621,13 @@ clear_glyph_buffer() for (x = COLNO; x; x--) { *gptr++ = nul_gbuf; } + g.gbuf_start[y] = 1; + g.gbuf_stop[y] = COLNO - 1; } - reset_glyph_bbox(); } -/* used by tty after menu or text popup has temporarily overwritten the map */ +/* used by tty after menu or text popup has temporarily overwritten the map + and it has been erased so shows spaces, not necessarily S_unexplored */ void row_refresh(start, stop, y) int start, stop, y; @@ -1649,7 +1651,6 @@ void cls() { static boolean in_cls = 0; - int y, x, force_unexplored; if (in_cls) return; @@ -1658,16 +1659,7 @@ cls() g.context.botlx = 1; /* force update of botl window */ clear_nhwindow(WIN_MAP); /* clear physical screen */ - clear_glyph_buffer(); /* this is sort of an extra effort, but OK */ - force_unexplored = (g.showsyms[SYM_UNEXPLORED + SYM_OFF_X] != ' '); - for (y = 0; y < ROWNO; y++) { - g.gbuf_start[y] = 1; - g.gbuf_stop[y] = COLNO - 1; - if (force_unexplored) { - for (x = 1; x < COLNO; x++) - g.gbuf[y][x].gnew = 1; - } - } + clear_glyph_buffer(); /* force gbuf[][].glyph to unexplored */ in_cls = FALSE; }