mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 08:54:15 +00:00
push progress, gn
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -14,6 +14,8 @@ public:
|
||||
__declspec(dllexport) void Detach();
|
||||
|
||||
MxPalette();
|
||||
~MxPalette();
|
||||
void GetDefaultPalette(LPPALETTEENTRY p_entries);
|
||||
MxResult GetEntries(LPPALETTEENTRY p_entries);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user