diff --git a/LEGO1/Send b/LEGO1/Send new file mode 100644 index 00000000..b90d322d --- /dev/null +++ b/LEGO1/Send @@ -0,0 +1,72 @@ +lego/legoomni/src/actors/jukeboxentity.cpp: NotificationManager()->Register(this); +lego/legoomni/src/actors/jukeboxentity.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/actors/radio.cpp: NotificationManager()->Register(this); +lego/legoomni/src/actors/radio.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/actors/skateboard.cpp: NotificationManager()->Register(this); +lego/legoomni/src/audio/mxbackgroundaudiomanager.cpp: NotificationManager()->Register(this); +lego/legoomni/src/audio/mxbackgroundaudiomanager.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/build/buildingentity.cpp: NotificationManager()->Register(this); +lego/legoomni/src/build/buildingentity.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/common/legogamestate.cpp: NotificationManager()->Send(world, ¶m); +lego/legoomni/src/common/legogamestate.cpp: NotificationManager()->Send(world, &MxNotificationParam(c_notificationType20, NULL)); +lego/legoomni/src/common/legoutils.cpp: NotificationManager()->Send(entity, ¶m); +lego/legoomni/src/common/legoutils.cpp: NotificationManager()->Send(entity, &MxNotificationParam(c_notificationType0, p_sender)); +lego/legoomni/src/entity/act2policestation.cpp: NotificationManager()->Send(CurrentWorld(), &MxNotificationParam(c_notificationType23, NULL)); +lego/legoomni/src/entity/legojetski.cpp: NotificationManager()->Register(this); +lego/legoomni/src/entity/legoworld.cpp: NotificationManager()->Register(this); +lego/legoomni/src/entity/legoworld.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/entity/legoworldpresenter.cpp: NotificationManager()->Send(m_entity, ¶m); +lego/legoomni/src/entity/legoworldpresenter.cpp: NotificationManager()->Send(m_entity, &MxNotificationParam(c_notificationNewPresenter, NULL)); +lego/legoomni/src/main/legoomni.cpp: NotificationManager()->Send(m_currentWorld, p_param); +lego/legoomni/src/race/legorace.cpp: NotificationManager()->Register(this); +lego/legoomni/src/race/legoracecar.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/elevatorbottom.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/elevatorbottom.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/worlds/gasstation.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/gasstation.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/worlds/historybook.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/hospital.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/hospital.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/worlds/infocenter.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/infocenter.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/worlds/infocenterdoor.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/infocenterdoor.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Send(this, ¶m); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL)); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Send(this, ¶m); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL)); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Send(this, ¶m); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL)); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Send(this, ¶m); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL)); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Send(this, ¶m); +lego/legoomni/src/worlds/isle.cpp: NotificationManager()->Send(this, &MxNotificationParam(c_notificationTransitioned, NULL)); +lego/legoomni/src/worlds/jukebox.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/jukebox.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/worlds/police.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/police.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/worlds/registrationbook.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/registrationbook.cpp: NotificationManager()->Unregister(this); +lego/legoomni/src/worlds/score.cpp: NotificationManager()->Register(this); +lego/legoomni/src/worlds/score.cpp: NotificationManager()->Unregister(this); +omni/src/common/mxcompositepresenter.cpp: NotificationManager()->Register(this); +omni/src/common/mxcompositepresenter.cpp: NotificationManager()->Unregister(this); +omni/src/common/mxcompositepresenter.cpp: NotificationManager()->Send(action->GetOrigin(), ¶m); +omni/src/common/mxcompositepresenter.cpp: NotificationManager()->Send( +omni/src/common/mxcompositepresenter.cpp: NotificationManager()->Send(this, &p_param); +omni/src/common/mxmediapresenter.cpp: NotificationManager()->Send(action->GetOrigin(), ¶m); +omni/src/common/mxmediapresenter.cpp: NotificationManager()->Send( +omni/src/common/mxpresenter.cpp: NotificationManager()->Send(m_compositePresenter, ¶m); +omni/src/common/mxpresenter.cpp: NotificationManager()->Send(m_compositePresenter, &MxNotificationParam(c_notificationPresenter, this)); +omni/src/main/mxomni.cpp: NotificationManager()->Send(sender, ¶m); +omni/src/main/mxomni.cpp: NotificationManager()->Send(sender, &MxType4NotificationParam(this, &p_action, object)); +omni/src/main/mxomni.cpp: NotificationManager()->Send(p_action.GetUnknown84(), ¶m); +omni/src/main/mxomni.cpp: NotificationManager()->Send( +omni/src/stream/mxstreamer.cpp: NotificationManager()->Register(this); +omni/src/stream/mxstreamer.cpp: NotificationManager()->Unregister(this); +omni/src/stream/mxstreamer.cpp: NotificationManager()->Send(this, ¬ification); +omni/src/stream/mxstreamer.cpp: NotificationManager()->Send(this, &MxStreamerNotification(c_notificationStreamer, NULL, c)); +omni/src/stream/mxstreamer.cpp: NotificationManager()->Send(this, ¬ification); +omni/src/stream/mxstreamer.cpp: NotificationManager()->Send(this, &MxStreamerNotification(c_notificationStreamer, NULL, c)); diff --git a/LEGO1/lego/legoomni/include/actions/jukebox_actions.h b/LEGO1/lego/legoomni/include/actions/jukebox_actions.h index 56149d88..a07b7028 100644 --- a/LEGO1/lego/legoomni/include/actions/jukebox_actions.h +++ b/LEGO1/lego/legoomni/include/actions/jukebox_actions.h @@ -68,7 +68,7 @@ enum Script { c_RaceCarBuild_Movie = 53, c_RaceCarBuild_Music = 54, c_JBMusic1 = 55, - c_JBMusic2 = 56, + c_JBMusic2 = 56, // Loaded on GasStation::ReadyWorld c_JBMusic3 = 57, c_JBMusic4 = 58, c_JBMusic5 = 59, diff --git a/LEGO1/lego/legoomni/include/gasstation.h b/LEGO1/lego/legoomni/include/gasstation.h index d9da404a..8e855f46 100644 --- a/LEGO1/lego/legoomni/include/gasstation.h +++ b/LEGO1/lego/legoomni/include/gasstation.h @@ -5,6 +5,7 @@ #include "gasstationstate.h" #include "legogamestate.h" #include "legoworld.h" +#include "mxstillpresenter.h" #include "radio.h" // VTABLE: LEGO1 0x100d4650 @@ -37,21 +38,24 @@ class GasStation : public LegoWorld { void Enable(MxBool p_enable) override; // vtable+0x68 virtual MxLong HandleClick(LegoControlManagerEvent& p_param); // vtable+0x6c + inline void PlayAction(MxU32 p_objectId); + // SYNTHETIC: LEGO1 0x100048a0 // GasStation::`scalar deleting destructor' private: + void FUN_10005590(undefined4); MxLong HandleEndAction(MxEndActionNotificationParam& p_param); MxLong HandleKeyPress(MxS8 p_key); MxLong HandleButtonDown(LegoControlManagerEvent& p_param); - undefined2 m_unk0xf8; // 0xf8 + MxS16 m_currentActorId; // 0xf8 undefined2 m_unk0xfa; // 0xfa LegoGameState::Area m_destLocation; // 0xfc GasStationState* m_state; // 0x100 undefined2 m_unk0x104; // 0x104 undefined2 m_unk0x106; // 0x106 - undefined4 m_unk0x108; // 0x108 + MxStillPresenter* m_trackLedBitmap; // 0x108 undefined4 m_unk0x10c; // 0x10c undefined4 m_unk0x110; // 0x110 undefined m_unk0x114; // 0x114 diff --git a/LEGO1/lego/legoomni/include/gasstationstate.h b/LEGO1/lego/legoomni/include/gasstationstate.h index 53dbdbae..78eae923 100644 --- a/LEGO1/lego/legoomni/include/gasstationstate.h +++ b/LEGO1/lego/legoomni/include/gasstationstate.h @@ -32,6 +32,8 @@ class GasStationState : public LegoState { // SYNTHETIC: LEGO1 0x10006290 // GasStationState::`scalar deleting destructor' + void FUN_10006430(undefined4); + friend class GasStation; private: diff --git a/LEGO1/lego/legoomni/src/gasstation/gasstationstate.cpp b/LEGO1/lego/legoomni/src/gasstation/gasstationstate.cpp index ed6f3248..45b64962 100644 --- a/LEGO1/lego/legoomni/src/gasstation/gasstationstate.cpp +++ b/LEGO1/lego/legoomni/src/gasstation/gasstationstate.cpp @@ -23,3 +23,9 @@ MxResult GasStationState::VTable0x1c(LegoFile* p_legoFile) // TODO return SUCCESS; } + +// STUB: LEGO1 0x10006430 +void GasStationState::FUN_10006430(undefined4 p_param) +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/worlds/gasstation.cpp b/LEGO1/lego/legoomni/src/worlds/gasstation.cpp index aef8e00a..7d4787af 100644 --- a/LEGO1/lego/legoomni/src/worlds/gasstation.cpp +++ b/LEGO1/lego/legoomni/src/worlds/gasstation.cpp @@ -1,9 +1,15 @@ #include "gasstation.h" +#include "garage_actions.h" +#include "islepathactor.h" +#include "jukebox.h" +#include "jukebox_actions.h" #include "legocontrolmanager.h" #include "legogamestate.h" #include "legoinputmanager.h" +#include "legoomni.h" #include "misc.h" +#include "mxbackgroundaudiomanager.h" #include "mxmisc.h" #include "mxnotificationmanager.h" #include "mxticklemanager.h" @@ -16,10 +22,10 @@ undefined4 g_unk0x100f0160 = 3; // FUNCTION: LEGO1 0x100046a0 GasStation::GasStation() { - m_unk0xf8 = 0; + m_currentActorId = 0; m_state = NULL; m_destLocation = LegoGameState::e_undefined; - m_unk0x108 = 0; + m_trackLedBitmap = NULL; m_unk0x104 = 0; m_unk0x114 = 0; m_unk0x106 = 0; @@ -110,12 +116,160 @@ MxLong GasStation::Notify(MxParam& p_param) return result; } -// STUB: LEGO1 0x10004b30 +// FUNCTION: LEGO1 0x10004b30 void GasStation::ReadyWorld() +{ + undefined2 comparisonValue; + PlayMusic(JukeboxScript::c_JBMusic2); + + m_trackLedBitmap = (MxStillPresenter*) Find("MxStillPresenter", "TrackLed_Bitmap"); + + m_currentActorId = CurrentActor()->GetActorId(); + + switch (m_currentActorId) { + case 1: { + switch (m_state->m_unk0x18) { + case 0: + m_state->m_unk0x14.m_unk0x00 = 5; + PlayAction(GarageScript::c_wgs002nu_RunAnim); + m_unk0x106 = 1; + break; + case 1: + m_state->m_unk0x14.m_unk0x00 = 5; + PlayAction(GarageScript::c_wgs003nu_RunAnim); + m_unk0x106 = 1; + break; + case 2: + m_state->m_unk0x14.m_unk0x00 = 5; + PlayAction(GarageScript::c_wgs004nu_RunAnim); + m_unk0x106 = 1; + break; + default: + m_state->m_unk0x14.m_unk0x00 = 6; + PlayAction(GarageScript::c_wgs008nu_RunAnim); + m_unk0x106 = 1; + m_unk0x104 = 1; + break; + } + comparisonValue = m_state->m_unk0x18; + break; + } + case 2: { + switch (m_state->m_unk0x1a) { + case 0: + m_state->m_unk0x14.m_unk0x00 = 5; + PlayAction(GarageScript::c_wgs006nu_RunAnim); + m_unk0x106 = 1; + break; + case 1: + m_state->m_unk0x14.m_unk0x00 = 5; + PlayAction(GarageScript::c_wgs007nu_RunAnim); + m_unk0x106 = 1; + break; + default: + m_state->m_unk0x14.m_unk0x00 = 6; + PlayAction(GarageScript::c_wgs008nu_RunAnim); + m_unk0x106 = 1; + m_unk0x104 = 1; + break; + } + comparisonValue = m_state->m_unk0x1a; + break; + } + case 3: { + switch (m_state->m_unk0x1c) { + case 0: + m_state->m_unk0x14.m_unk0x00 = 5; + PlayAction(GarageScript::c_wgs012nu_RunAnim); + m_unk0x106 = 1; + break; + case 1: + m_state->m_unk0x14.m_unk0x00 = 5; + PlayAction(GarageScript::c_wgs014nu_RunAnim); + m_unk0x106 = 1; + break; + default: + m_state->m_unk0x14.m_unk0x00 = 6; + FUN_10005590(0x1fe); + m_unk0x106 = 1; + m_unk0x104 = 1; + break; + } + comparisonValue = m_state->m_unk0x1c; + break; + } + case 4: { + switch (m_state->m_unk0x1e) { + case 0: + m_state->m_unk0x14.m_unk0x00 = 5; + PlayAction(GarageScript::c_wgs009nu_RunAnim); + m_unk0x106 = 1; + break; + case 1: + m_state->m_unk0x14.m_unk0x00 = 5; + PlayAction(GarageScript::c_wgs010nu_RunAnim); + m_unk0x106 = 1; + break; + default: + m_state->m_unk0x14.m_unk0x00 = 6; + PlayAction(GarageScript::c_wgs008nu_RunAnim); + m_unk0x106 = 1; + m_unk0x104 = 1; + break; + } + comparisonValue = m_state->m_unk0x1e; + break; + } + case 5: { + switch (m_state->m_unk0x20) { + case 0: + m_state->m_unk0x14.m_unk0x00 = 5; + FUN_10005590(GarageScript::c_wgs020nu_RunAnim); + m_unk0x106 = 1; + break; + case 1: + m_state->m_unk0x14.m_unk0x00 = 5; + FUN_10005590(GarageScript::c_wgs021nu_RunAnim); + m_unk0x106 = 1; + break; + default: + m_state->m_unk0x14.m_unk0x00 = 6; + FUN_10005590(GarageScript::c_wgs022nu_RunAnim); + m_unk0x106 = 1; + m_unk0x104 = 1; + break; + } + comparisonValue = m_state->m_unk0x20; + break; + } + default: { + if (comparisonValue < 5) { + m_state->m_unk0x20++; + } + break; + } + } + + FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); +} + +// OFFSET: LEGO1 0x10005590 +void GasStation::FUN_10005590(undefined4 p_param) { // TODO } +inline void GasStation::PlayAction(MxU32 p_objectId) +{ + MxDSAction action; + action.SetAtomId(*g_garageScript); + action.SetObjectId(p_objectId); + + BackgroundAudioManager()->LowerVolume(); + Start(&action); + m_state->FUN_10006430(p_objectId); +} + // STUB: LEGO1 0x10005660 MxLong GasStation::HandleEndAction(MxEndActionNotificationParam& p_param) {