mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-21 15:21:15 +00:00
Matching progress for MxPalette::GetDefaultPalette
This commit is contained in:
parent
959efb55b3
commit
927fcd7cf1
@ -41,15 +41,20 @@ void MxPalette::GetDefaultPalette(LPPALETTEENTRY p_entries)
|
|||||||
{
|
{
|
||||||
HDC hdc = GetDC((HWND) NULL);
|
HDC hdc = GetDC((HWND) NULL);
|
||||||
int rasterCaps = GetDeviceCaps(hdc, RASTERCAPS);
|
int rasterCaps = GetDeviceCaps(hdc, RASTERCAPS);
|
||||||
if ((rasterCaps & RC_PALETTE) != 0) {
|
LPPALETTEENTRY src;
|
||||||
int paletteSize = GetDeviceCaps(hdc, SIZEPALETTE);
|
int count;
|
||||||
if (paletteSize == 256) {
|
|
||||||
GetSystemPaletteEntries(hdc, 0, 256, p_entries);
|
|
||||||
p_entries += 10;
|
|
||||||
memcpy(p_entries, this->m_entries, sizeof(this->m_entries));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if ((rasterCaps & RC_PALETTE) != 0 && GetDeviceCaps(hdc, SIZEPALETTE) == 256) {
|
||||||
|
GetSystemPaletteEntries(hdc, 0, 256, p_entries);
|
||||||
|
count = 256 - 2 * 10;
|
||||||
|
src = (LPPALETTEENTRY) &m_palette[10];
|
||||||
|
p_entries += 10;
|
||||||
|
} else {
|
||||||
|
src = (LPPALETTEENTRY) m_palette;
|
||||||
|
count = 256;
|
||||||
|
}
|
||||||
|
void* dest;
|
||||||
|
memcpy(dest, p_entries, count * sizeof(PALETTEENTRY));
|
||||||
ReleaseDC((HWND) NULL, hdc);
|
ReleaseDC((HWND) NULL, hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user