diff --git a/LEGO1/lego/legoomni/include/elevatorbottom.h b/LEGO1/lego/legoomni/include/elevatorbottom.h index ed424efd..1f02d28f 100644 --- a/LEGO1/lego/legoomni/include/elevatorbottom.h +++ b/LEGO1/lego/legoomni/include/elevatorbottom.h @@ -40,6 +40,8 @@ class ElevatorBottom : public LegoWorld { private: undefined4 m_unk0xf8; // 0xf8 + + MxLong HandleNotification17(MxParam& p_param); }; #endif // ELEVATORBOTTOM_H diff --git a/LEGO1/lego/legoomni/include/infocenter.h b/LEGO1/lego/legoomni/include/infocenter.h index 4d8ed408..7de6ec45 100644 --- a/LEGO1/lego/legoomni/include/infocenter.h +++ b/LEGO1/lego/legoomni/include/infocenter.h @@ -170,10 +170,10 @@ class Infocenter : public LegoWorld { InfocenterUnkDataEntry m_entries[7]; // 0x120 MxS16 m_unk0x1c8; // 0x1c8 undefined4 m_unk0x1cc; // 0x1cc - MxU16 m_unk0x1d0; // 0x1d0 - MxU16 m_unk0x1d2; // 0x1d2 + MxS16 m_infoManDialogueTimer; // 0x1d0 + MxS16 m_bookAnimationTimer; // 0x1d2 MxU16 m_unk0x1d4; // 0x1d4 - MxU16 m_unk0x1d6; // 0x1d6 + MxS16 m_unk0x1d6; // 0x1d6 }; #endif // INFOCENTER_H diff --git a/LEGO1/lego/legoomni/include/infocenterdoor.h b/LEGO1/lego/legoomni/include/infocenterdoor.h index effb22cf..2fb19930 100644 --- a/LEGO1/lego/legoomni/include/infocenterdoor.h +++ b/LEGO1/lego/legoomni/include/infocenterdoor.h @@ -36,6 +36,9 @@ class InfocenterDoor : public LegoWorld { // SYNTHETIC: LEGO1 0x100378d0 // InfocenterDoor::`scalar deleting destructor' + +private: + MxS32 m_unk0xf8; }; #endif // INFOCENTERDOOR_H diff --git a/LEGO1/lego/legoomni/src/infocenter/elevatorbottom.cpp b/LEGO1/lego/legoomni/src/infocenter/elevatorbottom.cpp index ad199882..853dfb67 100644 --- a/LEGO1/lego/legoomni/src/infocenter/elevatorbottom.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/elevatorbottom.cpp @@ -43,11 +43,23 @@ MxResult ElevatorBottom::Create(MxDSAction& p_dsAction) return result; } -// STUB: LEGO1 0x10018150 +// FUNCTION: LEGO1 0x10018150 MxLong ElevatorBottom::Notify(MxParam& p_param) { - // TODO - return LegoWorld::Notify(p_param); + MxLong ret = 0; + LegoWorld::Notify(p_param); + + if (m_worldStarted) { + switch (((MxNotificationParam&) p_param).GetType()) { + case c_notificationType17: + ret = HandleNotification17(p_param); + break; + case c_notificationTransitioned: + GameState()->HandleAction(m_unk0xf8); + break; + } + } + return ret; } // FUNCTION: LEGO1 0x100181b0 @@ -58,6 +70,12 @@ void ElevatorBottom::VTable0x50() FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); } +// STUB: LEGO1 0x100181d0 +MxLong ElevatorBottom::HandleNotification17(MxParam& p_param) +{ + return 0; +} + // FUNCTION: LEGO1 0x100182c0 void ElevatorBottom::VTable0x68(MxBool p_add) { diff --git a/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp b/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp index 68090a69..08d0cc7c 100644 --- a/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp @@ -41,8 +41,8 @@ Infocenter::Infocenter() SetAppCursor(1); NotificationManager()->Register(this); - m_unk0x1d0 = 0; - m_unk0x1d2 = 0; + m_infoManDialogueTimer = 0; + m_bookAnimationTimer = 0; m_unk0x1d4 = 0; m_unk0x1d6 = 0; } @@ -130,7 +130,7 @@ MxLong Infocenter::Notify(MxParam& p_param) break; case c_notificationTransitioned: StopBookAnimation(); - m_unk0x1d2 = 0; + m_bookAnimationTimer = 0; if (m_infocenterState->GetUnknown0x74() == 0xc) { StartCredits(); @@ -232,7 +232,7 @@ MxLong Infocenter::HandleEndAction(MxParam& p_param) m_currentCutscene = e_noIntro; if (m_infocenterState->GetInfocenterBufferElement(0) == 0) { - m_unk0x1d2 = 1; + m_bookAnimationTimer = 1; return 1; } break; @@ -278,7 +278,7 @@ MxLong Infocenter::HandleEndAction(MxParam& p_param) if (m_infocenterState->GetInfocenterBufferElement(0) == 0 && m_currentInfomainScript != 40 && m_currentInfomainScript != 41 && m_currentInfomainScript != 42 && m_currentInfomainScript != 43 && m_currentInfomainScript != 44) { - m_unk0x1d0 = 1; + m_infoManDialogueTimer = 1; PlayMusic(11); } @@ -299,8 +299,8 @@ MxLong Infocenter::HandleEndAction(MxParam& p_param) // STUB: LEGO1 0x1006f4e0 void Infocenter::VTable0x50() { - m_unk0x1d0 = 0; - m_unk0x1d2 = 0; + m_infoManDialogueTimer = 0; + m_bookAnimationTimer = 0; m_unk0x1d4 = 0; m_unk0x1d6 = 0; @@ -319,7 +319,7 @@ void Infocenter::VTable0x50() case 4: m_infocenterState->SetUnknown0x74(2); if (m_infocenterState->GetInfocenterBufferElement(0) == 0) { - m_unk0x1d2 = 1; + m_bookAnimationTimer = 1; } PlayAction(c_letsGetStartedDialogue); @@ -337,7 +337,7 @@ void Infocenter::VTable0x50() return; case 0xf: if (m_infocenterState->GetInfocenterBufferElement(0) == 0) { - m_unk0x1d2 = 1; + m_bookAnimationTimer = 1; } PlayAction(c_clickOnInfomanDialogue); @@ -383,7 +383,7 @@ MxLong Infocenter::HandleKeyPress(MxS8 p_key) m_infocenterState->SetUnknown0x74(1); if (m_infocenterState->GetInfocenterBufferElement(0) == 0) { - m_unk0x1d2 = 1; + m_bookAnimationTimer = 1; return 1; } break; @@ -452,11 +452,48 @@ void Infocenter::VTable0x68(MxBool p_add) } } -// STUB: LEGO1 0x10070af0 +// FUNCTION: LEGO1 0x10070af0 MxResult Infocenter::Tickle() { - // TODO - return LegoWorld::Tickle(); + if (m_worldStarted == FALSE) { + LegoWorld::Tickle(); + return 0; + } + + if (m_infoManDialogueTimer != 0 && (m_infoManDialogueTimer += 100) > 25000) { + PlayAction(c_clickOnInfomanDialogue); + m_infoManDialogueTimer = 0; + } + + if (m_bookAnimationTimer != 0 && (m_bookAnimationTimer += 100) > 3000) { + PlayBookAnimation(); + m_bookAnimationTimer = 1; + } + + if (m_unk0x1d6 != 0) { + m_unk0x1d6 += 100; + if (m_unk0x1d6 > 3400 && m_unk0x1d6 < 3650) { + ControlManager()->FUN_100293c0(0x10, m_atom, 1); + return 0; + } + + if (m_unk0x1d6 > 3650 && m_unk0x1d6 < 3900) { + ControlManager()->FUN_100293c0(0x10, m_atom, 0); + return 0; + } + + if (m_unk0x1d6 > 3900 && m_unk0x1d6 < 4150) { + ControlManager()->FUN_100293c0(0x10, m_atom, 1); + return 0; + } + + if (4400 < m_unk0x1d6) { + ControlManager()->FUN_100293c0(0x10, m_atom, 0); + m_unk0x1d6 = 0; + } + } + + return 0; } // FUNCTION: LEGO1 0x10070c20 diff --git a/LEGO1/lego/legoomni/src/infocenter/infocenterdoor.cpp b/LEGO1/lego/legoomni/src/infocenter/infocenterdoor.cpp index 4c50a321..68555420 100644 --- a/LEGO1/lego/legoomni/src/infocenter/infocenterdoor.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/infocenterdoor.cpp @@ -1,24 +1,45 @@ #include "infocenterdoor.h" +#include "legocontrolmanager.h" +#include "legogamestate.h" #include "legoinputmanager.h" #include "legoomni.h" +#include "mxnotificationmanager.h" -// STUB: LEGO1 0x10037730 +// FUNCTION: LEGO1 0x10037730 InfocenterDoor::InfocenterDoor() { - // TODO + m_unk0xf8 = 0; + + NotificationManager()->Register(this); } -// STUB: LEGO1 0x100378f0 +// FUNCTION: LEGO1 0x100378f0 InfocenterDoor::~InfocenterDoor() { - // TODO + if (InputManager()->GetWorld() == this) { + InputManager()->ClearWorld(); + } + + ControlManager()->Unregister(this); + NotificationManager()->Unregister(this); } -// STUB: LEGO1 0x10037980 +// FUNCTION: LEGO1 0x10037980 MxResult InfocenterDoor::Create(MxDSAction& p_dsAction) { - return SUCCESS; + MxResult result = LegoWorld::Create(p_dsAction); + if (result == SUCCESS) { + InputManager()->SetWorld(this); + ControlManager()->Register(this); + } + + SetIsWorldActive(FALSE); + + GameState()->SetUnknown424(3); + GameState()->FUN_1003a720(0); + + return result; } // STUB: LEGO1 0x100379e0 @@ -52,8 +73,10 @@ void InfocenterDoor::VTable0x68(MxBool p_add) } } -// STUB: LEGO1 0x10037cd0 +// FUNCTION: LEGO1 0x10037cd0 MxBool InfocenterDoor::VTable0x64() { + DeleteObjects(&m_atom, 500, 510); + m_unk0xf8 = 2; return TRUE; } diff --git a/LEGO1/lego/legoomni/src/infocenter/infocenterstate.cpp b/LEGO1/lego/legoomni/src/infocenter/infocenterstate.cpp index 96e47c55..76ffd3ea 100644 --- a/LEGO1/lego/legoomni/src/infocenter/infocenterstate.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/infocenterstate.cpp @@ -2,15 +2,22 @@ DECOMP_SIZE_ASSERT(InfocenterState, 0x94); -// STUB: LEGO1 0x10071600 +// FUNCTION: LEGO1 0x10071600 InfocenterState::InfocenterState() { // TODO memset(m_buffer, 0, sizeof(m_buffer)); } -// STUB: LEGO1 0x10071920 +// FUNCTION: LEGO1 0x10071920 InfocenterState::~InfocenterState() { - // TODO + MxS16 i = 0; + do { + if (GetInfocenterBufferElement(i) != NULL) { + delete GetInfocenterBufferElement(i)->GetAction(); + delete GetInfocenterBufferElement(i); + } + i++; + } while (i < GetInfocenterBufferSize()); }