From 4ac38da4d935127982280367f185eafab1934913 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Sat, 23 Mar 2002 20:17:18 +0000 Subject: [PATCH] (from Yitzhak) -Yitzhak provided this prior to release but it never made it in. --- win/win32/mhmap.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index 2790bb3d1..08189a348 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -555,12 +555,13 @@ void onPaint(HWND hWnd) unsigned special; int mgch; HBRUSH back_brush; + COLORREF OldFg; nhcoord2display(data, i, j, &glyph_rect); #if (VERSION_MAJOR < 4) && (VERSION_MINOR < 4) && (PATCHLEVEL < 2) nhglyph2charcolor(data->map[i][j], &ch, &color); - SetTextColor (hDC, nhcolor_to_RGB(color) ); + OldFg = SetTextColor (hDC, nhcolor_to_RGB(color) ); #else /* rely on NetHack core helper routine */ mapglyph(data->map[i][j], &mgch, &color, @@ -568,13 +569,20 @@ void onPaint(HWND hWnd) ch = (char)mgch; if (((special & MG_PET) && iflags.hilite_pet) || ((special & MG_DETECT) && iflags.use_inverse)) { - back_brush = CreateSolidBrush(RGB(192, 192, 192)); + back_brush = CreateSolidBrush(nhcolor_to_RGB(CLR_GRAY)); FillRect (hDC, &glyph_rect, back_brush); DeleteObject (back_brush); - SetTextColor( hDC, RGB(0, 0, 0) ); - } else - { - SetTextColor (hDC, nhcolor_to_RGB(color) ); + switch (color) + { + case CLR_GRAY: + case CLR_WHITE: + OldFg = SetTextColor( hDC, nhcolor_to_RGB(CLR_BLACK)); + break; + default: + OldFg = SetTextColor (hDC, nhcolor_to_RGB(color) ); + } + } else { + OldFg = SetTextColor (hDC, nhcolor_to_RGB(color) ); } #endif @@ -584,6 +592,7 @@ void onPaint(HWND hWnd) &glyph_rect, DT_CENTER | DT_VCENTER | DT_NOPREFIX ); + SetTextColor (hDC, OldFg); } SelectObject(hDC, oldFont); } else {