1
0
Fork 0
mirror of https://github.com/isledecomp/isle.git synced 2025-03-24 21:50:18 -04:00

push progress, gn

This commit is contained in:
Joshua Peisach 2023-06-28 20:07:28 -04:00
parent 2b5cad1523
commit 6e4c290f20
2 changed files with 28 additions and 2 deletions

View file

@ -5,8 +5,15 @@ MxPalette::MxPalette()
{
this->m_overrideSkyColor = FALSE;
this->m_attached = NULL;
// GetDefaultSkyPalette
// this->m_skyColor = whatever it is once i figure out how m_palette works
GetDefaultPalette(this->m_entries);
this->m_skyColor = this->m_entries[0x8d];
// FIXME: Incomplete
}
// OFFSET: LEGO1 100bef90
MxPalette::~MxPalette()
{
delete m_attached; // yes this matches more
}
// OFFSET: LEGO1 0x100bf150
@ -16,6 +23,23 @@ MxResult MxPalette::GetEntries(LPPALETTEENTRY p_entries)
return SUCCESS;
}
// OFFSET: LEGO1 0x100bf420
void MxPalette::GetDefaultPalette(LPPALETTEENTRY p_entries)
{
HDC hdc = GetDC((HWND) NULL);
int rasterCaps = GetDeviceCaps(hdc, RASTERCAPS);
if ((rasterCaps & RC_PALETTE) != 0) {
int paletteSize = GetDeviceCaps(hdc, SIZEPALETTE);
if (paletteSize == 256) {
GetSystemPaletteEntries(hdc, 0, 256, p_entries);
p_entries += 10;
memcpy(p_entries, this->m_entries, sizeof(this->m_entries));
}
}
ReleaseDC((HWND) NULL, hdc);
}
// OFFSET: LEGO1 0x100bf330
void MxPalette::Detach()
{

View file

@ -14,6 +14,8 @@ public:
__declspec(dllexport) void Detach();
MxPalette();
~MxPalette();
void GetDefaultPalette(LPPALETTEENTRY p_entries);
MxResult GetEntries(LPPALETTEENTRY p_entries);
private: