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:
parent
bbb850faf1
commit
1294e5df0d
@ -212,12 +212,34 @@ namespace
|
|||||||
}
|
}
|
||||||
break;
|
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:
|
case RASTERCAPS:
|
||||||
if (8 == g_currentBpp && Gdi::isDisplayDc(hdc))
|
if (8 == g_currentBpp && Gdi::isDisplayDc(hdc))
|
||||||
{
|
{
|
||||||
return LOG_RESULT(CALL_ORIG_FUNC(GetDeviceCaps)(hdc, nIndex) | RC_PALETTE);
|
return LOG_RESULT(CALL_ORIG_FUNC(GetDeviceCaps)(hdc, nIndex) | RC_PALETTE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SIZEPALETTE:
|
||||||
|
if (8 == g_currentBpp && Gdi::isDisplayDc(hdc))
|
||||||
|
{
|
||||||
|
return 256;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return LOG_RESULT(CALL_ORIG_FUNC(GetDeviceCaps)(hdc, nIndex));
|
return LOG_RESULT(CALL_ORIG_FUNC(GetDeviceCaps)(hdc, nIndex));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user