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
This commit is contained in:
nhmall
2022-12-11 21:29:42 -05:00
parent 608490ad98
commit 5ac96e9318

View 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);