From 5ac96e9318d066c38d9c418cf53af3cfaecc17e3 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 11 Dec 2022 21:29:42 -0500 Subject: [PATCH] odd Windows lighting in lit rooms (issue #929) 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index bee0b8282..882bad8af 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -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); -- 2.49.0