1
0
Fork 0
mirror of https://github.com/isledecomp/isle.git synced 2025-03-25 22:19:52 -04:00

Implement Infocenter::ReadyWorld ()

* Implement Infocenter::ReadyWorld

* Match

* Use TRUE
This commit is contained in:
Christian Semmler 2024-02-07 15:23:35 -05:00 committed by GitHub
parent 5e38a010dd
commit 97de164a7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 153 additions and 25 deletions

View file

@ -27,9 +27,10 @@ public:
// SYNTHETIC: LEGO1 0x1000e3c0
// Act3State::`scalar deleting destructor'
inline undefined4 GetUnknown0x08() { return m_unk0x08; }
private:
// FIXME: May be part of LegoState? Uncertain...
MxU32 m_unk0x08;
undefined4 m_unk0x08; // 0x08
};
#endif // ACT3STATE_H

View file

@ -34,6 +34,7 @@ public:
inline Playlist& GetUnknown0x14() { return m_unk0x14; }
inline Playlist& GetUnknown0x68() { return m_unk0x68; }
inline MxU32 GetUnknown0x74() { return m_unk0x74; }
inline Playlist* GetUnknown0x20() { return m_unk0x20; }
inline Playlist* GetUnknown0x44() { return m_unk0x44; }
inline void SetUnknown0x74(MxU32 p_unk0x74) { m_unk0x74 = p_unk0x74; }

View file

@ -26,6 +26,12 @@ public:
// SYNTHETIC: LEGO1 0x1000e040
// LegoAct2State::`scalar deleting destructor'
inline undefined4 GetUnknown0x08() { return m_unk0x08; }
private:
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
};
#endif // LEGOACT2STATE_H

View file

