]> granicus.if.org Git - nethack/commitdiff
odd Windows lighting in lit rooms (issue #929)
authornhmall <nhmall@nethack.org>
Mon, 12 Dec 2022 02:29:42 +0000 (21:29 -0500)
committernhmall <nhmall@nethack.org>
Mon, 12 Dec 2022 02:29:42 +0000 (21:29 -0500)
bkglyph variable gets initialized to GLYPH_UNEXPLORED so ends
up being returned by get_bk_glyph() if something more interesting
wasn't chosen in the switch statement.

The Windows win32 interface will then use the tile mapped to
GLYPH_UNEXPLORED as a background. The tile is 16x16 all black
pixels. That looked very odd.

Treat GLYPH_UNEXPLORED as an out-of-range value.

Closes #929

win/win32/mhmap.c

index bee0b8282f455d41dc6f969a9268af325ab924dd..882bad8afd9bb24d839057f0912f9c02414f9a7d 100644 (file)
@@ -861,7 +861,9 @@ paintTile(PNHMapWindow data, int i, int j, RECT * rect)
         DeleteObject(blackBrush);
     }
 
-    if (bkglyph != NO_GLYPH) {
+    if (bkglyph != NO_GLYPH
+        /* Don't use all black GLYPH_UNEXPLORED tile as a background */
+        && bkglyph != GLYPH_UNEXPLORED) {
         ntile = data->bkmap[i][j].gm.tileidx;
         t_x = TILEBMP_X(ntile);
         t_y = TILEBMP_Y(ntile);