Merge branch 'mxmediapresenter-tickle' into mxvideopresenter

This commit is contained in:
Christian Semmler 2023-11-12 08:03:34 -05:00
commit bb75baedb4
11 changed files with 109 additions and 22 deletions

View File

@ -2,16 +2,57 @@
DECOMP_SIZE_ASSERT(LegoVideoManager, 0x590); DECOMP_SIZE_ASSERT(LegoVideoManager, 0x590);
// OFFSET: LEGO1 0x1007aa20 STUB // OFFSET: LEGO1 0x1007aa20
LegoVideoManager::LegoVideoManager() 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() 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 // OFFSET: LEGO1 0x1007c560 STUB

View File

@ -33,20 +33,42 @@ class LegoVideoManager : public MxVideoManager {
this->m_videoParam.GetPalette()->SetOverrideSkyColor(p_shouldOverride); this->m_videoParam.GetPalette()->SetOverrideSkyColor(p_shouldOverride);
} }
virtual void Destroy() override; // vtable+0x18
private: private:
undefined4 m_unk64; undefined4 m_unk64;
Lego3DManager* m_3dManager; Lego3DManager* m_3dManager; // 0x68
undefined4 m_unk6c; undefined4 m_unk6c;
undefined4 m_unk70; undefined4 m_unk70;
MxDirect3D* m_direct3d; MxDirect3D* m_direct3d; // 0x74
undefined m_pad0x78[0x6c]; undefined4 m_unk0x78[27];
MxBool m_unk0xe4; 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 MxBool m_cursorMoved; // 0x501
undefined m_pad0x502[0x8]; MxS32 m_cursorXCopy; // 0x504
MxS32 m_cursorX; // 0x50c MxS32 m_cursorYCopy; // 0x508
MxS32 m_cursorY; // 0x510 MxS32 m_cursorX; // 0x50c
undefined m_pad0x514[0x7c]; 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 #endif // LEGOVIDEOMANAGER_H

View File

@ -1,5 +1,8 @@
#include "mxcontrolpresenter.h" #include "mxcontrolpresenter.h"
#include "legoomni.h"
#include "mxticklemanager.h"
DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c) DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c)
// OFFSET: LEGO1 0x10043f50 // OFFSET: LEGO1 0x10043f50
@ -12,3 +15,21 @@ MxControlPresenter::MxControlPresenter()
this->m_unk58 = 0; this->m_unk58 = 0;
this->m_unk54 = 0; this->m_unk54 = 0;
} }
// OFFSET: LEGO1 0x10044110
MxControlPresenter::~MxControlPresenter()
{
if (this->m_unk58) {
delete this->m_unk58;
}
}
// OFFSET: LEGO1 0x10044610
void MxControlPresenter::ReadyTickle()
{
MxPresenter::ParseExtra();
TickleManager()->UnregisterClient(this);
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
m_currentTickleState = TickleState_Repeating;
}

View File

@ -9,6 +9,7 @@
class MxControlPresenter : public MxCompositePresenter { class MxControlPresenter : public MxCompositePresenter {
public: public:
MxControlPresenter(); MxControlPresenter();
virtual ~MxControlPresenter() override;
// OFFSET: LEGO1 0x10044000 // OFFSET: LEGO1 0x10044000
inline virtual const char* ClassName() const override // vtable+0x0c inline virtual const char* ClassName() const override // vtable+0x0c
@ -23,13 +24,15 @@ class MxControlPresenter : public MxCompositePresenter {
return !strcmp(name, MxControlPresenter::ClassName()) || MxCompositePresenter::IsA(name); return !strcmp(name, MxControlPresenter::ClassName()) || MxCompositePresenter::IsA(name);
} }
virtual void ReadyTickle() override; // vtable+0x18
private: private:
undefined2 m_unk4c; undefined2 m_unk4c;
MxS16 m_unk4e; MxS16 m_unk4e;
undefined m_unk50; undefined m_unk50;
undefined2 m_unk52; undefined2 m_unk52;
undefined2 m_unk54; undefined2 m_unk54;
undefined4 m_unk58; undefined4* m_unk58;
}; };
#endif // MXCONTROLPRESENTER_H #endif // MXCONTROLPRESENTER_H

