From 243e4edb949496f463771821e9ef4016d256940a Mon Sep 17 00:00:00 2001 From: Misha Date: Sat, 7 Oct 2023 14:17:51 -0400 Subject: [PATCH] improved SetSkyColor match --- LEGO1/legovideomanager.cpp | 10 +++++++--- LEGO1/mxpalette.h | 1 + LEGO1/mxvideomanager.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/LEGO1/legovideomanager.cpp b/LEGO1/legovideomanager.cpp index 4105ef2a..78ab8110 100644 --- a/LEGO1/legovideomanager.cpp +++ b/LEGO1/legovideomanager.cpp @@ -48,11 +48,15 @@ void LegoVideoManager::MoveCursor(int x, int y) // OFFSET: LEGO1 0x1007c440 void LegoVideoManager::SetSkyColor(float red, float green, float blue) { - PALETTEENTRY colorStrucure; // [esp+0h] [ebp-4h] BYREF + PALETTEENTRY colorStrucure; - colorStrucure.peRed = (red* 255.0); + colorStrucure.peRed = (red * 255.0); colorStrucure.peGreen = (green * 255.0); colorStrucure.peBlue = (blue * 255.0); colorStrucure.peFlags = -124; - // TODO + m_videoParam.GetPalette()->SetSkyColor(&colorStrucure); + m_videoParam.GetPalette()->SetOverrideSkyColor(TRUE); + + // TODO 3d manager + //m_3dManager-> } diff --git a/LEGO1/mxpalette.h b/LEGO1/mxpalette.h index b024330a..7c9568b1 100644 --- a/LEGO1/mxpalette.h +++ b/LEGO1/mxpalette.h @@ -26,6 +26,7 @@ class MxPalette : public MxCore MxResult SetSkyColor(LPPALETTEENTRY p_sky_color); void Reset(MxBool p_ignoreSkyColor); LPDIRECTDRAWPALETTE CreateNativePalette(); + inline void SetOverrideSkyColor(MxBool p_value) { this->m_overrideSkyColor = p_value; } private: LPDIRECTDRAWPALETTE m_palette; PALETTEENTRY m_entries[256]; // 0xc diff --git a/LEGO1/mxvideomanager.h b/LEGO1/mxvideomanager.h index d72c1d10..f6e1a726 100644 --- a/LEGO1/mxvideomanager.h +++ b/LEGO1/mxvideomanager.h @@ -29,7 +29,7 @@ class MxVideoManager : public MxMediaManager inline MxVideoParam& GetVideoParam() { return this->m_videoParam; } inline LPDIRECTDRAW GetDirectDraw() { return this->m_pDirectDraw; } inline MxDisplaySurface *GetDisplaySurface() { return this->m_displaySurface; } -private: +protected: MxVideoParam m_videoParam; LPDIRECTDRAW m_pDirectDraw; LPDIRECTDRAWSURFACE m_pDDSurface;