From 30e9e43cda6bc94ddd5835c118dd63491d41c599 Mon Sep 17 00:00:00 2001 From: Christian Semmler <mail@csemmler.com> Date: Mon, 12 Aug 2024 09:21:18 -0700 Subject: [PATCH] Implement/match RegistrationBook::HandlePathStruct (#1084) --- LEGO1/lego/legoomni/include/isle.h | 8 +- .../lego/legoomni/include/registrationbook.h | 3 +- LEGO1/lego/legoomni/src/actors/pizza.cpp | 2 +- LEGO1/lego/legoomni/src/actors/radio.cpp | 2 +- LEGO1/lego/legoomni/src/entity/legoentity.cpp | 4 +- .../legoomni/src/entity/legonavcontroller.cpp | 2 +- LEGO1/lego/legoomni/src/entity/legoworld.cpp | 2 +- LEGO1/lego/legoomni/src/main/legomain.cpp | 4 +- .../legoomni/src/worlds/elevatorbottom.cpp | 2 +- LEGO1/lego/legoomni/src/worlds/gasstation.cpp | 2 +- LEGO1/lego/legoomni/src/worlds/hospital.cpp | 30 +++--- LEGO1/lego/legoomni/src/worlds/infocenter.cpp | 52 +++++------ .../legoomni/src/worlds/infocenterdoor.cpp | 6 +- LEGO1/lego/legoomni/src/worlds/isle.cpp | 40 ++++---- LEGO1/lego/legoomni/src/worlds/police.cpp | 12 +-- .../legoomni/src/worlds/registrationbook.cpp | 92 ++++++++++++++++--- LEGO1/lego/legoomni/src/worlds/score.cpp | 4 +- LEGO1/omni/include/mxentity.h | 23 +++-- 18 files changed, 182 insertions(+), 108 deletions(-) diff --git a/LEGO1/lego/legoomni/include/isle.h b/LEGO1/lego/legoomni/include/isle.h index 485cbf8f..5125cc3d 100644 --- a/LEGO1/lego/legoomni/include/isle.h +++ b/LEGO1/lego/legoomni/include/isle.h @@ -130,19 +130,19 @@ public: LegoNamedTexture* m_unk0x154; // 0x154 LegoNamedTexture* m_unk0x158; // 0x158 LegoNamedTexture* m_unk0x15c; // 0x15c - MxCore* m_unk0x160; // 0x160 + Helicopter* m_helicopter; // 0x160 NamedPlane m_unk0x164; // 0x164 LegoNamedTexture* m_unk0x1b0; // 0x1b0 LegoNamedTexture* m_unk0x1b4; // 0x1b4 - MxCore* m_unk0x1b8; // 0x1b8 + Jetski* m_jetski; // 0x1b8 NamedPlane m_unk0x1bc; // 0x1bc LegoNamedTexture* m_unk0x208; // 0x208 - MxCore* m_unk0x20c; // 0x20c + DuneBuggy* m_dunebuggy; // 0x20c NamedPlane m_unk0x210; // 0x210 LegoNamedTexture* m_unk0x25c; // 0x25c LegoNamedTexture* m_unk0x260; // 0x260 LegoNamedTexture* m_unk0x264; // 0x264 - MxCore* m_unk0x268; // 0x268 + RaceCar* m_racecar; // 0x268 }; // FUNCTION: LEGO1 0x10033a70 diff --git a/LEGO1/lego/legoomni/include/registrationbook.h b/LEGO1/lego/legoomni/include/registrationbook.h index 3fc73929..c405a06b 100644 --- a/LEGO1/lego/legoomni/include/registrationbook.h +++ b/LEGO1/lego/legoomni/include/registrationbook.h @@ -8,6 +8,7 @@ class MxControlPresenter; class MxEndActionNotificationParam; class MxStillPresenter; class LegoControlManagerNotificationParam; +class LegoPathStructNotificationParam; // VTABLE: LEGO1 0x100d9928 // SIZE 0x2d0 @@ -65,7 +66,7 @@ private: MxLong HandleEndAction(MxEndActionNotificationParam& p_param); MxLong HandleKeyPress(MxU8 p_key); MxLong HandleControl(LegoControlManagerNotificationParam& p_param); - MxLong HandleNotification19(MxParam& p_param); + MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param); void FUN_100775c0(MxS16 p_playerIndex); void WriteInfocenterLetters(MxS16); void FUN_100778c0(); diff --git a/LEGO1/lego/legoomni/src/actors/pizza.cpp b/LEGO1/lego/legoomni/src/actors/pizza.cpp index 1ff18396..e634891b 100644 --- a/LEGO1/lego/legoomni/src/actors/pizza.cpp +++ b/LEGO1/lego/legoomni/src/actors/pizza.cpp @@ -36,7 +36,7 @@ MxResult Pizza::Create(MxDSAction& p_dsAction) if (result == SUCCESS) { CreateState(); - m_skateboard = (SkateBoard*) m_world->Find(m_atom, IsleScript::c_SkateBoard_Actor); + m_skateboard = (SkateBoard*) m_world->Find(m_atomId, IsleScript::c_SkateBoard_Actor); } return result; diff --git a/LEGO1/lego/legoomni/src/actors/radio.cpp b/LEGO1/lego/legoomni/src/actors/radio.cpp index 6c3ff702..8d267d5a 100644 --- a/LEGO1/lego/legoomni/src/actors/radio.cpp +++ b/LEGO1/lego/legoomni/src/actors/radio.cpp @@ -126,7 +126,7 @@ void Radio::Stop() if (m_state->IsActive()) { LegoWorld* world = CurrentWorld(); - MxControlPresenter* presenter = (MxControlPresenter*) world->Find(world->GetAtom(), IsleScript::c_Radio_Ctl); + MxControlPresenter* presenter = (MxControlPresenter*) world->Find(world->GetAtomId(), IsleScript::c_Radio_Ctl); if (presenter) { presenter->VTable0x6c(0); diff --git a/LEGO1/lego/legoomni/src/entity/legoentity.cpp b/LEGO1/lego/legoomni/src/entity/legoentity.cpp index f18c689e..f59c83a9 100644 --- a/LEGO1/lego/legoomni/src/entity/legoentity.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoentity.cpp @@ -80,8 +80,8 @@ void LegoEntity::SetWorldTransform(const Vector3& p_location, const Vector3& p_d // FUNCTION: LEGO1 0x100107e0 MxResult LegoEntity::Create(MxDSAction& p_dsAction) { - m_mxEntityId = p_dsAction.GetObjectId(); - m_atom = p_dsAction.GetAtomId(); + m_entityId = p_dsAction.GetObjectId(); + m_atomId = p_dsAction.GetAtomId(); SetWorld(); return SUCCESS; } diff --git a/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp b/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp index 01facf17..100d1659 100644 --- a/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp +++ b/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp @@ -689,7 +689,7 @@ MxLong LegoNavController::Notify(MxParam& p_param) if (world) { MxDSAction action; action.SetObjectId(1); - action.SetAtomId(world->GetAtom()); + action.SetAtomId(world->GetAtomId()); LegoOmni::GetInstance()->Start(&action); } } diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index dce201c0..fd449d52 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -608,7 +608,7 @@ MxCore* LegoWorld::Find(const MxAtomId& p_atom, MxS32 p_entityId) LegoEntity* entity; while (entityCursor.Next(entity)) { - if (entity->GetAtom() == p_atom && entity->GetEntityId() == p_entityId) { + if (entity->GetAtomId() == p_atom && entity->GetEntityId() == p_entityId) { return entity; } } diff --git a/LEGO1/lego/legoomni/src/main/legomain.cpp b/LEGO1/lego/legoomni/src/main/legomain.cpp index 62a927ff..4244c5bb 100644 --- a/LEGO1/lego/legoomni/src/main/legomain.cpp +++ b/LEGO1/lego/legoomni/src/main/legomain.cpp @@ -346,7 +346,7 @@ void LegoOmni::RemoveWorld(const MxAtomId& p_atom, MxLong p_objectId) b.Next(); if ((p_objectId == -1 || world->GetEntityId() == p_objectId) && - (!p_atom.GetInternal() || world->GetAtom() == p_atom)) { + (!p_atom.GetInternal() || world->GetAtomId() == p_atom)) { a.Detach(); delete world; } @@ -365,7 +365,7 @@ LegoWorld* LegoOmni::FindWorld(const MxAtomId& p_atom, MxS32 p_entityid) while (cursor.Next(world)) { if ((p_entityid == -1 || world->GetEntityId() == p_entityid) && - (!p_atom.GetInternal() || world->GetAtom() == p_atom)) { + (!p_atom.GetInternal() || world->GetAtomId() == p_atom)) { return world; } } diff --git a/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp b/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp index 30a33b03..cfe25812 100644 --- a/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp +++ b/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp @@ -135,7 +135,7 @@ void ElevatorBottom::Enable(MxBool p_enable) // FUNCTION: LEGO1 0x10018310 MxBool ElevatorBottom::Escape() { - DeleteObjects(&m_atom, ElevbottScript::c_iica31in_PlayWav, 999); + DeleteObjects(&m_atomId, ElevbottScript::c_iica31in_PlayWav, 999); m_destLocation = LegoGameState::e_infomain; return TRUE; } diff --git a/LEGO1/lego/legoomni/src/worlds/gasstation.cpp b/LEGO1/lego/legoomni/src/worlds/gasstation.cpp index c71db07c..453b0862 100644 --- a/LEGO1/lego/legoomni/src/worlds/gasstation.cpp +++ b/LEGO1/lego/legoomni/src/worlds/gasstation.cpp @@ -309,7 +309,7 @@ MxLong GasStation::HandleEndAction(MxEndActionNotificationParam& p_param) if (result == 0) { MxDSAction* action = p_param.GetAction(); - if (action->GetAtomId() == m_atom && action->GetObjectId()) { + if (action->GetAtomId() == m_atomId && action->GetObjectId()) { m_state->FUN_10006460((GarageScript::Script) action->GetObjectId()); m_unk0x106 = 0; diff --git a/LEGO1/lego/legoomni/src/worlds/hospital.cpp b/LEGO1/lego/legoomni/src/worlds/hospital.cpp index 550818f3..2bf024f2 100644 --- a/LEGO1/lego/legoomni/src/worlds/hospital.cpp +++ b/LEGO1/lego/legoomni/src/worlds/hospital.cpp @@ -227,7 +227,7 @@ MxLong Hospital::HandleKeyPress(MxS8 p_key) MxLong result = 0; if (p_key == VK_SPACE && g_unk0x100f7918 == 0) { - DeleteObjects(&m_atom, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); + DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); result = 1; } @@ -241,7 +241,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param) MxDSAction* action = p_param.GetAction(); Act1State* act1State; - if (action->GetAtomId() != m_atom) { + if (action->GetAtomId() != m_atomId) { return result; } @@ -375,7 +375,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param) m_unk0x128 = 1; m_destLocation = LegoGameState::e_unk31; - DeleteObjects(&m_atom, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); + DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } break; @@ -384,7 +384,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param) m_unk0x128 = 1; m_destLocation = LegoGameState::e_infomain; - DeleteObjects(&m_atom, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); + DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } break; @@ -425,7 +425,11 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param) act1State->SetUnknown18(9); m_destLocation = LegoGameState::e_unk31; - DeleteObjects(&m_atom, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); + DeleteObjects( + &m_atomId, + HospitalScript::c_hho002cl_RunAnim, + HospitalScript::c_hho006cl_RunAnim + ); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } } @@ -434,7 +438,11 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param) m_hospitalState->m_unk0x08.m_unk0x00 = 11; BackgroundAudioManager()->RaiseVolume(); - DeleteObjects(&m_atom, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); + DeleteObjects( + &m_atomId, + HospitalScript::c_hho002cl_RunAnim, + HospitalScript::c_hho006cl_RunAnim + ); } else { switch (m_currentActorId) { @@ -558,7 +566,7 @@ MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param) switch (p_param.GetClickedObjectId()) { case HospitalScript::c_Info_Ctl: BackgroundAudioManager()->RaiseVolume(); - DeleteObjects(&m_atom, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); + DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); if (m_unk0x100 == 1) { m_hospitalState->m_unk0x08.m_unk0x00 = 14; @@ -572,14 +580,14 @@ MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param) m_hospitalState->m_unk0x08.m_unk0x00 = 13; m_destLocation = LegoGameState::e_infomain; - DeleteObjects(&m_atom, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); + DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } break; case HospitalScript::c_Door_Ctl: - DeleteObjects(&m_atom, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); + DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); if (m_unk0x100 == 1) { m_hospitalState->m_unk0x08.m_unk0x00 = 15; @@ -593,7 +601,7 @@ MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param) m_hospitalState->m_unk0x08.m_unk0x00 = 13; m_destLocation = LegoGameState::e_unk31; - DeleteObjects(&m_atom, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); + DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } @@ -664,7 +672,7 @@ MxResult Hospital::Tickle() // FUNCTION: LEGO1 0x10076330 MxBool Hospital::Escape() { - DeleteObjects(&m_atom, HospitalScript::c_hho002cl_RunAnim, 999); + DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, 999); m_hospitalState->m_unk0x08.m_unk0x00 = 0; m_destLocation = LegoGameState::e_infomain; diff --git a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp index d88fe79b..48e04d38 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp @@ -285,11 +285,11 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param) return 1; } - if (action->GetAtomId() == m_atom && (action->GetObjectId() == InfomainScript::c_Mama_All_Movie || - action->GetObjectId() == InfomainScript::c_Papa_All_Movie || - action->GetObjectId() == InfomainScript::c_Pepper_All_Movie || - action->GetObjectId() == InfomainScript::c_Nick_All_Movie || - action->GetObjectId() == InfomainScript::c_Laura_All_Movie)) { + if (action->GetAtomId() == m_atomId && (action->GetObjectId() == InfomainScript::c_Mama_All_Movie || + action->GetObjectId() == InfomainScript::c_Papa_All_Movie || + action->GetObjectId() == InfomainScript::c_Pepper_All_Movie || + action->GetObjectId() == InfomainScript::c_Nick_All_Movie || + action->GetObjectId() == InfomainScript::c_Laura_All_Movie)) { if (m_unk0x1d4) { m_unk0x1d4--; } @@ -324,7 +324,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param) MxLong result = m_radio.Notify(p_param); - if (result || (action->GetAtomId() != m_atom && action->GetAtomId() != *g_introScript)) { + if (result || (action->GetAtomId() != m_atomId && action->GetAtomId() != *g_introScript)) { return result; } @@ -614,21 +614,21 @@ void Infocenter::InitializeBitmaps() { m_radio.Initialize(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_LeftArrow_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_RightArrow_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Info_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Boat_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Race_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Pizza_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Gas_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Med_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Cop_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Mama_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Papa_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Pepper_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Nick_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Laura_Ctl))->Enable(TRUE); - ((MxPresenter*) Find(m_atom, InfomainScript::c_Radio_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_LeftArrow_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_RightArrow_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Info_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Boat_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Race_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Pizza_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Gas_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Med_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Cop_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Mama_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Papa_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Pepper_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Nick_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Laura_Ctl))->Enable(TRUE); + ((MxPresenter*) Find(m_atomId, InfomainScript::c_Radio_Ctl))->Enable(TRUE); m_mapAreas[0].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Info_A_Bitmap"); m_mapAreas[0].m_area.SetLeft(391); @@ -1120,7 +1120,7 @@ MxU8 Infocenter::HandleControl(LegoControlManagerNotificationParam& p_param) } if (characterBitmap != InfomainScript::c_noneInfomain) { - m_unk0x11c = (MxStillPresenter*) Find(m_atom, characterBitmap); + m_unk0x11c = (MxStillPresenter*) Find(m_atomId, characterBitmap); } } @@ -1241,16 +1241,16 @@ MxResult Infocenter::Tickle() m_unk0x1d6 += 100; if (m_unk0x1d6 > 3400 && m_unk0x1d6 < 3650) { - ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atom.GetInternal(), 1); + ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 1); } else if (m_unk0x1d6 > 3650 && m_unk0x1d6 < 3900) { - ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atom.GetInternal(), 0); + ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 0); } else if (m_unk0x1d6 > 3900 && m_unk0x1d6 < 4150) { - ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atom.GetInternal(), 1); + ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 1); } else if (m_unk0x1d6 > 4400) { - ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atom.GetInternal(), 0); + ControlManager()->FUN_100293c0(InfomainScript::c_BigInfo_Ctl, m_atomId.GetInternal(), 0); m_unk0x1d6 = 0; } } diff --git a/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp b/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp index f2812ecf..4b6d7850 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp @@ -63,7 +63,7 @@ MxLong InfocenterDoor::Notify(MxParam& p_param) if (m_worldStarted) { switch (((MxNotificationParam&) p_param).GetNotification()) { case c_notificationEndAction: - if (((MxEndActionNotificationParam&) p_param).GetAction()->GetAtomId() == m_atom) { + if (((MxEndActionNotificationParam&) p_param).GetAction()->GetAtomId() == m_atomId) { BackgroundAudioManager()->RaiseVolume(); result = 1; } @@ -95,7 +95,7 @@ MxLong InfocenterDoor::HandleControl(LegoControlManagerNotificationParam& p_para MxLong result = 0; if (p_param.GetUnknown0x28() == 1) { - DeleteObjects(&m_atom, InfodoorScript::c_iic037in_PlayWav, 510); + DeleteObjects(&m_atomId, InfodoorScript::c_iic037in_PlayWav, 510); switch (p_param.GetClickedObjectId()) { case InfodoorScript::c_LeftArrow_Ctl: @@ -167,7 +167,7 @@ void InfocenterDoor::Enable(MxBool p_enable) // FUNCTION: LEGO1 0x10037cd0 MxBool InfocenterDoor::Escape() { - DeleteObjects(&m_atom, InfodoorScript::c_iic037in_PlayWav, 510); + DeleteObjects(&m_atomId, InfodoorScript::c_iic037in_PlayWav, 510); m_destLocation = LegoGameState::e_infomain; return TRUE; } diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index cc759ea8..13ea3cbf 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -894,7 +894,7 @@ void Isle::FUN_10032620() MxLong Isle::HandleTransitionEnd() { InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_Avo917In_PlayWav, NULL); - DeleteObjects(&m_atom, IsleScript::c_Avo900Ps_PlayWav, IsleScript::c_Avo907Ps_PlayWav); + DeleteObjects(&m_atomId, IsleScript::c_Avo900Ps_PlayWav, IsleScript::c_Avo907Ps_PlayWav); if (m_destLocation != LegoGameState::e_skateboard) { m_act1state->m_unk0x018 = 0; @@ -915,7 +915,7 @@ MxLong Isle::HandleTransitionEnd() FUN_10032d30(IsleScript::c_ElevRide_Background_Bitmap, JukeboxScript::c_Elevator_Music, "LCAMZI2,90", FALSE); if (m_destLocation == LegoGameState::e_undefined) { - ((MxStillPresenter*) Find(m_atom, IsleScript::c_Meter3_Bitmap))->Enable(TRUE); + ((MxStillPresenter*) Find(m_atomId, IsleScript::c_Meter3_Bitmap))->Enable(TRUE); } break; case LegoGameState::e_elevopen: @@ -1064,7 +1064,7 @@ void Isle::FUN_10032d30( ) { if (m_act1state->m_unk0x01f) { - MxPresenter* presenter = (MxPresenter*) Find(m_atom, p_script); + MxPresenter* presenter = (MxPresenter*) Find(m_atomId, p_script); if (presenter != NULL && presenter->GetCurrentTickleState() == MxPresenter::e_repeating) { if (p_music != JukeboxScript::c_MusicTheme1) { @@ -1216,7 +1216,7 @@ MxBool Isle::Escape() m_act1state->m_elevFloor = Act1State::c_floor1; AnimationManager()->FUN_10061010(FALSE); - DeleteObjects(&m_atom, IsleScript::c_sba001bu_RunAnim, IsleScript::c_FNS018EN_Wav_518); + DeleteObjects(&m_atomId, IsleScript::c_sba001bu_RunAnim, IsleScript::c_FNS018EN_Wav_518); if (UserActor()) { if (UserActor()->GetActorId() != GameState()->GetActorId()) { @@ -1297,19 +1297,19 @@ Act1State::Act1State() : m_unk0x00c(0), m_unk0x00e(0), m_unk0x008(NULL), m_unk0x m_unk0x154 = NULL; m_unk0x158 = NULL; m_unk0x15c = NULL; - m_unk0x160 = NULL; + m_helicopter = NULL; m_unk0x1b0 = NULL; m_unk0x021 = 1; m_elevFloor = Act1State::c_floor1; m_unk0x00c = sizeOfArray(g_unk0x100f37f0); m_unk0x1b4 = NULL; - m_unk0x1b8 = NULL; + m_jetski = NULL; m_unk0x208 = NULL; - m_unk0x20c = NULL; + m_dunebuggy = NULL; m_unk0x25c = NULL; m_unk0x260 = NULL; m_unk0x264 = NULL; - m_unk0x268 = NULL; + m_racecar = NULL; SetFlag(); } @@ -1491,9 +1491,9 @@ MxBool Act1State::SetFlag() m_unk0x15c = NULL; } - if (m_unk0x160) { - delete m_unk0x160; - m_unk0x160 = NULL; + if (m_helicopter) { + delete m_helicopter; + m_helicopter = NULL; } m_unk0x164.SetName(""); @@ -1508,9 +1508,9 @@ MxBool Act1State::SetFlag() m_unk0x1b4 = NULL; } - if (m_unk0x1b8) { - delete m_unk0x1b8; - m_unk0x1b8 = NULL; + if (m_jetski) { + delete m_jetski; + m_jetski = NULL; } m_unk0x1bc.SetName(""); @@ -1520,9 +1520,9 @@ MxBool Act1State::SetFlag() m_unk0x208 = NULL; } - if (m_unk0x20c) { - delete m_unk0x20c; - m_unk0x20c = NULL; + if (m_dunebuggy) { + delete m_dunebuggy; + m_dunebuggy = NULL; } m_unk0x210.SetName(""); @@ -1542,9 +1542,9 @@ MxBool Act1State::SetFlag() m_unk0x264 = NULL; } - if (m_unk0x268) { - delete m_unk0x268; - m_unk0x268 = NULL; + if (m_racecar) { + delete m_racecar; + m_racecar = NULL; } return TRUE; diff --git a/LEGO1/lego/legoomni/src/worlds/police.cpp b/LEGO1/lego/legoomni/src/worlds/police.cpp index e5e09a1c..cf7bb0f8 100644 --- a/LEGO1/lego/legoomni/src/worlds/police.cpp +++ b/LEGO1/lego/legoomni/src/worlds/police.cpp @@ -110,7 +110,7 @@ MxLong Police::HandleControl(LegoControlManagerNotificationParam& p_param) case PoliceScript::c_LeftArrow_Ctl: case PoliceScript::c_RightArrow_Ctl: if (m_policeState->GetUnknown0x0c() == 1) { - DeleteObjects(&m_atom, PoliceScript::c_nps001ni_RunAnim, PoliceScript::c_nps002la_RunAnim); + DeleteObjects(&m_atomId, PoliceScript::c_nps001ni_RunAnim, PoliceScript::c_nps002la_RunAnim); } BackgroundAudioManager()->Stop(); @@ -119,7 +119,7 @@ MxLong Police::HandleControl(LegoControlManagerNotificationParam& p_param) break; case PoliceScript::c_Info_Ctl: if (m_policeState->GetUnknown0x0c() == 1) { - DeleteObjects(&m_atom, PoliceScript::c_nps001ni_RunAnim, PoliceScript::c_nps002la_RunAnim); + DeleteObjects(&m_atomId, PoliceScript::c_nps001ni_RunAnim, PoliceScript::c_nps002la_RunAnim); } BackgroundAudioManager()->Stop(); @@ -128,7 +128,7 @@ MxLong Police::HandleControl(LegoControlManagerNotificationParam& p_param) break; case PoliceScript::c_Door_Ctl: if (m_policeState->GetUnknown0x0c() == 1) { - DeleteObjects(&m_atom, PoliceScript::c_nps001ni_RunAnim, PoliceScript::c_nps002la_RunAnim); + DeleteObjects(&m_atomId, PoliceScript::c_nps001ni_RunAnim, PoliceScript::c_nps002la_RunAnim); } BackgroundAudioManager()->Stop(); @@ -148,7 +148,7 @@ MxLong Police::HandleEndAction(MxEndActionNotificationParam& p_param) { MxDSAction* action = p_param.GetAction(); - if (m_radio.Notify(p_param) == 0 && m_atom == action->GetAtomId()) { + if (m_radio.Notify(p_param) == 0 && m_atomId == action->GetAtomId()) { if (m_policeState->GetUnknown0x0c() == 1) { m_policeState->SetUnknown0x0c(0); return 1; @@ -166,7 +166,7 @@ MxLong Police::HandleKeyPress(LegoEventNotificationParam& p_param) MxLong result = 0; if (p_param.GetKey() == VK_SPACE && m_policeState->GetUnknown0x0c() == 1) { - DeleteObjects(&m_atom, PoliceScript::c_nps001ni_RunAnim, PoliceScript::c_nps002la_RunAnim); + DeleteObjects(&m_atomId, PoliceScript::c_nps001ni_RunAnim, PoliceScript::c_nps002la_RunAnim); m_policeState->SetUnknown0x0c(0); return 1; } @@ -193,7 +193,7 @@ void Police::Enable(MxBool p_enable) // FUNCTION: LEGO1 0x1005e790 MxBool Police::Escape() { - DeleteObjects(&m_atom, PoliceScript::c_nps001ni_RunAnim, 510); + DeleteObjects(&m_atomId, PoliceScript::c_nps001ni_RunAnim, 510); m_destLocation = LegoGameState::e_infomain; return TRUE; } diff --git a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp index 430abcc7..234903bf 100644 --- a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp +++ b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp @@ -1,10 +1,18 @@ #include "registrationbook.h" +#include "copter_actions.h" +#include "dunebuggy.h" +#include "dunecar_actions.h" +#include "helicopter.h" #include "infocenter.h" +#include "isle.h" +#include "jetski.h" +#include "jetski_actions.h" #include "jukebox_actions.h" #include "legocontrolmanager.h" #include "legogamestate.h" #include "legoinputmanager.h" +#include "legopathstruct.h" #include "misc.h" #include "mxactionnotificationparam.h" #include "mxbackgroundaudiomanager.h" @@ -15,6 +23,8 @@ #include "mxstillpresenter.h" #include "mxtimer.h" #include "mxtransitionmanager.h" +#include "racecar.h" +#include "racecar_actions.h" #include "regbook_actions.h" #include "scripts.h" @@ -44,7 +54,7 @@ RegistrationBook::RegistrationBook() : m_registerDialogueTimer(0x80000000), m_un NotificationManager()->Register(this); - m_unk0x2c1 = 0; + m_unk0x2c1 = FALSE; m_checkboxHilite = NULL; m_checkboxSurface = NULL; m_checkboxNormal = NULL; @@ -118,7 +128,7 @@ MxLong RegistrationBook::Notify(MxParam& p_param) result = HandleControl((LegoControlManagerNotificationParam&) p_param); break; case c_notificationPathStruct: - result = HandleNotification19(p_param); + result = HandlePathStruct((LegoPathStructNotificationParam&) p_param); break; case c_notificationTransitioned: GameState()->SwitchArea(LegoGameState::e_infomain); @@ -132,13 +142,13 @@ MxLong RegistrationBook::Notify(MxParam& p_param) // FUNCTION: LEGO1 0x10077210 MxLong RegistrationBook::HandleEndAction(MxEndActionNotificationParam& p_param) { - if (p_param.GetAction()->GetAtomId() != m_atom) { + if (p_param.GetAction()->GetAtomId() != m_atomId) { return 0; } switch ((MxS32) p_param.GetAction()->GetObjectId()) { case RegbookScript::c_Textures: - m_unk0x2c1 = 0; + m_unk0x2c1 = FALSE; if (m_unk0x2b8 == 0) { TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); @@ -168,7 +178,7 @@ MxLong RegistrationBook::HandleKeyPress(MxU8 p_key) if ((key < 'A' || key > 'Z') && key != VK_BACK) { if (key == VK_SPACE) { - DeleteObjects(&m_atom, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); + DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); BackgroundAudioManager()->RaiseVolume(); } } @@ -217,7 +227,7 @@ MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_pa if (unk0x28 >= 1 && unk0x28 <= 28) { if (p_param.GetClickedObjectId() == RegbookScript::c_Alphabet_Ctl) { if (unk0x28 == 28) { - DeleteObjects(&m_atom, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); + DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { m_infocenterState->SetUnknown0x74(15); @@ -238,7 +248,7 @@ MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_pa } else { InputManager()->DisableInputProcessing(); - DeleteObjects(&m_atom, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); + DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); MxS16 i; for (i = 0; i < 10; i++) { @@ -278,7 +288,7 @@ void RegistrationBook::FUN_100775c0(MxS16 p_playerIndex) PlayAction(RegbookScript::c_Textures); - m_unk0x2c1 = 1; + m_unk0x2c1 = TRUE; // TOOD: structure incorrect GameState()->AddPlayer(*(LegoGameState::Username*) &m_unk0x280.m_letters); @@ -293,7 +303,7 @@ void RegistrationBook::FUN_100775c0(MxS16 p_playerIndex) PlayAction(RegbookScript::c_Textures); - m_unk0x2c1 = 1; + m_unk0x2c1 = TRUE; GameState()->SwitchPlayer(player); @@ -304,8 +314,8 @@ void RegistrationBook::FUN_100775c0(MxS16 p_playerIndex) } m_infocenterState->SetUnknown0x74(4); - if (m_unk0x2b8 == 0 && m_unk0x2c1 == 0) { - DeleteObjects(&m_atom, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); + if (m_unk0x2b8 == 0 && !m_unk0x2c1) { + DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } } @@ -454,10 +464,62 @@ void RegistrationBook::Enable(MxBool p_enable) } } -// STUB: LEGO1 0x100781d0 -MxLong RegistrationBook::HandleNotification19(MxParam& p_param) +// FUNCTION: LEGO1 0x100781d0 +MxLong RegistrationBook::HandlePathStruct(LegoPathStructNotificationParam& p_param) { - return 0; + LegoPathActor* actor = NULL; + Act1State* act1state = (Act1State*) GameState()->GetState("Act1State"); + + switch (p_param.GetData()) { + case CopterScript::c_Helicopter_Actor: + actor = (LegoPathActor*) Find(m_atomId, CopterScript::c_Helicopter_Actor); + act1state->m_helicopter = (Helicopter*) actor; + if (actor != NULL) { + actor->SetAtomId(*g_copterScript); + actor->SetEntityId(CopterScript::c_Helicopter_Actor); + } + break; + case DunecarScript::c_DuneBugy_Actor: + actor = (LegoPathActor*) Find(m_atomId, DunecarScript::c_DuneBugy_Actor); + act1state->m_dunebuggy = (DuneBuggy*) actor; + if (actor != NULL) { + actor->SetAtomId(*g_dunecarScript); + actor->SetEntityId(DunecarScript::c_DuneBugy_Actor); + } + break; + case JetskiScript::c_Jetski_Actor: + actor = (LegoPathActor*) Find(m_atomId, JetskiScript::c_Jetski_Actor); + act1state->m_jetski = (Jetski*) actor; + if (actor != NULL) { + actor->SetAtomId(*g_jetskiScript); + actor->SetEntityId(JetskiScript::c_Jetski_Actor); + } + break; + case RacecarScript::c_RaceCar_Actor: + actor = (LegoPathActor*) Find(m_atomId, RacecarScript::c_RaceCar_Actor); + act1state->m_racecar = (RaceCar*) actor; + if (actor != NULL) { + actor->SetAtomId(*g_racecarScript); + actor->SetEntityId(RacecarScript::c_RaceCar_Actor); + } + break; + } + + if (actor == NULL) { + NotificationManager()->Send(this, p_param); + } + else { + RemoveActor(actor); + Remove(actor); + m_unk0x2b8--; + } + + if (m_unk0x2b8 == 0 && !m_unk0x2c1) { + DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); + TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); + } + + return 1; } // FUNCTION: LEGO1 0x10078350 @@ -495,6 +557,6 @@ MxBool RegistrationBook::CreateSurface() // FUNCTION: LEGO1 0x100783e0 MxBool RegistrationBook::Escape() { - DeleteObjects(&m_atom, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); + DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); return TRUE; } diff --git a/LEGO1/lego/legoomni/src/worlds/score.cpp b/LEGO1/lego/legoomni/src/worlds/score.cpp index aba65f4a..db9a24ec 100644 --- a/LEGO1/lego/legoomni/src/worlds/score.cpp +++ b/LEGO1/lego/legoomni/src/worlds/score.cpp @@ -125,7 +125,7 @@ MxLong Score::FUN_10001510(MxEndActionNotificationParam& p_param) { MxDSAction* action = p_param.GetAction(); - if (m_atom == action->GetAtomId()) { + if (m_atomId == action->GetAtomId()) { switch (action->GetObjectId()) { case InfoscorScript::c_GoTo_HistBook: m_destLocation = LegoGameState::e_histbook; @@ -148,7 +148,7 @@ void Score::ReadyWorld() MxDSAction action; action.SetObjectId(InfoscorScript::c_nin001pr_RunAnim); - action.SetAtomId(m_atom); + action.SetAtomId(m_atomId); action.SetUnknown84(this); Start(&action); diff --git a/LEGO1/omni/include/mxentity.h b/LEGO1/omni/include/mxentity.h index 75891d75..cf16ad07 100644 --- a/LEGO1/omni/include/mxentity.h +++ b/LEGO1/omni/include/mxentity.h @@ -12,7 +12,7 @@ class MxEntity : public MxCore { public: // FUNCTION: LEGO1 0x1001d190 - MxEntity() { this->m_mxEntityId = -1; } + MxEntity() { m_entityId = -1; } // FUNCTION: LEGO1 0x1000c110 ~MxEntity() override {} @@ -31,29 +31,32 @@ public: } // FUNCTION: LEGO1 0x10001070 - virtual MxResult Create(MxS32 p_id, const MxAtomId& p_atom) + virtual MxResult Create(MxS32 p_entityId, const MxAtomId& p_atomId) { - this->m_mxEntityId = p_id; - this->m_atom = p_atom; + m_entityId = p_entityId; + m_atomId = p_atomId; return SUCCESS; } // vtable+0x14 MxResult Create(MxDSAction& p_dsAction) { - m_mxEntityId = p_dsAction.GetObjectId(); - m_atom = p_dsAction.GetAtomId(); + m_entityId = p_dsAction.GetObjectId(); + m_atomId = p_dsAction.GetAtomId(); return SUCCESS; } - MxS32 GetEntityId() { return m_mxEntityId; } - MxAtomId& GetAtom() { return m_atom; } + MxS32 GetEntityId() { return m_entityId; } + MxAtomId& GetAtomId() { return m_atomId; } + + void SetEntityId(MxS32 p_entityId) { m_entityId = p_entityId; } + void SetAtomId(const MxAtomId& p_atomId) { m_atomId = p_atomId; } // SYNTHETIC: LEGO1 0x1000c210 // MxEntity::`scalar deleting destructor' protected: - MxS32 m_mxEntityId; // 0x08 - MxAtomId m_atom; // 0x0c + MxS32 m_entityId; // 0x08 + MxAtomId m_atomId; // 0x0c }; #endif // MXENTITY_H