feat: add/match MxPalette::CreateNativePalette [0x100BF000]

This commit is contained in:
ktkaufman03 2023-07-04 21:45:12 -04:00
parent 8734935beb
commit 149d0e4f9b
No known key found for this signature in database
GPG Key ID: 1E1BF4F2F99E03BB
2 changed files with 30 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#include "mxpalette.h"
#include "mxomni.h"
PALETTEENTRY g_defaultPaletteEntries[256] =
{
@ -457,4 +458,32 @@ void MxPalette::Reset(MxBool p_ignoreSkyColor)
SetEntries(this->m_entries);
this->m_palette->SetEntries(0, 0, 256, this->m_entries);
}
}
// OFFSET: LEGO1 0x100BF000
LPDIRECTDRAWPALETTE MxPalette::CreateNativePalette()
{
MxS32 i;
if ( this->m_palette == NULL )
{
for (i = 0; i < 10; i++)
this->m_entries[i].peFlags = 0x80;
for (i = 10; i < 136; i++)
this->m_entries[i].peFlags = 0x44;
for (i = 136; i < 140; i++)
this->m_entries[i].peFlags = 0x84;
this->m_entries[140].peFlags = 0x84;
this->m_entries[141].peFlags = 0x44;
for (i = 142; i < 246; i++)
this->m_entries[i].peFlags = 0x84;
for (i = 246; i < 256; i++)
this->m_entries[i].peFlags = 0x80;
if (MVideoManager() && MVideoManager()->GetDirectDraw())
{
MVideoManager()->GetDirectDraw()->CreatePalette(4, this->m_entries, &this->m_palette, NULL);
}
}
return this->m_palette;
}

View File

@ -25,6 +25,7 @@ class MxPalette : public MxCore
MxResult SetEntries(LPPALETTEENTRY p_palette);
MxResult SetSkyColor(LPPALETTEENTRY p_sky_color);
void Reset(MxBool p_ignoreSkyColor);
LPDIRECTDRAWPALETTE CreateNativePalette();
private:
LPDIRECTDRAWPALETTE m_palette;
PALETTEENTRY m_entries[256];