(from Yitzhak)
-Yitzhak provided this prior to release but it never made it in.
This commit is contained in:
+15
-6
@@ -555,12 +555,13 @@ void onPaint(HWND hWnd)
|
|||||||
unsigned special;
|
unsigned special;
|
||||||
int mgch;
|
int mgch;
|
||||||
HBRUSH back_brush;
|
HBRUSH back_brush;
|
||||||
|
COLORREF OldFg;
|
||||||
|
|
||||||
nhcoord2display(data, i, j, &glyph_rect);
|
nhcoord2display(data, i, j, &glyph_rect);
|
||||||
|
|
||||||
#if (VERSION_MAJOR < 4) && (VERSION_MINOR < 4) && (PATCHLEVEL < 2)
|
#if (VERSION_MAJOR < 4) && (VERSION_MINOR < 4) && (PATCHLEVEL < 2)
|
||||||
nhglyph2charcolor(data->map[i][j], &ch, &color);
|
nhglyph2charcolor(data->map[i][j], &ch, &color);
|
||||||
SetTextColor (hDC, nhcolor_to_RGB(color) );
|
OldFg = SetTextColor (hDC, nhcolor_to_RGB(color) );
|
||||||
#else
|
#else
|
||||||
/* rely on NetHack core helper routine */
|
/* rely on NetHack core helper routine */
|
||||||
mapglyph(data->map[i][j], &mgch, &color,
|
mapglyph(data->map[i][j], &mgch, &color,
|
||||||
@@ -568,13 +569,20 @@ void onPaint(HWND hWnd)
|
|||||||
ch = (char)mgch;
|
ch = (char)mgch;
|
||||||
if (((special & MG_PET) && iflags.hilite_pet) ||
|
if (((special & MG_PET) && iflags.hilite_pet) ||
|
||||||
((special & MG_DETECT) && iflags.use_inverse)) {
|
((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);
|
FillRect (hDC, &glyph_rect, back_brush);
|
||||||
DeleteObject (back_brush);
|
DeleteObject (back_brush);
|
||||||
SetTextColor( hDC, RGB(0, 0, 0) );
|
switch (color)
|
||||||
} else
|
{
|
||||||
{
|
case CLR_GRAY:
|
||||||
SetTextColor (hDC, nhcolor_to_RGB(color) );
|
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
|
#endif
|
||||||
|
|
||||||
@@ -584,6 +592,7 @@ void onPaint(HWND hWnd)
|
|||||||
&glyph_rect,
|
&glyph_rect,
|
||||||
DT_CENTER | DT_VCENTER | DT_NOPREFIX
|
DT_CENTER | DT_VCENTER | DT_NOPREFIX
|
||||||
);
|
);
|
||||||
|
SetTextColor (hDC, OldFg);
|
||||||
}
|
}
|
||||||
SelectObject(hDC, oldFont);
|
SelectObject(hDC, oldFont);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user