From 5fa12f4bc43d3b6478435d383f4c5b524d570066 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 19 Apr 2020 16:15:16 -0700 Subject: [PATCH] yet more S_unexplored Revert part of one of the earlier S_unexplored changes (erasing the map window on tty) and deal with the issue differently. --- src/display.c | 10 ++++++++-- win/tty/wintty.c | 12 ++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/display.c b/src/display.c index 47fcebc99..63e48f43a 100644 --- a/src/display.c +++ b/src/display.c @@ -1606,7 +1606,6 @@ int x, y, glyph; } \ } -static const gbuf_entry nul_gbuf = { 1, GLYPH_UNEXPLORED }; /* * Turn the 3rd screen into UNEXPLORED that needs to be refreshed. */ @@ -1614,7 +1613,14 @@ void clear_glyph_buffer() { register int x, y; - register gbuf_entry *gptr; + register gbuf_entry *gptr, nul_gbuf; + int ch = ' ', color = NO_COLOR; + unsigned special = 0; + + (void) mapglyph(GLYPH_UNEXPLORED, &ch, &color, &special, 0, 0, 0); + nul_gbuf.gnew = (ch != ' ' || color != NO_COLOR + || (special & ~MG_UNEXPL) != 0) ? 1 : 0; + nul_gbuf.glyph = GLYPH_UNEXPLORED; for (y = 0; y < ROWNO; y++) { gptr = &g.gbuf[y][0]; diff --git a/win/tty/wintty.c b/win/tty/wintty.c index e750a002d..bb993aa54 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1652,16 +1652,12 @@ winid window; g.context.botlx = 1; break; case NHW_MAP: - /* the full map isn't erased often so the benefit of clearing the - whole screen and then redrawing status would be minimal here */ - docorner(1, ROWNO - 1); /* sets map cells to S_unexplored - * which might not be */ - break; + /* cheap -- clear the whole thing and tell nethack to redraw botl */ + g.context.botlx = 1; + /*FALLTHRU*/ case NHW_BASE: clear_screen(); - if (!g.program_state.gameover) - g.context.botlx = 1; - /* [this sould also reset state for MESSAGE, MAP, and STATUS] */ + /* [this should reset state for MESSAGE, MAP, and STATUS] */ break; case NHW_MENU: case NHW_TEXT: