1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-14 22:03:27 +01:00

fix return value for NUMCOLORS on desktop window

This commit is contained in:
FunkyFr3sh 2024-12-15 20:16:49 +01:00
parent 9a015c47cb
commit 8be9875553

View File

@ -893,10 +893,22 @@ int WINAPI fake_GetDeviceCaps(HDC hdc, int index)
return RC_PALETTE | real_GetDeviceCaps(hdc, index);
}
if (index == SIZEPALETTE || index == NUMCOLORS)
if (index == SIZEPALETTE)
{
return 256;
}
if (index == NUMCOLORS)
{
if (WindowFromDC(hdc) == GetDesktopWindow())
{
return 20;
}
else
{
return 256;
}
}
}
return real_GetDeviceCaps(hdc, index);