fix: MxPalette rgbquad ctor functionally matches

Not quite ASM matching yet because of weird
register allocation mismatches.
This commit is contained in:
ktkaufman03 2023-07-04 20:11:48 -04:00
parent 5dd157fe6c
commit ebc3145ca7
No known key found for this signature in database
GPG Key ID: 1E1BF4F2F99E03BB

View File

@ -271,6 +271,24 @@ MxPalette::MxPalette()
this->m_skyColor = this->m_entries[141];
}
// OFFSET: LEGO1 0x100BEED0
MxPalette::MxPalette(const RGBQUAD *p_colors)
{
this->m_overrideSkyColor = FALSE;
this->m_palette = NULL;
GetDefaultPalette(this->m_entries);
for ( int i = 10; i < 246; i++ )
{
this->m_entries[i].peRed = p_colors[i].rgbRed;
this->m_entries[i].peGreen = p_colors[i].rgbGreen;
this->m_entries[i].peBlue = p_colors[i].rgbBlue;
this->m_entries[i].peFlags = 0;
}
this->m_skyColor = this->m_entries[141];
}
// OFFSET: LEGO1 100bef90
MxPalette::~MxPalette()
{
@ -307,17 +325,6 @@ MxPalette* MxPalette::Clone()
return result;
}
// OFFSET: LEGO1 0x100beed0
MxPalette* MxPalette::FromBitmapPalette(RGBQUAD* p_bmp)
{
// FIXME: Incomplete
this->m_overrideSkyColor = FALSE;
ApplySystemEntriesToPalette(this->m_entries);
memcpy(this->m_entries + 10, &p_bmp[10], 246);
this->m_skyColor = this->m_entries[141];
return this;
}
// OFFSET: LEGO1 0x100bf420
void MxPalette::GetDefaultPalette(LPPALETTEENTRY p_entries)
{