View File

@ -12,7 +12,7 @@ class MxDSActionList : public MxList<MxDSAction*> {
public: public:
MxDSActionList() { this->m_unk18 = 0; } MxDSActionList() { this->m_unk18 = 0; }
virtual MxS8 Compare(MxDSAction*, MxDSAction*); // +0x14 virtual MxS8 Compare(MxDSAction*, MxDSAction*) override; // +0x14
static void Destroy(MxDSAction* p_action); static void Destroy(MxDSAction* p_action);

View File

@ -3,6 +3,7 @@
#include "decomp.h" #include "decomp.h"
#include "mxcore.h" #include "mxcore.h"
#include "mxdschunk.h"
#include "mxstreamchunk.h" #include "mxstreamchunk.h"
#include "mxstreamcontroller.h" #include "mxstreamcontroller.h"

View File

@ -63,13 +63,12 @@ class MxHashTable : protected HashTableParent<T> {
m_resizeOption = HASH_TABLE_OPT_NO_EXPAND; m_resizeOption = HASH_TABLE_OPT_NO_EXPAND;
} }
virtual ~MxHashTable(); virtual ~MxHashTable() override;
void Resize(); void Resize();
void Add(T*); void Add(T*);
virtual MxS8 Compare(T*, T*) = 0; virtual MxS8 Compare(T*, T*) override = 0;
virtual MxU32 Hash(T*) = 0; virtual MxU32 Hash(T*) = 0;
// FIXME: use of friend here? // FIXME: use of friend here?

View File

@ -70,7 +70,7 @@ class MxList : protected MxListParent<T> {
m_first = NULL; m_first = NULL;
} }
virtual ~MxList(); virtual ~MxList() override;
void Append(T p_obj) { _InsertEntry(p_obj, this->m_last, NULL); }; void Append(T p_obj) { _InsertEntry(p_obj, this->m_last, NULL); };
void DeleteAll(); void DeleteAll();

View File

@ -17,7 +17,7 @@ class MxPresenterListParent : public MxList<MxPresenter*> {
// SIZE 0x18 // SIZE 0x18
class MxPresenterList : public MxPresenterListParent { class MxPresenterList : public MxPresenterListParent {
public: public:
virtual MxS8 Compare(MxPresenter*, MxPresenter*); // +0x14 virtual MxS8 Compare(MxPresenter*, MxPresenter*) override; // +0x14
}; };
typedef MxListCursorChildChild<MxPresenter*> MxPresenterListCursor; typedef MxListCursorChildChild<MxPresenter*> MxPresenterListCursor;

View File

@ -12,7 +12,7 @@ class MxStreamChunkList : public MxList<MxStreamChunk*> {
public: public:
MxStreamChunkList() { m_customDestructor = Destroy; } MxStreamChunkList() { m_customDestructor = Destroy; }
virtual MxS8 Compare(MxStreamChunk*, MxStreamChunk*); // +0x14 virtual MxS8 Compare(MxStreamChunk*, MxStreamChunk*) override; // +0x14
static void Destroy(MxStreamChunk* p_chunk); static void Destroy(MxStreamChunk* p_chunk);
}; };

View File

@ -17,8 +17,8 @@ class MxVariableTable : public MxHashTable<MxVariable> {
// OFFSET: LEGO1 0x100afdb0 // OFFSET: LEGO1 0x100afdb0
static void Destroy(MxVariable* p_obj) { p_obj->Destroy(); } static void Destroy(MxVariable* p_obj) { p_obj->Destroy(); }
virtual MxS8 Compare(MxVariable*, MxVariable*); // +0x14 virtual MxS8 Compare(MxVariable*, MxVariable*) override; // +0x14
virtual MxU32 Hash(MxVariable*); // +0x18 virtual MxU32 Hash(MxVariable*) override; // +0x18
}; };
// OFFSET: LEGO1 0x100b0bd0 TEMPLATE // OFFSET: LEGO1 0x100b0bd0 TEMPLATE