implement/match InfoCenter::~InfoCenter()

This commit is contained in:
Ramen2X 2024-01-18 20:33:48 -05:00
parent f1300d9de5
commit 30661c2284
3 changed files with 26 additions and 5 deletions

View File

@ -3,6 +3,7 @@
#include "decomp.h" #include "decomp.h"
#include "legostate.h" #include "legostate.h"
#include "mxstillpresenter.h";
// VTABLE: LEGO1 0x100d93a8 // VTABLE: LEGO1 0x100d93a8
// SIZE 0x94 // SIZE 0x94
@ -24,7 +25,7 @@ class InfocenterState : public LegoState {
return !strcmp(p_name, InfocenterState::ClassName()) || LegoState::IsA(p_name); return !strcmp(p_name, InfocenterState::ClassName()) || LegoState::IsA(p_name);
} }
inline MxU32 GetInfocenterBufferElement(MxS32 p_index) { return m_buffer[p_index]; } inline MxStillPresenter* GetInfocenterBufferElement(MxS32 p_index) { return m_buffer[p_index]; }
inline MxU32 GetUnknown0x74() { return m_unk0x74; } inline MxU32 GetUnknown0x74() { return m_unk0x74; }
inline void SetUnknown0x74(MxU32 p_unk0x74) { m_unk0x74 = p_unk0x74; } inline void SetUnknown0x74(MxU32 p_unk0x74) { m_unk0x74 = p_unk0x74; }
@ -63,7 +64,7 @@ class InfocenterState : public LegoState {
undefined m_pad[0x6c]; undefined m_pad[0x6c];
MxU32 m_unk0x74; // 0x74 MxU32 m_unk0x74; // 0x74
MxU32 m_buffer[7]; // 0x78 MxStillPresenter* m_buffer[7]; // 0x78
}; };
#endif // INFOCENTERSTATE_H #endif // INFOCENTERSTATE_H

View File

@ -112,7 +112,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
MxResult result; MxResult result;
InfocenterState* infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState"); InfocenterState* infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState");
if (!infocenterState || infocenterState->GetInfocenterBufferElement(0) == 0) if (!infocenterState || infocenterState->GetInfocenterBufferElement(0) == NULL)
result = SUCCESS; result = SUCCESS;
else { else {
result = FAILURE; result = FAILURE;

View File

@ -12,6 +12,7 @@
#include "mxnotificationmanager.h" #include "mxnotificationmanager.h"
#include "mxstillpresenter.h" #include "mxstillpresenter.h"
#include "mxtransitionmanager.h" #include "mxtransitionmanager.h"
#include "mxticklemanager.h"
DECOMP_SIZE_ASSERT(Infocenter, 0x1d8) DECOMP_SIZE_ASSERT(Infocenter, 0x1d8)
DECOMP_SIZE_ASSERT(InfocenterUnkDataEntry, 0x18) DECOMP_SIZE_ASSERT(InfocenterUnkDataEntry, 0x18)
@ -46,10 +47,29 @@ Infocenter::Infocenter()
m_unk0x1d6 = 0; m_unk0x1d6 = 0;
} }
// STUB: LEGO1 0x1006ec90 // FUNCTION: LEGO1 0x1006ec90
Infocenter::~Infocenter() Infocenter::~Infocenter()
{ {
// TODO BackgroundAudioManager()->Stop();
MxS16 i = 0;
do {
if (m_infocenterState->GetInfocenterBufferElement(i) != NULL) {
m_infocenterState->GetInfocenterBufferElement(i)->Enable(FALSE);
}
i++;
} while (i < 7);
ControlManager()->Unregister(this);
InputManager()->UnRegister(this);
if (InputManager()->GetWorld() == this) {
InputManager()->ClearWorld();
}
NotificationManager()->Unregister(this);
TickleManager()->UnregisterClient(this);
} }
// STUB: LEGO1 0x1006ed90 // STUB: LEGO1 0x1006ed90