]> granicus.if.org Git - nethack/commitdiff
map updating change to fix tty
authorPatR <rankin@nethack.org>
Fri, 17 Apr 2020 23:45:41 +0000 (16:45 -0700)
committerPatR <rankin@nethack.org>
Fri, 17 Apr 2020 23:45:41 +0000 (16:45 -0700)
doc/fixes37.0
src/display.c

index a88a792092c742fa8402b7768e6a6622418e8d57..f856561e44d8bb63175f78d9c8565bd4db392238 100644 (file)
@@ -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 <space> 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 <space>
 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
index d7763e4fc82880e4fb04907695db962f1d616ede..c6b8c0f9b2fbd9b1549b569ae14155fea737bcb5 100644 (file)
@@ -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;
 }