mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-20 23:01:16 +00:00
fix: MxPalette::ApplySystemEntriesToPalette is now 100% matching
This commit is contained in:
parent
1eb30e1ad1
commit
57885103c0
@ -282,20 +282,20 @@ MxPalette::~MxPalette()
|
|||||||
// OFFSET: LEGO1 0x100bf390
|
// OFFSET: LEGO1 0x100bf390
|
||||||
void MxPalette::ApplySystemEntriesToPalette(LPPALETTEENTRY p_entries)
|
void MxPalette::ApplySystemEntriesToPalette(LPPALETTEENTRY p_entries)
|
||||||
{
|
{
|
||||||
HDC hdc = GetDC(NULL);
|
HDC hdc;
|
||||||
int rastercaps = GetDeviceCaps(hdc, RASTERCAPS);
|
|
||||||
int sizepalettecaps;
|
hdc = GetDC(0);
|
||||||
if ((rastercaps & RC_PALETTE) != 0) {
|
if ( (GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE) != 0 && GetDeviceCaps(hdc, SIZEPALETTE) == 256 )
|
||||||
sizepalettecaps = GetDeviceCaps(hdc, SIZEPALETTE);
|
{
|
||||||
if(sizepalettecaps = 256) {
|
GetSystemPaletteEntries(hdc, 0, 10, p_entries);
|
||||||
GetSystemPaletteEntries(hdc,0,10,p_entries);
|
GetSystemPaletteEntries(hdc, 246, 10, &p_entries[246]);
|
||||||
GetSystemPaletteEntries(hdc,246,10,p_entries + 0xf6);
|
|
||||||
ReleaseDC(NULL, hdc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
memcpy(p_entries, g_defaultPalette, 10);
|
else
|
||||||
memcpy(p_entries + 0xf6, g_defaultPalette + 0xf6, 10);
|
{
|
||||||
ReleaseDC(NULL, hdc);
|
memcpy(p_entries, g_defaultPaletteEntries, sizeof(PALETTEENTRY) * 10);
|
||||||
|
memcpy(&p_entries[246], &g_defaultPaletteEntries[246], sizeof(PALETTEENTRY) * 10);
|
||||||
|
}
|
||||||
|
ReleaseDC(0, hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100bf0b0
|
// OFFSET: LEGO1 0x100bf0b0
|
||||||
@ -322,7 +322,7 @@ MxPalette* MxPalette::FromBitmapPalette(RGBQUAD* p_bmp)
|
|||||||
void MxPalette::GetDefaultPalette(LPPALETTEENTRY p_entries)
|
void MxPalette::GetDefaultPalette(LPPALETTEENTRY p_entries)
|
||||||
{
|
{
|
||||||
HDC DC;
|
HDC DC;
|
||||||
|
|
||||||
DC = GetDC(0);
|
DC = GetDC(0);
|
||||||
if ( (GetDeviceCaps(DC, 38) & 0x100) != 0 && GetDeviceCaps(DC, 104) == 256 )
|
if ( (GetDeviceCaps(DC, 38) & 0x100) != 0 && GetDeviceCaps(DC, 104) == 256 )
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user