Add StateStruct to InfocenterState

This commit is contained in:
Christian Semmler 2024-01-31 08:11:42 -05:00
parent 5a9bea65fd
commit 4695ce178c
5 changed files with 24 additions and 40 deletions

View File

@ -30,6 +30,7 @@ class InfocenterState : public LegoState {
inline MxS16 GetInfocenterBufferSize() { return sizeof(m_buffer) / sizeof(m_buffer[0]); } inline MxS16 GetInfocenterBufferSize() { return sizeof(m_buffer) / sizeof(m_buffer[0]); }
inline MxStillPresenter* GetInfocenterBufferElement(MxS32 p_index) { return m_buffer[p_index]; } inline MxStillPresenter* GetInfocenterBufferElement(MxS32 p_index) { return m_buffer[p_index]; }
inline StateStruct& GetUnknown0x68() { return m_unk0x68; }
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; }
@ -38,35 +39,10 @@ class InfocenterState : public LegoState {
// InfocenterState::`scalar deleting destructor' // InfocenterState::`scalar deleting destructor'
private: private:
// Members should be renamed with their offsets before use undefined m_unk0x08[0x18]; // 0x08
/* StateStruct m_unk0x20[3]; // 0x20
struct UnkStruct StateStruct m_unk0x44[3]; // 0x44
{ StateStruct m_unk0x68; // 0x68
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];
MxU32 m_unk0x74; // 0x74 MxU32 m_unk0x74; // 0x74
MxStillPresenter* m_buffer[7]; // 0x78 MxStillPresenter* m_buffer[7]; // 0x78
}; };

View File

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

View File

@ -16,12 +16,3 @@ MxBool LegoState::StateStruct::FUN_10014de0(MxU32 p_objectId)
// TODO // TODO
return FALSE; return FALSE;
} }
// FUNCTION: LEGO1 0x10017c00
LegoState::StateStruct::StateStruct()
{
m_unk0x04 = 0;
m_unk0x00 = 0;
m_unk0x06 = 0;
m_unk0x08 = 0;
}

View File

@ -82,6 +82,7 @@ void ElevatorBottom::ReadyWorld()
MxLong ElevatorBottom::HandleClick(LegoControlManagerEvent& p_param) MxLong ElevatorBottom::HandleClick(LegoControlManagerEvent& p_param)
{ {
MxLong result = 0; MxLong result = 0;
if (p_param.GetUnknown0x28() == 1) { if (p_param.GetUnknown0x28() == 1) {
switch (p_param.GetClickedObjectId()) { switch (p_param.GetClickedObjectId()) {
case 1: case 1:
@ -97,9 +98,11 @@ MxLong ElevatorBottom::HandleClick(LegoControlManagerEvent& p_param)
case 3: case 3:
LegoGameState* gs = GameState(); LegoGameState* gs = GameState();
Act1State* state = (Act1State*) gs->GetState("Act1State"); Act1State* state = (Act1State*) gs->GetState("Act1State");
if (state == NULL) { if (state == NULL) {
state = (Act1State*) gs->CreateState("Act1State"); state = (Act1State*) gs->CreateState("Act1State");
} }
state->SetUnknown1c(1); state->SetUnknown1c(1);
m_unk0xf8 = 6; m_unk0xf8 = 6;
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE); TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
@ -108,6 +111,7 @@ MxLong ElevatorBottom::HandleClick(LegoControlManagerEvent& p_param)
break; break;
} }
} }
return result; return result;
} }

View File

@ -457,6 +457,7 @@ MxU8 Infocenter::HandleMouseMove(MxS32 p_x, MxS32 p_y)
FUN_10070d10(p_x, p_y); FUN_10070d10(p_x, p_y);
return 1; return 1;
} }
return 0; return 0;
} }
@ -518,10 +519,13 @@ MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
{ {
if (p_param.GetUnknown0x28() == 1) { if (p_param.GetUnknown0x28() == 1) {
m_infoManDialogueTimer = 0; m_infoManDialogueTimer = 0;
InfomainScript actionToPlay = c_noInfomain; InfomainScript actionToPlay = c_noInfomain;
StopCurrentAction(); StopCurrentAction();
InfomainScript characterBitmap = c_noInfomain; InfomainScript characterBitmap = c_noInfomain;
GameState();
switch (p_param.GetClickedObjectId()) { switch (p_param.GetClickedObjectId()) {
case c_leftArrowCtl: case c_leftArrowCtl:
m_infocenterState->SetUnknown0x74(14); m_infocenterState->SetUnknown0x74(14);
@ -532,8 +536,10 @@ MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
m_transitionDestination = 5; m_transitionDestination = 5;
} }
else { else {
// todo MxU32 objectId = m_infocenterState->GetUnknown0x68().FUN_10014d00();
PlayAction((InfomainScript) objectId);
} }
break; break;
case c_rightArrowCtl: case c_rightArrowCtl:
m_infocenterState->SetUnknown0x74(14); m_infocenterState->SetUnknown0x74(14);