mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-20 14:51:15 +00:00
feat: add/match MxPalette::CreateNativePalette [0x100BF000]
This commit is contained in:
parent
8734935beb
commit
149d0e4f9b
@ -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;
|
||||
}
|
||||
@ -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];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user