From 1f6d1ddab05a95d59d334433ad75cad49855f2c5 Mon Sep 17 00:00:00 2001 From: Misha <106913236+MishaProductions@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:05:20 -0500 Subject: [PATCH] Lego video manager constructor and deconstructor (#275) * commit * Update legovideomanager.cpp * add offset comments * Update legovideomanager.h * Update legovideomanager.h --- LEGO1/legovideomanager.cpp | 49 ++++++++++++++++++++++++++++++++++---- LEGO1/legovideomanager.h | 38 ++++++++++++++++++++++------- 2 files changed, 75 insertions(+), 12 deletions(-) diff --git a/LEGO1/legovideomanager.cpp b/LEGO1/legovideomanager.cpp index 775c2e8c..55f3da33 100644 --- a/LEGO1/legovideomanager.cpp +++ b/LEGO1/legovideomanager.cpp @@ -2,16 +2,57 @@ DECOMP_SIZE_ASSERT(LegoVideoManager, 0x590); -// OFFSET: LEGO1 0x1007aa20 STUB +// OFFSET: LEGO1 0x1007aa20 LegoVideoManager::LegoVideoManager() { - // TODO + m_unk64 = 0; + m_3dManager = NULL; + m_unk6c = 0; + m_direct3d = 0; + m_unk0xe6 = FALSE; + memset(m_unk0x78, 0, sizeof(m_unk0x78)); + m_unk0x78[0] = 0x6c; + m_unk4e8 = 0; + m_isFullscreenMovie = FALSE; + m_palette = NULL; + m_prefCounter = NULL; + m_cursorMoved = FALSE; + m_cursorX = m_cursorY; + m_cursorYCopy = m_cursorY; + m_cursorXCopy = m_cursorY; + m_unk0x514 = 0; + m_unk0x500 = FALSE; + m_drawFPS = FALSE; + m_unk0x528 = 0; + m_arialFont = NULL; + m_unk0xe5 = FALSE; + m_unk0x554 = 0; + m_initialized = FALSE; } -// OFFSET: LEGO1 0x1007ab40 STUB +// OFFSET: LEGO1 0x1007ab40 LegoVideoManager::~LegoVideoManager() { - // TODO + Destroy(); + delete m_palette; +} + +// OFFSET: LEGO1 0x1007b5e0 +void LegoVideoManager::Destroy() +{ + // todo: delete m_unk0x512 + // todo: delete m_unk0x258 + if (m_arialFont != NULL) { + DeleteObject(m_arialFont); + m_arialFont = NULL; + } + + // delete m_unk64; //TODO: delete d3drm + + delete m_3dManager; + MxVideoManager::Destroy(); + // todo: delete m_unk4e8 + delete[] m_prefCounter; } // OFFSET: LEGO1 0x1007c560 STUB diff --git a/LEGO1/legovideomanager.h b/LEGO1/legovideomanager.h index b845e8a8..a6d2f89f 100644 --- a/LEGO1/legovideomanager.h +++ b/LEGO1/legovideomanager.h @@ -33,20 +33,42 @@ class LegoVideoManager : public MxVideoManager { this->m_videoParam.GetPalette()->SetOverrideSkyColor(p_shouldOverride); } + virtual void Destroy() override; // vtable+0x18 + private: undefined4 m_unk64; - Lego3DManager* m_3dManager; + Lego3DManager* m_3dManager; // 0x68 undefined4 m_unk6c; undefined4 m_unk70; - MxDirect3D* m_direct3d; - undefined m_pad0x78[0x6c]; + MxDirect3D* m_direct3d; // 0x74 + undefined4 m_unk0x78[27]; MxBool m_unk0xe4; - undefined m_pad0xe8[0x41c]; + MxBool m_unk0xe5; + MxBool m_unk0xe6; + PALETTEENTRY m_paletteEntries[256]; // 0xe7 + undefined m_padding0x4e7; + undefined4 m_unk4e8; + MxBool m_isFullscreenMovie; // 0x4ec + MxPalette* m_palette; // 0x4f0 + LARGE_INTEGER* m_prefCounter; // 0x4f4 + undefined m_padding0x4f4[8]; + MxBool m_unk0x500; MxBool m_cursorMoved; // 0x501 - undefined m_pad0x502[0x8]; - MxS32 m_cursorX; // 0x50c - MxS32 m_cursorY; // 0x510 - undefined m_pad0x514[0x7c]; + MxS32 m_cursorXCopy; // 0x504 + MxS32 m_cursorYCopy; // 0x508 + MxS32 m_cursorX; // 0x50c + MxS32 m_cursorY; // 0x510 + undefined4 m_unk0x514; + undefined m_pad0x518[0x10]; + undefined4 m_unk0x528; + MxBool m_drawFPS; // 0x52c + RECT m_fpsRect; // 0x530 + HFONT m_arialFont; // 0x540 + SIZE m_fpsSize; // 0x544 + undefined m_pad0x54c[8]; + undefined m_unk0x554; + MxBool m_initialized; // 0x555 + undefined m_pad0x556[0x39]; }; #endif // LEGOVIDEOMANAGER_H