1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

Improved GetDeviceCaps for 8 bit display DCs

Added proper implementation for COLORRES, NUMCOLORS, NUMRESERVED and
SIZEPALETTE queries.

NUMCOLORS is used by Star Wars Rebellion to determine how many entries
should not have the PC_NOCOLLAPSE flag when setting up some palettes
(issue #22).
This commit is contained in:
narzoul 2020-04-16 23:23:55 +02:00
parent bbb850faf1
commit 1294e5df0d

View File

@ -212,12 +212,34 @@ namespace
}
break;
case COLORRES:
if (8 == g_currentBpp && Gdi::isDisplayDc(hdc))
{
return 24;
}
break;
case NUMCOLORS:
case NUMRESERVED:
if (8 == g_currentBpp && Gdi::isDisplayDc(hdc))
{
return 20;
}
break;
case RASTERCAPS:
if (8 == g_currentBpp && Gdi::isDisplayDc(hdc))
{
return LOG_RESULT(CALL_ORIG_FUNC(GetDeviceCaps)(hdc, nIndex) | RC_PALETTE);
}
break;
case SIZEPALETTE:
if (8 == g_currentBpp && Gdi::isDisplayDc(hdc))
{
return 256;
}
break;
}
return LOG_RESULT(CALL_ORIG_FUNC(GetDeviceCaps)(hdc, nIndex));
}