Problem: Color values greater than 255 cause problems on MS-Windows.
Solution: Truncate to 255 colors. (Yasuhiro Matsumoto)
static void
textattr(WORD wAttr)
{
- g_attrCurrent = wAttr;
+ g_attrCurrent = wAttr & 0xff;
SetConsoleTextAttribute(g_hConOut, wAttr);
}
static void
textcolor(WORD wAttr)
{
- g_attrCurrent = (g_attrCurrent & 0xf0) + wAttr;
+ g_attrCurrent = (g_attrCurrent & 0xf0) + (wAttr & 0x0f);
SetConsoleTextAttribute(g_hConOut, g_attrCurrent);
}
static void
textbackground(WORD wAttr)
{
- g_attrCurrent = (g_attrCurrent & 0x0f) + (wAttr << 4);
+ g_attrCurrent = (g_attrCurrent & 0x0f) + ((wAttr & 0x0f) << 4);
SetConsoleTextAttribute(g_hConOut, g_attrCurrent);
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 679,
/**/
678,
/**/