Implement various infocenter functions (#510)

* Implement various infocenter methods

* fix order

* Update infocenter.cpp

* Update infocenter.cpp

* Update infocenter.cpp

* Update mxcontrolpresenter.cpp

* Rename stuff for consistency

* Add StateStruct to InfocenterState

* Resolve some TODO

* Use MxRect32

* Improve match

* Match Infocenter::UpdateFrameHot

* Fix VTable0x64

* WIP Match

* Match

* Cleanup

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Misha
2024-01-31 09:47:15 -05:00
committed by GitHub
parent bad32149ca
commit 9e0b19856c
20 changed files with 486 additions and 118 deletions

View File

@@ -27,9 +27,12 @@ public:
inline void SetUnknown18(MxU32 p_unk0x18) { m_unk0x18 = p_unk0x18; }
inline MxU32 GetUnknown18() { return m_unk0x18; }
inline void SetUnknown21(MxS16 p_unk0x21) { m_unk0x21 = p_unk0x21; }
inline MxU32 GetUnknown1c() { return m_unk0x1c; }
inline MxS16 GetUnknown21() { return m_unk0x21; }
inline void SetUnknown1c(MxU32 p_unk0x1c) { m_unk0x1c = p_unk0x1c; }
inline void SetUnknown21(MxS16 p_unk0x21) { m_unk0x21 = p_unk0x21; }
void FUN_10034d00();
// SYNTHETIC: LEGO1 0x10033960

View File

@@ -4,6 +4,8 @@
#include "decomp.h"
#include "legoworld.h"
class LegoControlManagerEvent;
// VTABLE: LEGO1 0x100d5f20
// SIZE: 0xfc (from inlined ctor at 0x1000a8aa)
class ElevatorBottom : public LegoWorld {
@@ -41,7 +43,7 @@ public:
private:
undefined4 m_unk0xf8; // 0xf8
MxLong HandleNotification17(MxParam& p_param);
MxLong HandleClick(LegoControlManagerEvent& p_param);
};
#endif // ELEVATORBOTTOM_H

View File

@@ -2,10 +2,12 @@
#define INFOCENTER_H
#include "legoworld.h"
#include "mxrect32.h"
#include "radio.h"
class InfocenterState;
class MxStillPresenter;
class LegoControlManagerEvent;
// SIZE 0x18
struct InfocenterMapEntry {
@@ -14,10 +16,7 @@ struct InfocenterMapEntry {
MxStillPresenter* m_presenter; // 0x00
undefined4 m_unk0x04; // 0x04
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
undefined4 m_unk0x10; // 0x10
undefined4 m_unk0x14; // 0x14
MxRect32 m_area; // 0x08
};
// VTABLE: LEGO1 0x100d9338
@@ -40,12 +39,15 @@ public:
c_leftArrowCtl = 1,
c_rightArrowCtl = 2,
c_infoCtl = 3,
c_doorCtl = 4,
c_boatCtl = 10,
c_raceCtl = 11,
c_pizzaCtl = 12,
c_gasCtl = 13,
c_medCtl = 14,
c_copCtl = 15,
c_bigInfoCtl = 16,
c_bookCtl = 17,
c_radioCtl = 18,
c_mamaCtl = 21,
c_papaCtl = 22,
@@ -53,6 +55,15 @@ public:
c_nickCtl = 24,
c_lauraCtl = 25,
c_mamaSelected = 30,
c_papaSelected = 31,
c_pepperSelected = 32,
c_nickSelected = 33,
c_lauraSelected = 34,
c_goToRegBook = 70,
c_goToRegBookRed = 71,
c_welcomeDialogue = 500,
c_goodJobDialogue = 501,
@@ -114,6 +125,13 @@ public:
c_noCDDialogueUnused1 = 552,
c_noCDDialogueUnused2 = 553,
c_gasCtlDescription = 555,
c_medCtlDescription = 556,
c_boatCtlDescription = 558,
c_copCtlDescription = 559,
c_pizzaCtlDescription = 560,
c_raceCtlDescription = 561,
c_leaveInfoCenterDialogue1 = 562,
c_leaveInfoCenterDialogue2 = 563,
c_leaveInfoCenterDialogue3 = 564,
@@ -163,16 +181,18 @@ private:
MxLong HandleKeyPress(MxS8 p_key);
MxU8 HandleMouseMove(MxS32 p_x, MxS32 p_y);
MxU8 HandleButtonUp(MxS32 p_x, MxS32 p_y);
MxU8 HandleNotification17(MxParam&);
MxU8 HandleClick(LegoControlManagerEvent& p_param);
MxLong HandleEndAction(MxParam& p_param);
MxLong HandleNotification0(MxParam&);
void FUN_10070dc0(MxBool);
void UpdateFrameHot(MxBool p_display);
void FUN_10070e90();
void PlayCutscene(Cutscene p_entityId, MxBool p_scale);
void StopCutscene();
void FUN_10070d10(MxS32 p_x, MxS32 p_y);
void StartCredits();
void StopCredits();
@@ -185,10 +205,10 @@ private:
InfomainScript m_currentInfomainScript; // 0xf8
MxS16 m_unk0xfc; // 0xfc
InfocenterState* m_infocenterState; // 0x100
undefined4 m_unk0x104; // 0x104
undefined4 m_transitionDestination; // 0x104
Cutscene m_currentCutscene; // 0x108
Radio m_radio; // 0x10c
undefined4 m_unk0x11c; // 0x11c
MxStillPresenter* m_unk0x11c; // 0x11c
InfocenterMapEntry m_mapAreas[7]; // 0x120
MxS16 m_unk0x1c8; // 0x1c8
MxStillPresenter* m_frameHotBitmap; // 0x1cc

View File

@@ -3,6 +3,8 @@
#include "legoworld.h"
class LegoControlManagerEvent;
// VTABLE: LEGO1 0x100d72d8
// SIZE 0xfc
class InfocenterDoor : public LegoWorld {
@@ -39,6 +41,8 @@ public:
private:
MxS32 m_unk0xf8; // 0xf8
MxLong HandleClick(LegoControlManagerEvent& p_param);
};
#endif // INFOCENTERDOOR_H

View File

@@ -30,6 +30,7 @@ public:
inline MxS16 GetInfocenterBufferSize() { return sizeof(m_buffer) / sizeof(m_buffer[0]); }
inline MxStillPresenter* GetInfocenterBufferElement(MxS32 p_index) { return m_buffer[p_index]; }
inline StateStruct& GetUnknown0x68() { return m_unk0x68; }
inline MxU32 GetUnknown0x74() { return m_unk0x74; }
inline void SetUnknown0x74(MxU32 p_unk0x74) { m_unk0x74 = p_unk0x74; }
@@ -38,35 +39,10 @@ public:
// InfocenterState::`scalar deleting destructor'
private:
// Members should be renamed with their offsets before use
/*
struct UnkStruct
{
undefined4 unk1;
undefined2 unk2;
undefined2 unk3;
undefined2 unk4;
};
undefined2 unk1;
undefined2 unk2;
undefined4 unk3;
undefined4 padding1;
void *unk4;
undefined2 unk5;
undefined2 unk6;
undefined2 unk7;
undefined2 padding2;
void *unk8;
undefined2 unk9;
undefined2 unk10;
undefined2 unk11;
undefined2 padding3;
UnkStruct unk12[6];
undefined4 unk13;
*/
undefined m_pad[0x6c];
undefined m_unk0x08[0x18]; // 0x08
StateStruct m_unk0x20[3]; // 0x20
StateStruct m_unk0x44[3]; // 0x44
StateStruct m_unk0x68; // 0x68
MxU32 m_unk0x74; // 0x74
MxStillPresenter* m_buffer[7]; // 0x78
};

View File

@@ -39,6 +39,7 @@ public:
inline MxU32 GetUnknown10() { return m_unk0x10; }
inline MxS32 GetCurrentAct() { return m_currentAct; }
inline MxU32 GetCurrentArea() { return m_currentArea; }
inline MxU32 GetPreviousArea() { return m_previousArea; }
inline void SetDirty(MxBool p_dirty) { m_isDirty = p_dirty; }
inline void SetCurrentArea(MxU32 p_currentArea) { m_currentArea = p_currentArea; }

View File

@@ -51,7 +51,14 @@ public:
undefined2 m_unk0x06; // 0x06
MxU16 m_unk0x08; // 0x08
StateStruct();
// FUNCTION: LEGO1 0x10017c00
StateStruct()
{
m_unk0x04 = 0;
m_unk0x00 = NULL;
m_unk0x06 = 0;
m_unk0x08 = 0;
}
MxU32 FUN_10014d00();
MxBool FUN_10014de0(MxU32 p_objectId);

View File

@@ -29,20 +29,21 @@ public:
}
void Initialize(MxBool p_und);
void Play();
void Stop();
// SYNTHETIC: LEGO1 0x1002c970
// Radio::`scalar deleting destructor'
private:
void CreateRadioState();
RadioState* m_state; // 0x08
MxBool m_unk0x0c; // 0x0c
MxBool m_bgAudioPreviouslyEnabled; // 0x0d
void CreateRadioState();
void Play();
void Stop();
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
MxLong HandleNotification17(LegoControlManagerEvent& p_param);
MxLong HandleClick(LegoControlManagerEvent& p_param);
};
#endif // RADIO_H