mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-02-16 19:50:52 -05:00
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:
parent
bad32149ca
commit
9e0b19856c
20 changed files with 486 additions and 118 deletions
|
@ -27,9 +27,12 @@ public:
|
||||||
|
|
||||||
inline void SetUnknown18(MxU32 p_unk0x18) { m_unk0x18 = p_unk0x18; }
|
inline void SetUnknown18(MxU32 p_unk0x18) { m_unk0x18 = p_unk0x18; }
|
||||||
inline MxU32 GetUnknown18() { return m_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 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();
|
void FUN_10034d00();
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10033960
|
// SYNTHETIC: LEGO1 0x10033960
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "legoworld.h"
|
#include "legoworld.h"
|
||||||
|
|
||||||
|
class LegoControlManagerEvent;
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100d5f20
|
// VTABLE: LEGO1 0x100d5f20
|
||||||
// SIZE: 0xfc (from inlined ctor at 0x1000a8aa)
|
// SIZE: 0xfc (from inlined ctor at 0x1000a8aa)
|
||||||
class ElevatorBottom : public LegoWorld {
|
class ElevatorBottom : public LegoWorld {
|
||||||
|
@ -41,7 +43,7 @@ public:
|
||||||
private:
|
private:
|
||||||
undefined4 m_unk0xf8; // 0xf8
|
undefined4 m_unk0xf8; // 0xf8
|
||||||
|
|
||||||
MxLong HandleNotification17(MxParam& p_param);
|
MxLong HandleClick(LegoControlManagerEvent& p_param);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ELEVATORBOTTOM_H
|
#endif // ELEVATORBOTTOM_H
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
#define INFOCENTER_H
|
#define INFOCENTER_H
|
||||||
|
|
||||||
#include "legoworld.h"
|
#include "legoworld.h"
|
||||||
|
#include "mxrect32.h"
|
||||||
#include "radio.h"
|
#include "radio.h"
|
||||||
|
|
||||||
class InfocenterState;
|
class InfocenterState;
|
||||||
class MxStillPresenter;
|
class MxStillPresenter;
|
||||||
|
class LegoControlManagerEvent;
|
||||||
|
|
||||||
// SIZE 0x18
|
// SIZE 0x18
|
||||||
struct InfocenterMapEntry {
|
struct InfocenterMapEntry {
|
||||||
|
@ -14,10 +16,7 @@ struct InfocenterMapEntry {
|
||||||
|
|
||||||
MxStillPresenter* m_presenter; // 0x00
|
MxStillPresenter* m_presenter; // 0x00
|
||||||
undefined4 m_unk0x04; // 0x04
|
undefined4 m_unk0x04; // 0x04
|
||||||
undefined4 m_unk0x08; // 0x08
|
MxRect32 m_area; // 0x08
|
||||||
undefined4 m_unk0x0c; // 0x0c
|
|
||||||
undefined4 m_unk0x10; // 0x10
|
|
||||||
undefined4 m_unk0x14; // 0x14
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100d9338
|
// VTABLE: LEGO1 0x100d9338
|
||||||
|
@ -40,12 +39,15 @@ public:
|
||||||
c_leftArrowCtl = 1,
|
c_leftArrowCtl = 1,
|
||||||
c_rightArrowCtl = 2,
|
c_rightArrowCtl = 2,
|
||||||
c_infoCtl = 3,
|
c_infoCtl = 3,
|
||||||
|
c_doorCtl = 4,
|
||||||
c_boatCtl = 10,
|
c_boatCtl = 10,
|
||||||
c_raceCtl = 11,
|
c_raceCtl = 11,
|
||||||
c_pizzaCtl = 12,
|
c_pizzaCtl = 12,
|
||||||
c_gasCtl = 13,
|
c_gasCtl = 13,
|
||||||
c_medCtl = 14,
|
c_medCtl = 14,
|
||||||
c_copCtl = 15,
|
c_copCtl = 15,
|
||||||
|
c_bigInfoCtl = 16,
|
||||||
|
c_bookCtl = 17,
|
||||||
c_radioCtl = 18,
|
c_radioCtl = 18,
|
||||||
c_mamaCtl = 21,
|
c_mamaCtl = 21,
|
||||||
c_papaCtl = 22,
|
c_papaCtl = 22,
|
||||||
|
@ -53,6 +55,15 @@ public:
|
||||||
c_nickCtl = 24,
|
c_nickCtl = 24,
|
||||||
c_lauraCtl = 25,
|
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_welcomeDialogue = 500,
|
||||||
c_goodJobDialogue = 501,
|
c_goodJobDialogue = 501,
|
||||||
|
|
||||||
|
@ -114,6 +125,13 @@ public:
|
||||||
c_noCDDialogueUnused1 = 552,
|
c_noCDDialogueUnused1 = 552,
|
||||||
c_noCDDialogueUnused2 = 553,
|
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_leaveInfoCenterDialogue1 = 562,
|
||||||
c_leaveInfoCenterDialogue2 = 563,
|
c_leaveInfoCenterDialogue2 = 563,
|
||||||
c_leaveInfoCenterDialogue3 = 564,
|
c_leaveInfoCenterDialogue3 = 564,
|
||||||
|
@ -163,16 +181,18 @@ private:
|
||||||
MxLong HandleKeyPress(MxS8 p_key);
|
MxLong HandleKeyPress(MxS8 p_key);
|
||||||
MxU8 HandleMouseMove(MxS32 p_x, MxS32 p_y);
|
MxU8 HandleMouseMove(MxS32 p_x, MxS32 p_y);
|
||||||
MxU8 HandleButtonUp(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 HandleEndAction(MxParam& p_param);
|
||||||
MxLong HandleNotification0(MxParam&);
|
MxLong HandleNotification0(MxParam&);
|
||||||
|
|
||||||
void FUN_10070dc0(MxBool);
|
void UpdateFrameHot(MxBool p_display);
|
||||||
void FUN_10070e90();
|
void FUN_10070e90();
|
||||||
|
|
||||||
void PlayCutscene(Cutscene p_entityId, MxBool p_scale);
|
void PlayCutscene(Cutscene p_entityId, MxBool p_scale);
|
||||||
void StopCutscene();
|
void StopCutscene();
|
||||||
|
|
||||||
|
void FUN_10070d10(MxS32 p_x, MxS32 p_y);
|
||||||
|
|
||||||
void StartCredits();
|
void StartCredits();
|
||||||
void StopCredits();
|
void StopCredits();
|
||||||
|
|
||||||
|
@ -185,10 +205,10 @@ private:
|
||||||
InfomainScript m_currentInfomainScript; // 0xf8
|
InfomainScript m_currentInfomainScript; // 0xf8
|
||||||
MxS16 m_unk0xfc; // 0xfc
|
MxS16 m_unk0xfc; // 0xfc
|
||||||
InfocenterState* m_infocenterState; // 0x100
|
InfocenterState* m_infocenterState; // 0x100
|
||||||
undefined4 m_unk0x104; // 0x104
|
undefined4 m_transitionDestination; // 0x104
|
||||||
Cutscene m_currentCutscene; // 0x108
|
Cutscene m_currentCutscene; // 0x108
|
||||||
Radio m_radio; // 0x10c
|
Radio m_radio; // 0x10c
|
||||||
undefined4 m_unk0x11c; // 0x11c
|
MxStillPresenter* m_unk0x11c; // 0x11c
|
||||||
InfocenterMapEntry m_mapAreas[7]; // 0x120
|
InfocenterMapEntry m_mapAreas[7]; // 0x120
|
||||||
MxS16 m_unk0x1c8; // 0x1c8
|
MxS16 m_unk0x1c8; // 0x1c8
|
||||||
MxStillPresenter* m_frameHotBitmap; // 0x1cc
|
MxStillPresenter* m_frameHotBitmap; // 0x1cc
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include "legoworld.h"
|
#include "legoworld.h"
|
||||||
|
|
||||||
|
class LegoControlManagerEvent;
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100d72d8
|
// VTABLE: LEGO1 0x100d72d8
|
||||||
// SIZE 0xfc
|
// SIZE 0xfc
|
||||||
class InfocenterDoor : public LegoWorld {
|
class InfocenterDoor : public LegoWorld {
|
||||||
|
@ -39,6 +41,8 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MxS32 m_unk0xf8; // 0xf8
|
MxS32 m_unk0xf8; // 0xf8
|
||||||
|
|
||||||
|
MxLong HandleClick(LegoControlManagerEvent& p_param);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INFOCENTERDOOR_H
|
#endif // INFOCENTERDOOR_H
|
||||||
|
|
|
@ -30,6 +30,7 @@ public:
|
||||||
|
|
||||||
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 @@ public:
|
||||||
// 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
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
inline MxU32 GetUnknown10() { return m_unk0x10; }
|
inline MxU32 GetUnknown10() { return m_unk0x10; }
|
||||||
inline MxS32 GetCurrentAct() { return m_currentAct; }
|
inline MxS32 GetCurrentAct() { return m_currentAct; }
|
||||||
inline MxU32 GetCurrentArea() { return m_currentArea; }
|
inline MxU32 GetCurrentArea() { return m_currentArea; }
|
||||||
|
inline MxU32 GetPreviousArea() { return m_previousArea; }
|
||||||
|
|
||||||
inline void SetDirty(MxBool p_dirty) { m_isDirty = p_dirty; }
|
inline void SetDirty(MxBool p_dirty) { m_isDirty = p_dirty; }
|
||||||
inline void SetCurrentArea(MxU32 p_currentArea) { m_currentArea = p_currentArea; }
|
inline void SetCurrentArea(MxU32 p_currentArea) { m_currentArea = p_currentArea; }
|
||||||
|
|
|
@ -51,7 +51,14 @@ public:
|
||||||
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);
|
||||||
|
|
|
@ -29,20 +29,21 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void Initialize(MxBool p_und);
|
void Initialize(MxBool p_und);
|
||||||
|
void Play();
|
||||||
|
void Stop();
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x1002c970
|
// SYNTHETIC: LEGO1 0x1002c970
|
||||||
// Radio::`scalar deleting destructor'
|
// Radio::`scalar deleting destructor'
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void CreateRadioState();
|
||||||
|
|
||||||
RadioState* m_state; // 0x08
|
RadioState* m_state; // 0x08
|
||||||
MxBool m_unk0x0c; // 0x0c
|
MxBool m_unk0x0c; // 0x0c
|
||||||
MxBool m_bgAudioPreviouslyEnabled; // 0x0d
|
MxBool m_bgAudioPreviouslyEnabled; // 0x0d
|
||||||
|
|
||||||
void CreateRadioState();
|
|
||||||
void Play();
|
|
||||||
void Stop();
|
|
||||||
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
||||||
MxLong HandleNotification17(LegoControlManagerEvent& p_param);
|
MxLong HandleClick(LegoControlManagerEvent& p_param);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RADIO_H
|
#endif // RADIO_H
|
||||||
|
|
|
@ -428,20 +428,32 @@ void LegoGameState::SwitchArea(MxU32 p_area)
|
||||||
|
|
||||||
BackgroundAudioManager()->Stop();
|
BackgroundAudioManager()->Stop();
|
||||||
AnimationManager()->FUN_1005ef10();
|
AnimationManager()->FUN_1005ef10();
|
||||||
VideoManager()->SetUnk0x554(0);
|
VideoManager()->SetUnk0x554(FALSE);
|
||||||
|
|
||||||
MxAtomId* script = g_isleScript;
|
MxAtomId* script = g_isleScript;
|
||||||
switch (p_area) {
|
switch (p_area) {
|
||||||
case 1:
|
case 1:
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
VideoManager()->SetUnk0x554(1);
|
VideoManager()->SetUnk0x554(TRUE);
|
||||||
script = g_infomainScript;
|
script = g_infomainScript;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
VideoManager()->SetUnk0x554(1);
|
VideoManager()->SetUnk0x554(TRUE);
|
||||||
script = g_infodoorScript;
|
script = g_infodoorScript;
|
||||||
break;
|
break;
|
||||||
|
// TODO
|
||||||
|
case 5:
|
||||||
|
script = g_elevbottScript;
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
VideoManager()->SetUnk0x554(TRUE);
|
||||||
|
script = g_regbookScript;
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
VideoManager()->SetUnk0x554(TRUE);
|
||||||
|
script = g_infoscorScript;
|
||||||
|
break;
|
||||||
|
|
||||||
// TODO: implement other cases
|
// TODO: implement other cases
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
|
@ -108,13 +108,13 @@ MxBool MxControlPresenter::FUN_10044270(MxS32 p_x, MxS32 p_y, MxVideoPresenter*
|
||||||
if (m_unk0x4c == 3) {
|
if (m_unk0x4c == 3) {
|
||||||
MxVideoPresenter* frontPresenter = (MxVideoPresenter*) m_list.front();
|
MxVideoPresenter* frontPresenter = (MxVideoPresenter*) m_list.front();
|
||||||
|
|
||||||
if (p_presenter == frontPresenter || frontPresenter->GetDisplayZ() < frontPresenter->GetDisplayZ()) {
|
if (p_presenter == frontPresenter || frontPresenter->GetDisplayZ() < p_presenter->GetDisplayZ()) {
|
||||||
if (p_presenter->VTable0x7c()) {
|
if (p_presenter->VTable0x7c()) {
|
||||||
MxS32 height = frontPresenter->GetHeight();
|
MxS32 height = frontPresenter->GetHeight();
|
||||||
MxS32 width = frontPresenter->GetWidth();
|
MxS32 width = frontPresenter->GetWidth();
|
||||||
|
|
||||||
if (frontPresenter->GetLocation().GetX() <= p_x &&
|
if (frontPresenter->GetLocation().GetX() <= p_x &&
|
||||||
p_x < width - 1 + frontPresenter->GetLocation().GetY() &&
|
p_x < width - 1 + frontPresenter->GetLocation().GetX() &&
|
||||||
frontPresenter->GetLocation().GetY() <= p_y &&
|
frontPresenter->GetLocation().GetY() <= p_y &&
|
||||||
p_y < height - 1 + frontPresenter->GetLocation().GetY()) {
|
p_y < height - 1 + frontPresenter->GetLocation().GetY()) {
|
||||||
MxU8* start;
|
MxU8* start;
|
||||||
|
@ -198,7 +198,7 @@ MxBool MxControlPresenter::FUN_10044480(LegoControlManagerEvent* p_event, MxPres
|
||||||
p_event->SetClickedObjectId(m_action->GetObjectId());
|
p_event->SetClickedObjectId(m_action->GetObjectId());
|
||||||
p_event->SetClickedAtom(m_action->GetAtomId().GetInternal());
|
p_event->SetClickedAtom(m_action->GetAtomId().GetInternal());
|
||||||
VTable0x6c(0);
|
VTable0x6c(0);
|
||||||
p_event->SetType(c_notificationType17);
|
p_event->SetType(c_notificationClick);
|
||||||
p_event->SetUnknown0x28(m_unk0x4e);
|
p_event->SetUnknown0x28(m_unk0x4e);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ MxBool MxControlPresenter::FUN_10044480(LegoControlManagerEvent* p_event, MxPres
|
||||||
p_event->SetClickedObjectId(m_action->GetObjectId());
|
p_event->SetClickedObjectId(m_action->GetObjectId());
|
||||||
p_event->SetClickedAtom(m_action->GetAtomId().GetInternal());
|
p_event->SetClickedAtom(m_action->GetAtomId().GetInternal());
|
||||||
VTable0x6c(m_unk0x56);
|
VTable0x6c(m_unk0x56);
|
||||||
p_event->SetType(c_notificationType17);
|
p_event->SetType(c_notificationClick);
|
||||||
p_event->SetUnknown0x28(m_unk0x4e);
|
p_event->SetUnknown0x28(m_unk0x4e);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "elevatorbottom.h"
|
#include "elevatorbottom.h"
|
||||||
|
|
||||||
|
#include "act1state.h"
|
||||||
#include "jukebox.h"
|
#include "jukebox.h"
|
||||||
#include "legocontrolmanager.h"
|
#include "legocontrolmanager.h"
|
||||||
#include "legogamestate.h"
|
#include "legogamestate.h"
|
||||||
|
@ -7,9 +8,14 @@
|
||||||
#include "legoomni.h"
|
#include "legoomni.h"
|
||||||
#include "mxnotificationmanager.h"
|
#include "mxnotificationmanager.h"
|
||||||
#include "mxomni.h"
|
#include "mxomni.h"
|
||||||
|
#include "mxtransitionmanager.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(ElevatorBottom, 0xfc)
|
DECOMP_SIZE_ASSERT(ElevatorBottom, 0xfc)
|
||||||
|
|
||||||
|
// STRING: LEGO1 0x100f0d34
|
||||||
|
// GLOBAL: LEGO1 0x100f3a44
|
||||||
|
char* g_cameraLoc = "CAMERA_LOCATION";
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10017e90
|
// FUNCTION: LEGO1 0x10017e90
|
||||||
ElevatorBottom::ElevatorBottom()
|
ElevatorBottom::ElevatorBottom()
|
||||||
{
|
{
|
||||||
|
@ -52,8 +58,8 @@ MxLong ElevatorBottom::Notify(MxParam& p_param)
|
||||||
|
|
||||||
if (m_worldStarted) {
|
if (m_worldStarted) {
|
||||||
switch (((MxNotificationParam&) p_param).GetType()) {
|
switch (((MxNotificationParam&) p_param).GetType()) {
|
||||||
case c_notificationType17:
|
case c_notificationClick:
|
||||||
ret = HandleNotification17(p_param);
|
ret = HandleClick((LegoControlManagerEvent&) p_param);
|
||||||
break;
|
break;
|
||||||
case c_notificationTransitioned:
|
case c_notificationTransitioned:
|
||||||
GameState()->SwitchArea(m_unk0xf8);
|
GameState()->SwitchArea(m_unk0xf8);
|
||||||
|
@ -72,10 +78,41 @@ void ElevatorBottom::ReadyWorld()
|
||||||
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x100181d0
|
// FUNCTION: LEGO1 0x100181d0
|
||||||
MxLong ElevatorBottom::HandleNotification17(MxParam& p_param)
|
MxLong ElevatorBottom::HandleClick(LegoControlManagerEvent& p_param)
|
||||||
{
|
{
|
||||||
return 0;
|
MxLong result = 0;
|
||||||
|
|
||||||
|
if (p_param.GetUnknown0x28() == 1) {
|
||||||
|
switch (p_param.GetClickedObjectId()) {
|
||||||
|
case 1:
|
||||||
|
m_unk0xf8 = 3;
|
||||||
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
||||||
|
result = 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
m_unk0xf8 = 2;
|
||||||
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
||||||
|
result = 1;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
LegoGameState* gs = GameState();
|
||||||
|
Act1State* state = (Act1State*) gs->GetState("Act1State");
|
||||||
|
|
||||||
|
if (state == NULL) {
|
||||||
|
state = (Act1State*) gs->CreateState("Act1State");
|
||||||
|
}
|
||||||
|
|
||||||
|
state->SetUnknown1c(1);
|
||||||
|
m_unk0xf8 = 6;
|
||||||
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
||||||
|
VariableTable()->SetVariable(g_cameraLoc, "LCAMZI1,90");
|
||||||
|
result = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100182c0
|
// FUNCTION: LEGO1 0x100182c0
|
||||||
|
|
|
@ -32,7 +32,7 @@ Infocenter::Infocenter()
|
||||||
m_infocenterState = NULL;
|
m_infocenterState = NULL;
|
||||||
m_frameHotBitmap = 0;
|
m_frameHotBitmap = 0;
|
||||||
m_unk0x11c = 0;
|
m_unk0x11c = 0;
|
||||||
m_unk0x104 = 0;
|
m_transitionDestination = 0;
|
||||||
m_currentInfomainScript = c_noInfomain;
|
m_currentInfomainScript = c_noInfomain;
|
||||||
m_currentCutscene = e_noIntro;
|
m_currentCutscene = e_noIntro;
|
||||||
|
|
||||||
|
@ -126,8 +126,8 @@ MxLong Infocenter::Notify(MxParam& p_param)
|
||||||
((LegoEventNotificationParam&) p_param).GetY()
|
((LegoEventNotificationParam&) p_param).GetY()
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case c_notificationType17:
|
case c_notificationClick:
|
||||||
result = HandleNotification17(p_param);
|
result = HandleClick((LegoControlManagerEvent&) p_param);
|
||||||
break;
|
break;
|
||||||
case c_notificationTransitioned:
|
case c_notificationTransitioned:
|
||||||
StopBookAnimation();
|
StopBookAnimation();
|
||||||
|
@ -137,10 +137,10 @@ MxLong Infocenter::Notify(MxParam& p_param)
|
||||||
StartCredits();
|
StartCredits();
|
||||||
m_infocenterState->SetUnknown0x74(0xd);
|
m_infocenterState->SetUnknown0x74(0xd);
|
||||||
}
|
}
|
||||||
else if (m_unk0x104 != 0) {
|
else if (m_transitionDestination != 0) {
|
||||||
BackgroundAudioManager()->RaiseVolume();
|
BackgroundAudioManager()->RaiseVolume();
|
||||||
GameState()->SwitchArea(m_unk0x104);
|
GameState()->SwitchArea(m_transitionDestination);
|
||||||
m_unk0x104 = 0;
|
m_transitionDestination = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ MxLong Infocenter::HandleEndAction(MxParam& p_param)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
FUN_10070dc0(TRUE);
|
UpdateFrameHot(TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,63 +383,82 @@ void Infocenter::InitializeBitmaps()
|
||||||
((MxPresenter*) Find(m_atom, c_radioCtl))->Enable(TRUE);
|
((MxPresenter*) Find(m_atom, c_radioCtl))->Enable(TRUE);
|
||||||
|
|
||||||
m_mapAreas[0].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Info_A_Bitmap");
|
m_mapAreas[0].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Info_A_Bitmap");
|
||||||
m_mapAreas[0].m_unk0x08 = 391;
|
m_mapAreas[0].m_area.SetLeft(391);
|
||||||
m_mapAreas[0].m_unk0x0c = 182;
|
m_mapAreas[0].m_area.SetTop(182);
|
||||||
m_mapAreas[0].m_unk0x10 = 427;
|
m_mapAreas[0].m_area.SetRight(427);
|
||||||
m_mapAreas[0].m_unk0x14 = 230;
|
m_mapAreas[0].m_area.SetBottom(230);
|
||||||
m_mapAreas[0].m_unk0x04 = 3;
|
m_mapAreas[0].m_unk0x04 = 3;
|
||||||
|
|
||||||
m_mapAreas[1].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Boat_A_Bitmap");
|
m_mapAreas[1].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Boat_A_Bitmap");
|
||||||
m_mapAreas[1].m_unk0x08 = 304;
|
m_mapAreas[1].m_area.SetLeft(304);
|
||||||
m_mapAreas[1].m_unk0x0c = 225;
|
m_mapAreas[1].m_area.SetTop(225);
|
||||||
m_mapAreas[1].m_unk0x10 = 350;
|
m_mapAreas[1].m_area.SetRight(350);
|
||||||
m_mapAreas[1].m_unk0x14 = 268;
|
m_mapAreas[1].m_area.SetBottom(268);
|
||||||
m_mapAreas[1].m_unk0x04 = 10;
|
m_mapAreas[1].m_unk0x04 = 10;
|
||||||
|
|
||||||
m_mapAreas[2].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Race_A_Bitmap");
|
m_mapAreas[2].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Race_A_Bitmap");
|
||||||
m_mapAreas[2].m_unk0x08 = 301;
|
m_mapAreas[2].m_area.SetLeft(301);
|
||||||
m_mapAreas[2].m_unk0x0c = 133;
|
m_mapAreas[2].m_area.SetTop(133);
|
||||||
m_mapAreas[2].m_unk0x10 = 347;
|
m_mapAreas[2].m_area.SetRight(347);
|
||||||
m_mapAreas[2].m_unk0x14 = 181;
|
m_mapAreas[2].m_area.SetBottom(181);
|
||||||
m_mapAreas[2].m_unk0x04 = 11;
|
m_mapAreas[2].m_unk0x04 = 11;
|
||||||
|
|
||||||
m_mapAreas[3].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Pizza_A_Bitmap");
|
m_mapAreas[3].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Pizza_A_Bitmap");
|
||||||
m_mapAreas[3].m_unk0x08 = 289;
|
m_mapAreas[3].m_area.SetLeft(289);
|
||||||
m_mapAreas[3].m_unk0x0c = 182;
|
m_mapAreas[3].m_area.SetTop(182);
|
||||||
m_mapAreas[3].m_unk0x10 = 335;
|
m_mapAreas[3].m_area.SetRight(335);
|
||||||
m_mapAreas[3].m_unk0x14 = 225;
|
m_mapAreas[3].m_area.SetBottom(225);
|
||||||
m_mapAreas[3].m_unk0x04 = 12;
|
m_mapAreas[3].m_unk0x04 = 12;
|
||||||
|
|
||||||
m_mapAreas[4].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Gas_A_Bitmap");
|
m_mapAreas[4].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Gas_A_Bitmap");
|
||||||
m_mapAreas[4].m_unk0x10 = 391;
|
m_mapAreas[4].m_area.SetLeft(350);
|
||||||
m_mapAreas[4].m_unk0x08 = 350;
|
m_mapAreas[4].m_area.SetTop(161);
|
||||||
m_mapAreas[4].m_unk0x0c = 161;
|
m_mapAreas[4].m_area.SetRight(391);
|
||||||
m_mapAreas[4].m_unk0x14 = 209;
|
m_mapAreas[4].m_area.SetBottom(209);
|
||||||
m_mapAreas[4].m_unk0x04 = 13;
|
m_mapAreas[4].m_unk0x04 = 13;
|
||||||
|
|
||||||
m_mapAreas[5].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Med_A_Bitmap");
|
m_mapAreas[5].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Med_A_Bitmap");
|
||||||
m_mapAreas[5].m_unk0x08 = 392;
|
m_mapAreas[5].m_area.SetLeft(392);
|
||||||
m_mapAreas[5].m_unk0x0c = 130;
|
m_mapAreas[5].m_area.SetTop(130);
|
||||||
m_mapAreas[5].m_unk0x10 = 438;
|
m_mapAreas[5].m_area.SetRight(438);
|
||||||
m_mapAreas[5].m_unk0x14 = 176;
|
m_mapAreas[5].m_area.SetBottom(176);
|
||||||
m_mapAreas[5].m_unk0x04 = 14;
|
m_mapAreas[5].m_unk0x04 = 14;
|
||||||
|
|
||||||
m_mapAreas[6].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Cop_A_Bitmap");
|
m_mapAreas[6].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Cop_A_Bitmap");
|
||||||
m_mapAreas[6].m_unk0x08 = 396;
|
m_mapAreas[6].m_area.SetLeft(396);
|
||||||
m_mapAreas[6].m_unk0x0c = 229;
|
m_mapAreas[6].m_area.SetTop(229);
|
||||||
m_mapAreas[6].m_unk0x10 = 442;
|
m_mapAreas[6].m_area.SetRight(442);
|
||||||
m_mapAreas[6].m_unk0x14 = 272;
|
m_mapAreas[6].m_area.SetBottom(272);
|
||||||
m_mapAreas[6].m_unk0x04 = 15;
|
m_mapAreas[6].m_unk0x04 = 15;
|
||||||
|
|
||||||
m_frameHotBitmap = (MxStillPresenter*) Find("MxStillPresenter", "FrameHot_Bitmap");
|
m_frameHotBitmap = (MxStillPresenter*) Find("MxStillPresenter", "FrameHot_Bitmap");
|
||||||
|
|
||||||
FUN_10070dc0(TRUE);
|
UpdateFrameHot(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x1006fd00
|
// FUNCTION: LEGO1 0x1006fd00
|
||||||
MxU8 Infocenter::HandleMouseMove(MxS32 p_x, MxS32 p_y)
|
MxU8 Infocenter::HandleMouseMove(MxS32 p_x, MxS32 p_y)
|
||||||
{
|
{
|
||||||
return 1;
|
if (m_unk0x11c) {
|
||||||
|
if (!m_unk0x11c->IsEnabled()) {
|
||||||
|
MxS32 oldDisplayZ = m_unk0x11c->GetDisplayZ();
|
||||||
|
|
||||||
|
m_unk0x11c->SetDisplayZ(1000);
|
||||||
|
VideoManager()->SortPresenterList();
|
||||||
|
m_unk0x11c->Enable(TRUE);
|
||||||
|
m_unk0x11c->VTable0x88(p_x, p_y);
|
||||||
|
|
||||||
|
m_unk0x11c->SetDisplayZ(oldDisplayZ);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_unk0x11c->VTable0x88(p_x, p_y);
|
||||||
|
}
|
||||||
|
|
||||||
|
FUN_10070d10(p_x, p_y);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1006fda0
|
// FUNCTION: LEGO1 0x1006fda0
|
||||||
|
@ -492,12 +511,129 @@ MxLong Infocenter::HandleKeyPress(MxS8 p_key)
|
||||||
// STUB: LEGO1 0x1006feb0
|
// STUB: LEGO1 0x1006feb0
|
||||||
MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
|
MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
|
||||||
{
|
{
|
||||||
return 1;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10070370
|
// FUNCTION: LEGO1 0x10070370
|
||||||
MxU8 Infocenter::HandleNotification17(MxParam&)
|
MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
|
||||||
{
|
{
|
||||||
|
if (p_param.GetUnknown0x28() == 1) {
|
||||||
|
m_infoManDialogueTimer = 0;
|
||||||
|
|
||||||
|
InfomainScript actionToPlay = c_noInfomain;
|
||||||
|
StopCurrentAction();
|
||||||
|
InfomainScript characterBitmap = c_noInfomain;
|
||||||
|
|
||||||
|
GameState();
|
||||||
|
|
||||||
|
switch (p_param.GetClickedObjectId()) {
|
||||||
|
case c_leftArrowCtl:
|
||||||
|
m_infocenterState->SetUnknown0x74(14);
|
||||||
|
StopCurrentAction();
|
||||||
|
|
||||||
|
if (GameState()->GetUnknown10() == 0) {
|
||||||
|
m_radio.Stop();
|
||||||
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
||||||
|
m_transitionDestination = 5;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MxU32 objectId = m_infocenterState->GetUnknown0x68().FUN_10014d00();
|
||||||
|
PlayAction((InfomainScript) objectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case c_rightArrowCtl:
|
||||||
|
m_infocenterState->SetUnknown0x74(14);
|
||||||
|
StopCurrentAction();
|
||||||
|
|
||||||
|
if (GameState()->GetUnknown10() == 0) {
|
||||||
|
m_radio.Stop();
|
||||||
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
||||||
|
m_transitionDestination = 13;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MxU32 objectId = m_infocenterState->GetUnknown0x68().FUN_10014d00();
|
||||||
|
PlayAction((InfomainScript) objectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case c_infoCtl:
|
||||||
|
m_radio.Stop();
|
||||||
|
break;
|
||||||
|
case c_doorCtl:
|
||||||
|
if (m_infocenterState->GetUnknown0x74() != 8) {
|
||||||
|
actionToPlay = c_exitConfirmationDialogue;
|
||||||
|
m_radio.Stop();
|
||||||
|
m_infocenterState->SetUnknown0x74(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case c_boatCtl:
|
||||||
|
actionToPlay = c_boatCtlDescription;
|
||||||
|
m_radio.Stop();
|
||||||
|
break;
|
||||||
|
case c_raceCtl:
|
||||||
|
actionToPlay = c_raceCtlDescription;
|
||||||
|
m_radio.Stop();
|
||||||
|
break;
|
||||||
|
case c_pizzaCtl:
|
||||||
|
actionToPlay = c_pizzaCtlDescription;
|
||||||
|
m_radio.Stop();
|
||||||
|
break;
|
||||||
|
case c_gasCtl:
|
||||||
|
actionToPlay = c_gasCtlDescription;
|
||||||
|
m_radio.Stop();
|
||||||
|
break;
|
||||||
|
case c_medCtl:
|
||||||
|
actionToPlay = c_medCtlDescription;
|
||||||
|
m_radio.Stop();
|
||||||
|
break;
|
||||||
|
case c_copCtlDescription:
|
||||||
|
actionToPlay = c_copCtlDescription;
|
||||||
|
m_radio.Stop();
|
||||||
|
break;
|
||||||
|
case c_bigInfoCtl:
|
||||||
|
// TODO
|
||||||
|
break;
|
||||||
|
case c_bookCtl:
|
||||||
|
m_transitionDestination = 12;
|
||||||
|
m_infocenterState->SetUnknown0x74(4);
|
||||||
|
actionToPlay = GameState()->GetUnknown10() ? c_goToRegBookRed : c_goToRegBook;
|
||||||
|
m_radio.Stop();
|
||||||
|
GameState()->SetCurrentArea(GameState()->GetPreviousArea());
|
||||||
|
InputManager()->DisableInputProcessing();
|
||||||
|
break;
|
||||||
|
case c_mamaCtl:
|
||||||
|
characterBitmap = c_mamaSelected;
|
||||||
|
UpdateFrameHot(FALSE);
|
||||||
|
break;
|
||||||
|
case c_papaCtl:
|
||||||
|
characterBitmap = c_papaSelected;
|
||||||
|
UpdateFrameHot(FALSE);
|
||||||
|
break;
|
||||||
|
case c_pepperCtl:
|
||||||
|
characterBitmap = c_pepperSelected;
|
||||||
|
UpdateFrameHot(FALSE);
|
||||||
|
break;
|
||||||
|
case c_nickCtl:
|
||||||
|
characterBitmap = c_nickSelected;
|
||||||
|
UpdateFrameHot(FALSE);
|
||||||
|
break;
|
||||||
|
case c_lauraCtl:
|
||||||
|
characterBitmap = c_lauraCtl;
|
||||||
|
UpdateFrameHot(FALSE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (actionToPlay != c_noInfomain) {
|
||||||
|
PlayAction(actionToPlay);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (characterBitmap != c_noInfomain) {
|
||||||
|
m_unk0x11c = (MxStillPresenter*) Find(m_atom, characterBitmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,9 +737,81 @@ MxBool Infocenter::VTable0x5c()
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10070dc0
|
// FUNCTION: LEGO1 0x10070d10
|
||||||
void Infocenter::FUN_10070dc0(MxBool)
|
void Infocenter::FUN_10070d10(MxS32 p_x, MxS32 p_y)
|
||||||
{
|
{
|
||||||
|
MxS16 i;
|
||||||
|
for (i = 0; i < (MxS32) (sizeof(m_mapAreas) / sizeof(m_mapAreas[0])); i++) {
|
||||||
|
MxS32 right = m_mapAreas[i].m_area.GetRight();
|
||||||
|
MxS32 bottom = m_mapAreas[i].m_area.GetBottom();
|
||||||
|
MxS32 left = m_mapAreas[i].m_area.GetLeft();
|
||||||
|
MxS32 top = m_mapAreas[i].m_area.GetTop();
|
||||||
|
|
||||||
|
if (left <= p_x && p_x <= right && top <= p_y && p_y <= bottom)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == 7) {
|
||||||
|
i = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i != m_unk0x1c8) {
|
||||||
|
if (m_unk0x1c8 != -1) {
|
||||||
|
m_mapAreas[i].m_presenter->Enable(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_unk0x1c8 = i;
|
||||||
|
if (i != -1) {
|
||||||
|
m_mapAreas[i].m_presenter->Enable(TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION: LEGO1 0x10070dc0
|
||||||
|
void Infocenter::UpdateFrameHot(MxBool p_display)
|
||||||
|
{
|
||||||
|
if (p_display) {
|
||||||
|
MxS32 x, y;
|
||||||
|
|
||||||
|
switch (GameState()->GetUnknownC()) {
|
||||||
|
case 1:
|
||||||
|
x = 302;
|
||||||
|
y = 81;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
x = 204;
|
||||||
|
y = 81;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
x = 253;
|
||||||
|
y = 81;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
x = 353;
|
||||||
|
y = 81;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
x = 399;
|
||||||
|
y = 81;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MxS32 originalDisplayZ = m_frameHotBitmap->GetDisplayZ();
|
||||||
|
|
||||||
|
m_frameHotBitmap->SetDisplayZ(1000);
|
||||||
|
VideoManager()->SortPresenterList();
|
||||||
|
|
||||||
|
m_frameHotBitmap->Enable(TRUE);
|
||||||
|
m_frameHotBitmap->VTable0x88(x, y);
|
||||||
|
m_frameHotBitmap->SetDisplayZ(originalDisplayZ);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (m_frameHotBitmap) {
|
||||||
|
m_frameHotBitmap->Enable(FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10070e90
|
// STUB: LEGO1 0x10070e90
|
||||||
|
@ -611,9 +819,33 @@ void Infocenter::FUN_10070e90()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x10070f60
|
// FUNCTION: LEGO1 0x10070f60
|
||||||
MxBool Infocenter::VTable0x64()
|
MxBool Infocenter::VTable0x64()
|
||||||
{
|
{
|
||||||
|
if (m_infocenterState != NULL) {
|
||||||
|
MxU32 val = m_infocenterState->GetUnknown0x74();
|
||||||
|
|
||||||
|
if (val == 0) {
|
||||||
|
StopCutscene();
|
||||||
|
m_infocenterState->SetUnknown0x74(1);
|
||||||
|
}
|
||||||
|
else if (val == 13) {
|
||||||
|
StopCredits();
|
||||||
|
}
|
||||||
|
else if (val != 8) {
|
||||||
|
m_infocenterState->SetUnknown0x74(8);
|
||||||
|
|
||||||
|
#ifdef COMPAT_MODE
|
||||||
|
{
|
||||||
|
MxNotificationParam param(c_notificationType0, NULL);
|
||||||
|
Notify(param);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
Notify(MxNotificationParam(c_notificationType0, NULL));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
#include "infocenterdoor.h"
|
#include "infocenterdoor.h"
|
||||||
|
|
||||||
|
#include "infocenterstate.h"
|
||||||
#include "jukebox.h"
|
#include "jukebox.h"
|
||||||
#include "legocontrolmanager.h"
|
#include "legocontrolmanager.h"
|
||||||
#include "legogamestate.h"
|
#include "legogamestate.h"
|
||||||
#include "legoinputmanager.h"
|
#include "legoinputmanager.h"
|
||||||
#include "legoomni.h"
|
#include "legoomni.h"
|
||||||
|
#include "mxactionnotificationparam.h"
|
||||||
|
#include "mxbackgroundaudiomanager.h"
|
||||||
#include "mxnotificationmanager.h"
|
#include "mxnotificationmanager.h"
|
||||||
|
#include "mxtransitionmanager.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(InfocenterDoor, 0xfc)
|
DECOMP_SIZE_ASSERT(InfocenterDoor, 0xfc)
|
||||||
|
|
||||||
|
@ -45,11 +49,31 @@ MxResult InfocenterDoor::Create(MxDSAction& p_dsAction)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x100379e0
|
// FUNCTION: LEGO1 0x100379e0
|
||||||
MxLong InfocenterDoor::Notify(MxParam& p_param)
|
MxLong InfocenterDoor::Notify(MxParam& p_param)
|
||||||
{
|
{
|
||||||
// TODO
|
MxLong result = 0;
|
||||||
return LegoWorld::Notify(p_param);
|
LegoWorld::Notify(p_param);
|
||||||
|
|
||||||
|
if (m_worldStarted) {
|
||||||
|
switch (((MxNotificationParam&) p_param).GetType()) {
|
||||||
|
case c_notificationEndAction:
|
||||||
|
if (((MxEndActionNotificationParam&) p_param).GetAction()->GetAtomId() == m_atom) {
|
||||||
|
BackgroundAudioManager()->RaiseVolume();
|
||||||
|
result = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case c_notificationClick:
|
||||||
|
result = HandleClick((LegoControlManagerEvent&) p_param);
|
||||||
|
break;
|
||||||
|
case c_notificationTransitioned:
|
||||||
|
GameState()->SwitchArea(m_unk0xf8);
|
||||||
|
result = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10037a70
|
// FUNCTION: LEGO1 0x10037a70
|
||||||
|
@ -60,6 +84,61 @@ void InfocenterDoor::ReadyWorld()
|
||||||
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION: LEGO1 0x10037a90
|
||||||
|
MxLong InfocenterDoor::HandleClick(LegoControlManagerEvent& p_param)
|
||||||
|
{
|
||||||
|
MxLong result = 0;
|
||||||
|
|
||||||
|
if (p_param.GetUnknown0x28() == 1) {
|
||||||
|
DeleteObjects(&m_atom, 500, 510);
|
||||||
|
|
||||||
|
switch (p_param.GetClickedObjectId()) {
|
||||||
|
case 1:
|
||||||
|
m_unk0xf8 = 13;
|
||||||
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
||||||
|
result = 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
m_unk0xf8 = 5;
|
||||||
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
||||||
|
result = 1;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
m_unk0xf8 = 2;
|
||||||
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
||||||
|
result = 1;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
if (GameState()->GetUnknownC()) {
|
||||||
|
InfocenterState* state = (InfocenterState*) GameState()->GetState("InfocenterState");
|
||||||
|
if (state->GetInfocenterBufferElement(0) != NULL) {
|
||||||
|
m_unk0xf8 = 4;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MxDSAction action;
|
||||||
|
action.SetObjectId(503);
|
||||||
|
action.SetAtomId(*g_infodoorScript);
|
||||||
|
BackgroundAudioManager()->LowerVolume();
|
||||||
|
Start(&action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MxDSAction action;
|
||||||
|
action.SetObjectId(500);
|
||||||
|
action.SetAtomId(*g_infodoorScript);
|
||||||
|
BackgroundAudioManager()->LowerVolume();
|
||||||
|
Start(&action);
|
||||||
|
}
|
||||||
|
|
||||||
|
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
||||||
|
result = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10037c80
|
// FUNCTION: LEGO1 0x10037c80
|
||||||
void InfocenterDoor::VTable0x68(MxBool p_add)
|
void InfocenterDoor::VTable0x68(MxBool p_add)
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,7 +91,7 @@ MxLong Score::Notify(MxParam& p_param)
|
||||||
DeleteScript(); // Shutting down
|
DeleteScript(); // Shutting down
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
case c_notificationType17:
|
case c_notificationClick:
|
||||||
ret = FUN_100016d0((LegoControlManagerEvent&) p_param);
|
ret = FUN_100016d0((LegoControlManagerEvent&) p_param);
|
||||||
break;
|
break;
|
||||||
case c_notificationTransitioned:
|
case c_notificationTransitioned:
|
||||||
|
|
|
@ -115,7 +115,7 @@ MxLong Isle::Notify(MxParam& p_param)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case c_notificationType17:
|
case c_notificationClick:
|
||||||
result = HandleType17Notification(p_param);
|
result = HandleType17Notification(p_param);
|
||||||
break;
|
break;
|
||||||
case c_notificationType18:
|
case c_notificationType18:
|
||||||
|
|
|
@ -41,8 +41,8 @@ MxLong Radio::Notify(MxParam& p_param)
|
||||||
case c_notificationEndAction:
|
case c_notificationEndAction:
|
||||||
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
|
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
|
||||||
break;
|
break;
|
||||||
case c_notificationType17:
|
case c_notificationClick:
|
||||||
result = HandleNotification17((LegoControlManagerEvent&) p_param);
|
result = HandleClick((LegoControlManagerEvent&) p_param);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ void Radio::Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002cbc0
|
// FUNCTION: LEGO1 0x1002cbc0
|
||||||
MxLong Radio::HandleNotification17(LegoControlManagerEvent& p_param)
|
MxLong Radio::HandleClick(LegoControlManagerEvent& p_param)
|
||||||
{
|
{
|
||||||
MxDSAction action; // Unused
|
MxDSAction action; // Unused
|
||||||
MxS32 objectId = p_param.GetClickedObjectId();
|
MxS32 objectId = p_param.GetClickedObjectId();
|
||||||
|
|
|
@ -23,7 +23,7 @@ enum NotificationId {
|
||||||
c_notificationDragStart = 13,
|
c_notificationDragStart = 13,
|
||||||
c_notificationDrag = 14,
|
c_notificationDrag = 14,
|
||||||
c_notificationTimer = 15, // 100d6aa0
|
c_notificationTimer = 15, // 100d6aa0
|
||||||
c_notificationType17 = 17,
|
c_notificationClick = 17,
|
||||||
c_notificationType18 = 18, // 100d7e80
|
c_notificationType18 = 18, // 100d7e80
|
||||||
c_notificationType19 = 19, // 100d6230
|
c_notificationType19 = 19, // 100d6230
|
||||||
c_notificationType20 = 20,
|
c_notificationType20 = 20,
|
||||||
|
|
|
@ -121,6 +121,8 @@ public:
|
||||||
m_compositePresenter = p_compositePresenter;
|
m_compositePresenter = p_compositePresenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void SetDisplayZ(MxS32 p_displayZ) { m_displayZ = p_displayZ; }
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x1000c070
|
// SYNTHETIC: LEGO1 0x1000c070
|
||||||
// MxPresenter::`scalar deleting destructor'
|
// MxPresenter::`scalar deleting destructor'
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
inline MxBool IsValid() const { return m_left < m_right && m_top < m_bottom; }
|
inline MxBool IsValid() const { return m_left < m_right && m_top < m_bottom; }
|
||||||
|
|
||||||
inline MxBool IntersectsWith(const MxRect32& p_rect) const
|
inline MxBool IntersectsWith(const MxRect32& p_rect) const
|
||||||
{
|
{
|
||||||
return m_left < p_rect.m_right && p_rect.m_left < m_right && m_top < p_rect.m_bottom && p_rect.m_top < m_bottom;
|
return m_left < p_rect.m_right && p_rect.m_left < m_right && m_top < p_rect.m_bottom && p_rect.m_top < m_bottom;
|
||||||
|
|
Loading…
Reference in a new issue