2023-06-29 04:10:08 -04:00
|
|
|
#include "infocenter.h"
|
|
|
|
|
2024-01-17 11:53:53 -05:00
|
|
|
#include "infocenterstate.h"
|
2024-01-20 12:41:22 -05:00
|
|
|
#include "jukebox.h"
|
2024-01-17 11:53:53 -05:00
|
|
|
#include "legocontrolmanager.h"
|
|
|
|
#include "legogamestate.h"
|
|
|
|
#include "legoinputmanager.h"
|
|
|
|
#include "legoomni.h"
|
|
|
|
#include "legoutil.h"
|
|
|
|
#include "legovideomanager.h"
|
|
|
|
#include "mxactionnotificationparam.h"
|
|
|
|
#include "mxbackgroundaudiomanager.h"
|
|
|
|
#include "mxnotificationmanager.h"
|
|
|
|
#include "mxstillpresenter.h"
|
2024-01-18 21:00:55 -05:00
|
|
|
#include "mxticklemanager.h"
|
2024-01-17 11:53:53 -05:00
|
|
|
#include "mxtransitionmanager.h"
|
|
|
|
|
|
|
|
DECOMP_SIZE_ASSERT(Infocenter, 0x1d8)
|
2024-01-21 12:38:22 -05:00
|
|
|
DECOMP_SIZE_ASSERT(InfocenterMapEntry, 0x18)
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f76a0
|
|
|
|
const char* g_object2x4red = "2x4red";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f76a4
|
|
|
|
const char* g_object2x4grn = "2x4grn";
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1006ea20
|
2023-06-29 04:10:08 -04:00
|
|
|
Infocenter::Infocenter()
|
|
|
|
{
|
2024-01-17 11:53:53 -05:00
|
|
|
m_unk0xfc = 0;
|
|
|
|
m_unk0x11c = 0;
|
|
|
|
m_infocenterState = NULL;
|
2024-01-21 12:38:22 -05:00
|
|
|
m_frameHotBitmap = 0;
|
2024-01-17 11:53:53 -05:00
|
|
|
m_unk0x11c = 0;
|
|
|
|
m_unk0x104 = 0;
|
|
|
|
m_currentInfomainScript = c_noInfomain;
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = e_noIntro;
|
2024-01-17 11:53:53 -05:00
|
|
|
|
2024-01-21 12:38:22 -05:00
|
|
|
memset(&m_mapAreas, 0, sizeof(m_mapAreas));
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
m_unk0x1c8 = -1;
|
|
|
|
SetAppCursor(1);
|
|
|
|
NotificationManager()->Register(this);
|
|
|
|
|
2024-01-20 09:24:54 -05:00
|
|
|
m_infoManDialogueTimer = 0;
|
|
|
|
m_bookAnimationTimer = 0;
|
2024-01-17 11:53:53 -05:00
|
|
|
m_unk0x1d4 = 0;
|
|
|
|
m_unk0x1d6 = 0;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2024-01-18 21:00:55 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006ec90
|
2023-06-29 04:10:08 -04:00
|
|
|
Infocenter::~Infocenter()
|
|
|
|
{
|
2024-01-18 21:00:55 -05:00
|
|
|
BackgroundAudioManager()->Stop();
|
|
|
|
|
|
|
|
MxS16 i = 0;
|
|
|
|
do {
|
|
|
|
if (m_infocenterState->GetInfocenterBufferElement(i) != NULL) {
|
|
|
|
m_infocenterState->GetInfocenterBufferElement(i)->Enable(FALSE);
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
} while (i < m_infocenterState->GetInfocenterBufferSize());
|
|
|
|
|
|
|
|
ControlManager()->Unregister(this);
|
|
|
|
|
|
|
|
InputManager()->UnRegister(this);
|
|
|
|
if (InputManager()->GetWorld() == this) {
|
|
|
|
InputManager()->ClearWorld();
|
|
|
|
}
|
|
|
|
|
|
|
|
NotificationManager()->Unregister(this);
|
|
|
|
|
|
|
|
TickleManager()->UnregisterClient(this);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2023-12-29 13:04:18 -05:00
|
|
|
// STUB: LEGO1 0x1006ed90
|
2024-01-13 15:00:11 -05:00
|
|
|
MxResult Infocenter::Create(MxDSAction& p_dsAction)
|
2023-12-29 13:04:18 -05:00
|
|
|
{
|
2024-01-17 11:53:53 -05:00
|
|
|
if (LegoWorld::Create(p_dsAction) == SUCCESS) {
|
|
|
|
InputManager()->SetWorld(this);
|
|
|
|
ControlManager()->Register(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
LegoGameState* gs = GameState();
|
|
|
|
m_infocenterState = (InfocenterState*) gs->GetState("InfocenterState");
|
|
|
|
if (!m_infocenterState) {
|
|
|
|
m_infocenterState = (InfocenterState*) gs->CreateState("InfocenterState");
|
|
|
|
m_infocenterState->SetUnknown0x74(3);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
InputManager()->Register(this);
|
|
|
|
SetIsWorldActive(FALSE);
|
|
|
|
return SUCCESS;
|
2023-12-29 13:04:18 -05:00
|
|
|
}
|
|
|
|
|
2024-01-17 11:53:53 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006ef10
|
2023-12-13 05:48:14 -05:00
|
|
|
MxLong Infocenter::Notify(MxParam& p_param)
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
2024-01-17 11:53:53 -05:00
|
|
|
MxLong result = 0;
|
|
|
|
LegoWorld::Notify(p_param);
|
|
|
|
|
|
|
|
if (m_worldStarted) {
|
|
|
|
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
|
|
|
case c_notificationType0:
|
|
|
|
result = HandleNotification0(p_param);
|
|
|
|
break;
|
|
|
|
case c_notificationEndAction:
|
|
|
|
result = HandleEndAction(p_param);
|
|
|
|
break;
|
|
|
|
case c_notificationKeyPress:
|
|
|
|
result = HandleKeyPress(((LegoEventNotificationParam&) p_param).GetKey());
|
|
|
|
break;
|
|
|
|
case c_notificationButtonUp:
|
|
|
|
result = HandleButtonUp(
|
|
|
|
((LegoEventNotificationParam&) p_param).GetX(),
|
|
|
|
((LegoEventNotificationParam&) p_param).GetY()
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
case c_notificationMouseMove:
|
|
|
|
result = HandleMouseMove(
|
|
|
|
((LegoEventNotificationParam&) p_param).GetX(),
|
|
|
|
((LegoEventNotificationParam&) p_param).GetY()
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
case c_notificationType17:
|
|
|
|
result = HandleNotification17(p_param);
|
|
|
|
break;
|
|
|
|
case c_notificationTransitioned:
|
|
|
|
StopBookAnimation();
|
2024-01-20 09:24:54 -05:00
|
|
|
m_bookAnimationTimer = 0;
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
if (m_infocenterState->GetUnknown0x74() == 0xc) {
|
|
|
|
StartCredits();
|
|
|
|
m_infocenterState->SetUnknown0x74(0xd);
|
|
|
|
}
|
|
|
|
else if (m_unk0x104 != 0) {
|
|
|
|
BackgroundAudioManager()->RaiseVolume();
|
|
|
|
GameState()->HandleAction(m_unk0x104);
|
|
|
|
m_unk0x104 = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1006f080
|
|
|
|
MxLong Infocenter::HandleEndAction(MxParam& p_param)
|
|
|
|
{
|
|
|
|
MxDSAction* action = ((MxEndActionNotificationParam&) p_param).GetAction();
|
|
|
|
if (action->GetAtomId() == *g_creditsScript && action->GetObjectId() == 499) {
|
|
|
|
Lego()->CloseMainWindow();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (action->GetAtomId() == m_atom &&
|
|
|
|
(action->GetObjectId() == 40 || action->GetObjectId() == 41 || action->GetObjectId() == 42 ||
|
|
|
|
action->GetObjectId() == 43 || action->GetObjectId() == 44)) {
|
|
|
|
if (m_unk0x1d4) {
|
|
|
|
m_unk0x1d4--;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!m_unk0x1d4) {
|
2024-01-20 12:41:22 -05:00
|
|
|
PlayMusic(JukeBox::e_informationCenter);
|
2024-01-17 11:53:53 -05:00
|
|
|
GameState()->FUN_10039780(m_unk0xfc);
|
|
|
|
|
|
|
|
switch (m_unk0xfc) {
|
|
|
|
case 1:
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_pepperCharacterSelect);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
case 2:
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_mamaCharacterSelect);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
case 3:
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_papaCharacterSelect);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
case 4:
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_nickCharacterSelect);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
case 5:
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_lauraCharacterSelect);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
FUN_10070dc0(TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MxLong result = m_radio.Notify(p_param);
|
|
|
|
|
|
|
|
if (result || (action->GetAtomId() != m_atom && action->GetAtomId() != *g_introScript))
|
|
|
|
return result;
|
|
|
|
|
2024-01-17 14:08:05 -05:00
|
|
|
if (action->GetObjectId() == c_returnBackGuidanceDialogue2) {
|
2024-01-20 09:24:54 -05:00
|
|
|
ControlManager()->FUN_100293c0(0x10, action->GetAtomId().GetInternal(), 0);
|
2024-01-17 11:53:53 -05:00
|
|
|
m_unk0x1d6 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (m_infocenterState->GetUnknown0x74()) {
|
|
|
|
case 0:
|
2024-01-17 11:56:41 -05:00
|
|
|
switch (m_currentCutscene) {
|
2024-01-17 11:53:53 -05:00
|
|
|
case e_legoMovie:
|
|
|
|
PlayCutscene(e_mindscapeMovie, FALSE);
|
|
|
|
return 1;
|
|
|
|
case e_mindscapeMovie:
|
|
|
|
PlayCutscene(e_introMovie, TRUE);
|
|
|
|
return 1;
|
|
|
|
case e_badEndMovie:
|
|
|
|
StopCutscene();
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_badEndingDialogue);
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = e_noIntro;
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
case e_goodEndMovie:
|
|
|
|
StopCutscene();
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_goodEndingDialogue);
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = e_noIntro;
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// default / 2nd case probably?
|
|
|
|
StopCutscene();
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_welcomeDialogue);
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = e_noIntro;
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
|
2024-01-20 09:24:54 -05:00
|
|
|
m_bookAnimationTimer = 1;
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
|
|
|
|
2024-01-17 11:56:41 -05:00
|
|
|
switch (m_currentCutscene) {
|
2024-01-17 11:53:53 -05:00
|
|
|
case e_badEndMovie:
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_badEndingDialogue);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
case e_goodEndMovie:
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_goodEndingDialogue);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
default:
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_welcomeDialogue);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = e_noIntro;
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
case 2:
|
|
|
|
FUN_10015860(g_object2x4red, 0);
|
|
|
|
FUN_10015860(g_object2x4grn, 0);
|
|
|
|
BackgroundAudioManager()->RaiseVolume();
|
|
|
|
return 1;
|
|
|
|
case 4:
|
|
|
|
if (action->GetObjectId() == 70 || action->GetObjectId() == 71) {
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
|
|
|
m_infocenterState->SetUnknown0x74(14);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
if (action->GetObjectId() == m_currentInfomainScript) {
|
|
|
|
if (GameState()->GetUnknown10() != 2 && m_unk0xfc != 0) {
|
|
|
|
GameState()->FUN_10039780(m_unk0xfc);
|
|
|
|
}
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
|
|
|
m_infocenterState->SetUnknown0x74(14);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 11:
|
|
|
|
if (m_infocenterState->GetInfocenterBufferElement(0) == 0 && m_currentInfomainScript != 40 &&
|
|
|
|
m_currentInfomainScript != 41 && m_currentInfomainScript != 42 && m_currentInfomainScript != 43 &&
|
|
|
|
m_currentInfomainScript != 44) {
|
2024-01-20 09:24:54 -05:00
|
|
|
m_infoManDialogueTimer = 1;
|
2024-01-20 12:41:22 -05:00
|
|
|
PlayMusic(JukeBox::e_informationCenter);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
|
|
|
FUN_10015860("infoman", 1);
|
|
|
|
return 1;
|
|
|
|
case 12:
|
|
|
|
if (action->GetObjectId() == m_currentInfomainScript) {
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
result = 1;
|
|
|
|
|
|
|
|
return result;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2023-12-29 13:04:18 -05:00
|
|
|
// STUB: LEGO1 0x1006f4e0
|
2024-01-12 17:27:07 -05:00
|
|
|
void Infocenter::VTable0x50()
|
2023-12-29 13:04:18 -05:00
|
|
|
{
|
2024-01-20 09:24:54 -05:00
|
|
|
m_infoManDialogueTimer = 0;
|
|
|
|
m_bookAnimationTimer = 0;
|
2024-01-17 11:53:53 -05:00
|
|
|
m_unk0x1d4 = 0;
|
|
|
|
m_unk0x1d6 = 0;
|
|
|
|
|
|
|
|
MxStillPresenter* bg = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Background_Bitmap");
|
|
|
|
MxStillPresenter* bgRed = (MxStillPresenter*) FindPresenter("MxStillPresenter", "BackgroundRed_Bitmap");
|
|
|
|
|
|
|
|
switch (GameState()->GetUnknown10()) {
|
|
|
|
case 0:
|
2024-01-21 12:38:22 -05:00
|
|
|
bg->Enable(1);
|
2024-01-17 11:53:53 -05:00
|
|
|
InitializeBitmaps();
|
|
|
|
switch (m_infocenterState->GetUnknown0x74()) {
|
|
|
|
case 3:
|
|
|
|
PlayCutscene(e_legoMovie, TRUE);
|
|
|
|
m_infocenterState->SetUnknown0x74(0);
|
|
|
|
return;
|
|
|
|
case 4:
|
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
|
|
|
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
|
2024-01-20 09:24:54 -05:00
|
|
|
m_bookAnimationTimer = 1;
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_letsGetStartedDialogue);
|
2024-01-20 12:41:22 -05:00
|
|
|
PlayMusic(JukeBox::e_informationCenter);
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-01-17 11:53:53 -05:00
|
|
|
return;
|
|
|
|
default:
|
2024-01-20 12:41:22 -05:00
|
|
|
PlayMusic(JukeBox::e_informationCenter);
|
2024-01-17 11:53:53 -05:00
|
|
|
// TODO
|
|
|
|
break;
|
|
|
|
case 8:
|
2024-01-20 12:41:22 -05:00
|
|
|
PlayMusic(JukeBox::e_informationCenter);
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_exitConfirmationDialogue);
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-01-17 11:53:53 -05:00
|
|
|
return;
|
|
|
|
case 0xf:
|
|
|
|
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
|
2024-01-20 09:24:54 -05:00
|
|
|
m_bookAnimationTimer = 1;
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-01-18 14:04:50 -05:00
|
|
|
PlayAction(c_clickOnInfomanDialogue);
|
2024-01-20 12:41:22 -05:00
|
|
|
PlayMusic(JukeBox::e_informationCenter);
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-01-17 11:53:53 -05:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
// TODO
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
// TODO
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-01-17 11:53:53 -05:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-21 12:38:22 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006f9a0
|
2024-01-17 11:53:53 -05:00
|
|
|
void Infocenter::InitializeBitmaps()
|
|
|
|
{
|
2024-01-21 12:38:22 -05:00
|
|
|
m_radio.Initialize(TRUE);
|
|
|
|
|
2024-01-26 12:03:29 -05:00
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_leftArrowCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_rightArrowCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_infoCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_boatCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_raceCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_pizzaCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_gasCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_medCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_copCtl))->Enable(TRUE);
|
|
|
|
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_mamaCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_papaCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_pepperCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_nickCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_lauraCtl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) FUN_10021790(m_atom, c_radioCtl))->Enable(TRUE);
|
2024-01-21 12:38:22 -05:00
|
|
|
|
|
|
|
m_mapAreas[0].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Info_A_Bitmap");
|
|
|
|
m_mapAreas[0].m_unk0x08 = 391;
|
|
|
|
m_mapAreas[0].m_unk0x0c = 182;
|
|
|
|
m_mapAreas[0].m_unk0x10 = 427;
|
|
|
|
m_mapAreas[0].m_unk0x14 = 230;
|
|
|
|
m_mapAreas[0].m_unk0x04 = 3;
|
|
|
|
|
|
|
|
m_mapAreas[1].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Boat_A_Bitmap");
|
|
|
|
m_mapAreas[1].m_unk0x08 = 304;
|
|
|
|
m_mapAreas[1].m_unk0x0c = 225;
|
|
|
|
m_mapAreas[1].m_unk0x10 = 350;
|
|
|
|
m_mapAreas[1].m_unk0x14 = 268;
|
|
|
|
m_mapAreas[1].m_unk0x04 = 10;
|
|
|
|
|
|
|
|
m_mapAreas[2].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Race_A_Bitmap");
|
|
|
|
m_mapAreas[2].m_unk0x08 = 301;
|
|
|
|
m_mapAreas[2].m_unk0x0c = 133;
|
|
|
|
m_mapAreas[2].m_unk0x10 = 347;
|
|
|
|
m_mapAreas[2].m_unk0x14 = 181;
|
|
|
|
m_mapAreas[2].m_unk0x04 = 11;
|
|
|
|
|
|
|
|
m_mapAreas[3].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Pizza_A_Bitmap");
|
|
|
|
m_mapAreas[3].m_unk0x08 = 289;
|
|
|
|
m_mapAreas[3].m_unk0x0c = 182;
|
|
|
|
m_mapAreas[3].m_unk0x10 = 335;
|
|
|
|
m_mapAreas[3].m_unk0x14 = 225;
|
|
|
|
m_mapAreas[3].m_unk0x04 = 12;
|
|
|
|
|
|
|
|
m_mapAreas[4].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Gas_A_Bitmap");
|
|
|
|
m_mapAreas[4].m_unk0x10 = 391;
|
|
|
|
m_mapAreas[4].m_unk0x08 = 350;
|
|
|
|
m_mapAreas[4].m_unk0x0c = 161;
|
|
|
|
m_mapAreas[4].m_unk0x14 = 209;
|
|
|
|
m_mapAreas[4].m_unk0x04 = 13;
|
|
|
|
|
|
|
|
m_mapAreas[5].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Med_A_Bitmap");
|
|
|
|
m_mapAreas[5].m_unk0x08 = 392;
|
|
|
|
m_mapAreas[5].m_unk0x0c = 130;
|
|
|
|
m_mapAreas[5].m_unk0x10 = 438;
|
|
|
|
m_mapAreas[5].m_unk0x14 = 176;
|
|
|
|
m_mapAreas[5].m_unk0x04 = 14;
|
|
|
|
|
|
|
|
m_mapAreas[6].m_presenter = (MxStillPresenter*) FindPresenter("MxStillPresenter", "Cop_A_Bitmap");
|
|
|
|
m_mapAreas[6].m_unk0x08 = 396;
|
|
|
|
m_mapAreas[6].m_unk0x0c = 229;
|
|
|
|
m_mapAreas[6].m_unk0x10 = 442;
|
|
|
|
m_mapAreas[6].m_unk0x14 = 272;
|
|
|
|
m_mapAreas[6].m_unk0x04 = 15;
|
|
|
|
|
|
|
|
m_frameHotBitmap = (MxStillPresenter*) FindPresenter("MxStillPresenter", "FrameHot_Bitmap");
|
|
|
|
|
|
|
|
FUN_10070dc0(TRUE);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1006fd00
|
|
|
|
MxU8 Infocenter::HandleMouseMove(MxS32 p_x, MxS32 p_y)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1006fda0
|
|
|
|
MxLong Infocenter::HandleKeyPress(MxS8 p_key)
|
|
|
|
{
|
|
|
|
MxLong result = 0;
|
|
|
|
|
|
|
|
if (p_key == ' ' && m_worldStarted) {
|
|
|
|
switch (m_infocenterState->GetUnknown0x74()) {
|
|
|
|
case 0:
|
|
|
|
StopCutscene();
|
|
|
|
m_infocenterState->SetUnknown0x74(1);
|
|
|
|
|
|
|
|
if (m_infocenterState->GetInfocenterBufferElement(0) == 0) {
|
2024-01-20 09:24:54 -05:00
|
|
|
m_bookAnimationTimer = 1;
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
case 4:
|
|
|
|
break;
|
|
|
|
default: {
|
|
|
|
InfomainScript script = m_currentInfomainScript;
|
2024-01-18 14:04:50 -05:00
|
|
|
StopCurrentAction();
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
switch (m_infocenterState->GetUnknown0x74()) {
|
|
|
|
case 5:
|
|
|
|
case 12:
|
|
|
|
m_currentInfomainScript = script;
|
|
|
|
return 1;
|
|
|
|
default:
|
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
|
|
|
return 1;
|
|
|
|
case 8:
|
|
|
|
case 11:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 13:
|
|
|
|
StopCredits();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
2023-12-29 13:04:18 -05:00
|
|
|
}
|
|
|
|
|
2024-01-17 11:53:53 -05:00
|
|
|
// STUB: LEGO1 0x1006feb0
|
|
|
|
MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10070370
|
|
|
|
MxU8 Infocenter::HandleNotification17(MxParam&)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10070870
|
|
|
|
MxLong Infocenter::HandleNotification0(MxParam&)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10070aa0
|
2023-12-29 13:04:18 -05:00
|
|
|
void Infocenter::VTable0x68(MxBool p_add)
|
|
|
|
{
|
2024-01-17 11:53:53 -05:00
|
|
|
LegoWorld::VTable0x68(p_add);
|
|
|
|
|
|
|
|
if (p_add) {
|
|
|
|
InputManager()->SetWorld(this);
|
|
|
|
SetIsWorldActive(FALSE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (InputManager()->GetWorld() == this) {
|
|
|
|
InputManager()->ClearWorld();
|
|
|
|
}
|
|
|
|
}
|
2023-12-29 13:04:18 -05:00
|
|
|
}
|
|
|
|
|
2024-01-20 09:24:54 -05:00
|
|
|
// FUNCTION: LEGO1 0x10070af0
|
2023-09-21 14:51:24 -04:00
|
|
|
MxResult Infocenter::Tickle()
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
2024-01-20 09:24:54 -05:00
|
|
|
if (m_worldStarted == FALSE) {
|
|
|
|
LegoWorld::Tickle();
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
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.GetInternal(), 1);
|
|
|
|
}
|
|
|
|
else if (m_unk0x1d6 > 3650 && m_unk0x1d6 < 3900) {
|
|
|
|
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 0);
|
|
|
|
}
|
|
|
|
else if (m_unk0x1d6 > 3900 && m_unk0x1d6 < 4150) {
|
|
|
|
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 1);
|
|
|
|
}
|
|
|
|
else if (m_unk0x1d6 > 4400) {
|
|
|
|
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 0);
|
|
|
|
m_unk0x1d6 = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return SUCCESS;
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10070c20
|
2024-01-17 11:56:41 -05:00
|
|
|
void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = p_entityId;
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
VideoManager()->EnableFullScreenMovie(TRUE, p_scale);
|
|
|
|
InputManager()->SetUnknown336(TRUE);
|
|
|
|
InputManager()->SetUnknown335(TRUE);
|
|
|
|
SetAppCursor(0xb); // Hide cursor
|
|
|
|
VideoManager()->GetDisplaySurface()->ClearScreen();
|
|
|
|
|
2024-01-17 11:56:41 -05:00
|
|
|
if (m_currentCutscene != e_noIntro) {
|
2024-01-17 11:53:53 -05:00
|
|
|
// check if the cutscene is not an ending
|
2024-01-17 11:56:41 -05:00
|
|
|
if (m_currentCutscene >= e_badEndMovie && m_currentCutscene <= e_goodEndMovie) {
|
2024-01-17 11:53:53 -05:00
|
|
|
FUN_10070e90();
|
|
|
|
}
|
2024-01-17 11:56:41 -05:00
|
|
|
InvokeAction(Extra::ActionType::e_opendisk, *g_introScript, m_currentCutscene, NULL);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10070cb0
|
|
|
|
void Infocenter::StopCutscene()
|
|
|
|
{
|
2024-01-17 11:56:41 -05:00
|
|
|
if (m_currentCutscene != e_noIntro) {
|
|
|
|
InvokeAction(Extra::ActionType::e_close, *g_introScript, m_currentCutscene, NULL);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
VideoManager()->EnableFullScreenMovie(FALSE);
|
|
|
|
InputManager()->SetUnknown335(FALSE);
|
|
|
|
SetAppCursor(0); // Restore cursor to arrow
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2023-12-29 13:04:18 -05:00
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10070d00
|
|
|
|
MxBool Infocenter::VTable0x5c()
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2024-01-17 11:53:53 -05:00
|
|
|
// STUB: LEGO1 0x10070dc0
|
|
|
|
void Infocenter::FUN_10070dc0(MxBool)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10070e90
|
|
|
|
void Infocenter::FUN_10070e90()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-12-29 13:04:18 -05:00
|
|
|
// STUB: LEGO1 0x10070f60
|
|
|
|
MxBool Infocenter::VTable0x64()
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
// STUB: LEGO1 0x10071030
|
|
|
|
void Infocenter::StartCredits()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10071250
|
|
|
|
void Infocenter::StopCredits()
|
|
|
|
{
|
|
|
|
MxDSAction action;
|
|
|
|
action.SetObjectId(499);
|
|
|
|
action.SetAtomId(*g_creditsScript);
|
|
|
|
action.SetUnknown24(-2);
|
|
|
|
DeleteObject(action);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10071300
|
2024-01-18 14:04:50 -05:00
|
|
|
void Infocenter::PlayAction(InfomainScript p_objectId)
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
|
|
|
MxDSAction action;
|
|
|
|
action.SetObjectId(p_objectId);
|
|
|
|
action.SetAtomId(*g_infomainScript);
|
2024-01-18 14:04:50 -05:00
|
|
|
StopCurrentAction();
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
m_currentInfomainScript = p_objectId;
|
|
|
|
BackgroundAudioManager()->LowerVolume();
|
|
|
|
Start(&action);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100713d0
|
2024-01-18 14:04:50 -05:00
|
|
|
void Infocenter::StopCurrentAction()
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
|
|
|
if (m_currentInfomainScript != c_noInfomain) {
|
|
|
|
MxDSAction action;
|
|
|
|
action.SetObjectId(m_currentInfomainScript);
|
|
|
|
action.SetAtomId(*g_infomainScript);
|
|
|
|
action.SetUnknown24(-2);
|
|
|
|
DeleteObject(action);
|
|
|
|
m_currentInfomainScript = c_noInfomain;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100714a0
|
|
|
|
void Infocenter::PlayBookAnimation()
|
|
|
|
{
|
|
|
|
MxDSAction action;
|
|
|
|
action.SetObjectId(c_bookWig);
|
|
|
|
action.SetAtomId(*g_sndAnimScript);
|
|
|
|
Start(&action);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10071550
|
|
|
|
void Infocenter::StopBookAnimation()
|
|
|
|
{
|
|
|
|
MxDSAction action;
|
|
|
|
action.SetObjectId(c_bookWig);
|
|
|
|
action.SetAtomId(*g_sndAnimScript);
|
|
|
|
action.SetUnknown24(-2);
|
|
|
|
DeleteObject(action);
|
|
|
|
}
|