@ -1,5 +1,7 @@
#include "legoact2state.h"
DECOMP_SIZE_ASSERT(LegoAct2State, 0x10)
// FUNCTION: LEGO1 0x1000df70
MxBool LegoAct2State::VTable0x14()
{

View file

@ -1,8 +1,10 @@
#include "infocenter.h"
#include "act3state.h"
#include "helicopterstate.h"
#include "infocenterstate.h"
#include "jukebox.h"
#include "legoact2state.h"
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legocontrolmanager.h"
@ -265,7 +267,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
PlayAction(c_welcomeDialogue);
m_currentCutscene = e_noIntro;
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
if (m_infocenterState->GetInfocenterBufferElement(0) == NULL) {
m_bookAnimationTimer = 1;
return 1;
}
@ -309,7 +311,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
}
break;
case 11:
if (m_infocenterState->GetInfocenterBufferElement(0) == 0 && m_currentInfomainScript != 40 &&
if (m_infocenterState->GetInfocenterBufferElement(0) == NULL && m_currentInfomainScript != 40 &&
m_currentInfomainScript != 41 && m_currentInfomainScript != 42 && m_currentInfomainScript != 43 &&
m_currentInfomainScript != 44) {
m_infoManDialogueTimer = 1;
@ -330,7 +332,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
return result;
}
// STUB: LEGO1 0x1006f4e0
// FUNCTION: LEGO1 0x1006f4e0
void Infocenter::ReadyWorld()
{
m_infoManDialogueTimer = 0;
@ -343,54 +345,170 @@ void Infocenter::ReadyWorld()
switch (GameState()->GetUnknown10()) {
case 0:
bg->Enable(1);
bg->Enable(TRUE);
InitializeBitmaps();
switch (m_infocenterState->GetUnknown0x74()) {
case 3:
PlayCutscene(e_legoMovie, TRUE);
m_infocenterState->SetUnknown0x74(0);
return;
break;
case 4:
m_infocenterState->SetUnknown0x74(2);
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
if (m_infocenterState->GetInfocenterBufferElement(0) == NULL) {
m_bookAnimationTimer = 1;
}
PlayAction(c_letsGetStartedDialogue);
PlayMusic(JukeBox::e_informationCenter);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
return;
default:
PlayMusic(JukeBox::e_informationCenter);
// TODO
break;
case 5:
default: {
PlayMusic(JukeBox::e_informationCenter);
InfomainScript script =
(InfomainScript) m_infocenterState->GetUnknown0x20()[GameState()->GetUnknown10()].Next();
PlayAction(script);
if (script == c_returnBackGuidanceDialogue2) {
m_unk0x1d6 = 1;
}
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
if (m_infocenterState->GetInfocenterBufferElement(0) == NULL) {
m_bookAnimationTimer = 1;
}
m_infocenterState->SetUnknown0x74(11);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
break;
}
case 8:
PlayMusic(JukeBox::e_informationCenter);
PlayAction(c_exitConfirmationDialogue);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
return;
break;
case 0xf:
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
m_infocenterState->SetUnknown0x74(2);
if (m_infocenterState->GetInfocenterBufferElement(0) == NULL) {
m_bookAnimationTimer = 1;
}
PlayAction(c_clickOnInfomanDialogue);
PlayMusic(JukeBox::e_informationCenter);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
break;
}
return;
case 1: {
if (m_infocenterState->GetUnknown0x74() == 8) {
PlayMusic(JukeBox::e_informationCenter);
bgRed->Enable(TRUE);
PlayAction(c_exitConfirmationDialogue);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
return;
}
LegoAct2State* state = (LegoAct2State*) GameState()->GetState("LegoAct2State");
GameState()->FUN_1003ceb0();
if (state && state->GetUnknown0x08() == 0x68) {
bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE);
m_infocenterState->SetUnknown0x74(0);
return;
}
if (m_infocenterState->GetUnknown0x74() == 4) {
bgRed->Enable(TRUE);
if (GameState()->GetUnknown10() == GameState()->GetCurrentAct()) {
GameState()->SetCurrentArea(0x2e);
GameState()->StopArea(0x2e);
GameState()->SetCurrentArea(0x02);
}
m_infocenterState->SetUnknown0x74(5);
m_transitionDestination = 0x2e;
InfomainScript script =
(InfomainScript) m_infocenterState->GetUnknown0x20()[GameState()->GetUnknown10()].Next();
PlayAction(script);
InputManager()->DisableInputProcessing();
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
return;
}
PlayMusic(JukeBox::e_informationCenter);
InfomainScript script =
(InfomainScript) m_infocenterState->GetUnknown0x20()[GameState()->GetUnknown10()].Next();
PlayAction(script);
bgRed->Enable(TRUE);
break;
case 1:
// TODO
break;
case 2:
// TODO
break;
default:
m_infocenterState->SetUnknown0x74(11);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
return;
}
case 2: {
if (m_infocenterState->GetUnknown0x74() == 8) {
PlayMusic(JukeBox::e_informationCenter);
bgRed->Enable(TRUE);
PlayAction(c_exitConfirmationDialogue);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
return;
}
Act3State* state = (Act3State*) GameState()->GetState("Act3State");
GameState()->FUN_1003ceb0();
if (state) {
if (state->GetUnknown0x08() == 3) {
bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE);
m_infocenterState->SetUnknown0x74(0);
return;
}
if (state && state->GetUnknown0x08() == 2) {
bg->Enable(TRUE);
PlayCutscene(e_goodEndMovie, TRUE);
m_infocenterState->SetUnknown0x74(0);
return;
}
}
if (m_infocenterState->GetUnknown0x74() == 4) {
bgRed->Enable(TRUE);
if (GameState()->GetUnknown10() == GameState()->GetCurrentAct()) {
GameState()->SetCurrentArea(0x2f);
GameState()->StopArea(0x2f);
GameState()->SetCurrentArea(0x02);
}
m_infocenterState->SetUnknown0x74(5);
m_transitionDestination = 0x2f;
InfomainScript script =
(InfomainScript) m_infocenterState->GetUnknown0x20()[GameState()->GetUnknown10()].Next();
PlayAction(script);
InputManager()->DisableInputProcessing();
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
return;
}
PlayMusic(JukeBox::e_informationCenter);
InfomainScript script =
(InfomainScript) m_infocenterState->GetUnknown0x20()[GameState()->GetUnknown10()].Next();
PlayAction(script);
bgRed->Enable(TRUE);
break;
}
}
m_infocenterState->SetUnknown0x74(11);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
}
// FUNCTION: LEGO1 0x1006f9a0
@ -504,7 +622,7 @@ MxLong Infocenter::HandleKeyPress(MxS8 p_key)
StopCutscene();
m_infocenterState->SetUnknown0x74(1);
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
if (m_infocenterState->GetInfocenterBufferElement(0) == NULL) {
m_bookAnimationTimer = 1;
return 1;
}