mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-14 22:03:27 +01:00
copy from g_ddp_me_palette if there's no primary yet
This commit is contained in:
parent
1c263ca573
commit
82d3ec46a3
@ -1351,13 +1351,24 @@ HFONT WINAPI fake_CreateFontA(
|
||||
|
||||
UINT WINAPI fake_GetSystemPaletteEntries(HDC hdc, UINT iStart, UINT cEntries, LPPALETTEENTRY pPalEntries)
|
||||
{
|
||||
if (g_ddraw.ref && g_ddraw.bpp == 8 && WindowFromDC(hdc) == g_ddraw.hwnd)
|
||||
if (g_ddraw.ref && g_ddraw.bpp == 8 && pPalEntries && WindowFromDC(hdc) == g_ddraw.hwnd)
|
||||
{
|
||||
if (g_ddraw.primary && g_ddraw.primary->palette)
|
||||
{
|
||||
TRACE("ddp_GetEntries test\n");
|
||||
ddp_GetEntries(g_ddraw.primary->palette, 0, iStart, cEntries, pPalEntries);
|
||||
return cEntries - iStart;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = iStart, x = 0; i < iStart + cEntries && i < 256; i++, x++)
|
||||
{
|
||||
pPalEntries[x].peRed = g_ddp_me_palette[i].peRed;
|
||||
pPalEntries[x].peGreen = g_ddp_me_palette[i].peGreen;
|
||||
pPalEntries[x].peBlue = g_ddp_me_palette[i].peBlue;
|
||||
pPalEntries[x].peFlags = g_ddp_me_palette[i].peFlags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return real_GetSystemPaletteEntries(hdc, iStart, cEntries, pPalEntries);
|
||||
|
Loading…
x
Reference in New Issue
Block a user