From 7b774666c8a59a8b347aa5c0828dfc00381304bc Mon Sep 17 00:00:00 2001 From: ktkaufman03 Date: Tue, 4 Jul 2023 20:54:58 -0400 Subject: [PATCH] feat: add/match MxPalette::Reset [0x100BF490] --- LEGO1/mxpalette.cpp | 15 +++++++++++++++ LEGO1/mxpalette.h | 1 + 2 files changed, 16 insertions(+) diff --git a/LEGO1/mxpalette.cpp b/LEGO1/mxpalette.cpp index 78d16f8d..ab5ef4aa 100644 --- a/LEGO1/mxpalette.cpp +++ b/LEGO1/mxpalette.cpp @@ -442,4 +442,19 @@ MxResult MxPalette::SetSkyColor(LPPALETTEENTRY p_sky_color) status = -1; } return status; +} + +// OFFSET: LEGO1 0x100BF490 +void MxPalette::Reset(MxBool p_ignoreSkyColor) +{ + if ( this->m_palette != NULL ) + { + GetDefaultPalette(this->m_entries); + if ( !p_ignoreSkyColor ) + { + this->m_entries[140] = this->m_entries[141] = this->m_skyColor; + } + SetEntries(this->m_entries); + this->m_palette->SetEntries(0, 0, 256, this->m_entries); + } } \ No newline at end of file diff --git a/LEGO1/mxpalette.h b/LEGO1/mxpalette.h index 016dc0a4..c10fd668 100644 --- a/LEGO1/mxpalette.h +++ b/LEGO1/mxpalette.h @@ -24,6 +24,7 @@ class MxPalette : public MxCore MxResult GetEntries(LPPALETTEENTRY p_entries); MxResult SetEntries(LPPALETTEENTRY p_palette); MxResult SetSkyColor(LPPALETTEENTRY p_sky_color); + void Reset(MxBool p_ignoreSkyColor); private: LPDIRECTDRAWPALETTE m_palette; PALETTEENTRY m_entries[256];