From 4cccf35d4aea30648d7c708e4aa4e9dab0c21e39 Mon Sep 17 00:00:00 2001 From: jonschz Date: Sat, 15 Feb 2025 09:40:06 +0100 Subject: [PATCH] Refactor non-existent getters --- LEGO1/lego/legoomni/include/legocontrolmanager.h | 2 -- LEGO1/lego/legoomni/src/actors/ambulance.cpp | 6 +++--- LEGO1/lego/legoomni/src/actors/bike.cpp | 6 +++--- LEGO1/lego/legoomni/src/actors/dunebuggy.cpp | 6 +++--- LEGO1/lego/legoomni/src/actors/jetski.cpp | 4 ++-- LEGO1/lego/legoomni/src/actors/motorcycle.cpp | 4 ++-- LEGO1/lego/legoomni/src/actors/radio.cpp | 2 +- LEGO1/lego/legoomni/src/actors/skateboard.cpp | 2 +- LEGO1/lego/legoomni/src/actors/towtrack.cpp | 6 +++--- LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp | 2 +- LEGO1/lego/legoomni/src/race/legoracemap.cpp | 4 ++-- LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp | 4 ++-- LEGO1/lego/legoomni/src/worlds/gasstation.cpp | 4 ++-- LEGO1/lego/legoomni/src/worlds/hospital.cpp | 4 ++-- LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp | 4 ++-- LEGO1/lego/legoomni/src/worlds/isle.cpp | 4 ++-- LEGO1/lego/legoomni/src/worlds/police.cpp | 4 ++-- LEGO1/lego/legoomni/src/worlds/registrationbook.cpp | 6 +++--- LEGO1/lego/legoomni/src/worlds/score.cpp | 6 +++--- 19 files changed, 39 insertions(+), 41 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legocontrolmanager.h b/LEGO1/lego/legoomni/include/legocontrolmanager.h index 233304cf..828a1f6e 100644 --- a/LEGO1/lego/legoomni/include/legocontrolmanager.h +++ b/LEGO1/lego/legoomni/include/legocontrolmanager.h @@ -20,9 +20,7 @@ class LegoControlManagerNotificationParam : public LegoEventNotificationParam { // TODO: Most likely getters/setters are not used according to BETA. - MxS32 GetClickedObjectId() const { return m_clickedObjectId; } const char* GetClickedAtom() const { return m_clickedAtom; } - MxS16 GetUnknown0x28() const { return m_unk0x28; } void SetClickedObjectId(MxS32 p_clickedObjectId) { m_clickedObjectId = p_clickedObjectId; } void SetClickedAtom(const char* p_clickedAtom) { m_clickedAtom = p_clickedAtom; } diff --git a/LEGO1/lego/legoomni/src/actors/ambulance.cpp b/LEGO1/lego/legoomni/src/actors/ambulance.cpp index 4eddcaa2..129b3863 100644 --- a/LEGO1/lego/legoomni/src/actors/ambulance.cpp +++ b/LEGO1/lego/legoomni/src/actors/ambulance.cpp @@ -437,8 +437,8 @@ MxLong Ambulance::HandleControl(LegoControlManagerNotificationParam& p_param) { MxLong result = 0; - if (p_param.GetUnknown0x28() == 1) { - switch (p_param.GetClickedObjectId()) { + if (p_param.m_unk0x28 == 1) { + switch (p_param.m_clickedObjectId) { case IsleScript::c_AmbulanceArms_Ctl: Exit(); GameState()->m_currentArea = LegoGameState::e_unk66; @@ -454,7 +454,7 @@ MxLong Ambulance::HandleControl(LegoControlManagerNotificationParam& p_param) case IsleScript::c_AmbulanceHorn_Ctl: MxSoundPresenter* presenter = (MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "AmbulanceHorn_Sound"); - presenter->Enable(p_param.GetUnknown0x28()); + presenter->Enable(p_param.m_unk0x28); break; } } diff --git a/LEGO1/lego/legoomni/src/actors/bike.cpp b/LEGO1/lego/legoomni/src/actors/bike.cpp index d395c6d9..1bb67774 100644 --- a/LEGO1/lego/legoomni/src/actors/bike.cpp +++ b/LEGO1/lego/legoomni/src/actors/bike.cpp @@ -81,8 +81,8 @@ MxLong Bike::HandleControl(LegoControlManagerNotificationParam& p_param) { MxLong result = 0; - if (p_param.GetUnknown0x28() == 1) { - switch (p_param.GetClickedObjectId()) { + if (p_param.m_unk0x28 == 1) { + switch (p_param.m_clickedObjectId) { case IsleScript::c_BikeArms_Ctl: Exit(); GameState()->m_currentArea = LegoGameState::e_unk66; @@ -97,7 +97,7 @@ MxLong Bike::HandleControl(LegoControlManagerNotificationParam& p_param) case IsleScript::c_BikeHorn_Ctl: MxSoundPresenter* presenter = (MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "BikeHorn_Sound"); - presenter->Enable(p_param.GetUnknown0x28()); + presenter->Enable(p_param.m_unk0x28); break; } } diff --git a/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp b/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp index 2d58ce71..778a65a8 100644 --- a/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp +++ b/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp @@ -121,8 +121,8 @@ MxLong DuneBuggy::HandleControl(LegoControlManagerNotificationParam& p_param) { MxLong result = 0; - if (p_param.GetUnknown0x28() == 1) { - switch (p_param.GetClickedObjectId()) { + if (p_param.m_unk0x28 == 1) { + switch (p_param.m_clickedObjectId) { case IsleScript::c_DuneCarArms_Ctl: Exit(); GameState()->m_currentArea = LegoGameState::e_unk66; @@ -137,7 +137,7 @@ MxLong DuneBuggy::HandleControl(LegoControlManagerNotificationParam& p_param) case IsleScript::c_DuneCarHorn_Ctl: MxSoundPresenter* presenter = (MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "DuneCarHorn_Sound"); - presenter->Enable(p_param.GetUnknown0x28()); + presenter->Enable(p_param.m_unk0x28); break; } } diff --git a/LEGO1/lego/legoomni/src/actors/jetski.cpp b/LEGO1/lego/legoomni/src/actors/jetski.cpp index a045bfa8..bf183014 100644 --- a/LEGO1/lego/legoomni/src/actors/jetski.cpp +++ b/LEGO1/lego/legoomni/src/actors/jetski.cpp @@ -137,8 +137,8 @@ void Jetski::RemoveFromWorld() // FUNCTION: LEGO1 0x1007e8e0 MxLong Jetski::HandleControl(LegoControlManagerNotificationParam& p_param) { - if (p_param.GetUnknown0x28() == 1 && CurrentWorld()->IsA("Isle")) { - switch (p_param.GetClickedObjectId()) { + if (p_param.m_unk0x28 == 1 && CurrentWorld()->IsA("Isle")) { + switch (p_param.m_clickedObjectId) { case IsleScript::c_JetskiArms_Ctl: Exit(); ((IslePathActor*) UserActor()) diff --git a/LEGO1/lego/legoomni/src/actors/motorcycle.cpp b/LEGO1/lego/legoomni/src/actors/motorcycle.cpp index 333f43d4..877ebf21 100644 --- a/LEGO1/lego/legoomni/src/actors/motorcycle.cpp +++ b/LEGO1/lego/legoomni/src/actors/motorcycle.cpp @@ -115,8 +115,8 @@ MxLong Motocycle::HandleControl(LegoControlManagerNotificationParam& p_param) { MxLong result = 0; - if (p_param.GetUnknown0x28() == 1) { - switch (p_param.GetClickedObjectId()) { + if (p_param.m_unk0x28 == 1) { + switch (p_param.m_clickedObjectId) { case IsleScript::c_MotoBikeArms_Ctl: Exit(); GameState()->m_currentArea = LegoGameState::e_unk66; diff --git a/LEGO1/lego/legoomni/src/actors/radio.cpp b/LEGO1/lego/legoomni/src/actors/radio.cpp index 71fbf2bc..310a08b0 100644 --- a/LEGO1/lego/legoomni/src/actors/radio.cpp +++ b/LEGO1/lego/legoomni/src/actors/radio.cpp @@ -144,7 +144,7 @@ void Radio::Stop() MxLong Radio::HandleControl(LegoControlManagerNotificationParam& p_param) { MxDSAction action; // Unused - MxS32 objectId = p_param.GetClickedObjectId(); + MxS32 objectId = p_param.m_clickedObjectId; if (objectId == IsleScript::c_Radio_Ctl) { if (m_state->IsActive()) { diff --git a/LEGO1/lego/legoomni/src/actors/skateboard.cpp b/LEGO1/lego/legoomni/src/actors/skateboard.cpp index 9b4735eb..5aafe1be 100644 --- a/LEGO1/lego/legoomni/src/actors/skateboard.cpp +++ b/LEGO1/lego/legoomni/src/actors/skateboard.cpp @@ -110,7 +110,7 @@ MxLong SkateBoard::HandleControl(LegoControlManagerNotificationParam& p_param) { MxU32 result = 0; - if (p_param.GetUnknown0x28() == 1 && p_param.GetClickedObjectId() == IsleScript::c_SkateArms_Ctl) { + if (p_param.m_unk0x28 == 1 && p_param.m_clickedObjectId == IsleScript::c_SkateArms_Ctl) { Exit(); GameState()->m_currentArea = LegoGameState::Area::e_unk66; result = 1; diff --git a/LEGO1/lego/legoomni/src/actors/towtrack.cpp b/LEGO1/lego/legoomni/src/actors/towtrack.cpp index fb4632e2..5ff5697e 100644 --- a/LEGO1/lego/legoomni/src/actors/towtrack.cpp +++ b/LEGO1/lego/legoomni/src/actors/towtrack.cpp @@ -482,8 +482,8 @@ MxLong TowTrack::HandleControl(LegoControlManagerNotificationParam& p_param) { MxLong result = 0; - if (p_param.GetUnknown0x28() == 1) { - switch (p_param.GetClickedObjectId()) { + if (p_param.m_unk0x28 == 1) { + switch (p_param.m_clickedObjectId) { case IsleScript::c_TowTrackArms_Ctl: Exit(); GameState()->m_currentArea = LegoGameState::e_unk66; @@ -498,7 +498,7 @@ MxLong TowTrack::HandleControl(LegoControlManagerNotificationParam& p_param) break; case IsleScript::c_TowHorn_Ctl: MxSoundPresenter* presenter = (MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "TowHorn_Sound"); - presenter->Enable(p_param.GetUnknown0x28()); + presenter->Enable(p_param.m_unk0x28); break; } } diff --git a/LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp b/LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp index 70578247..691ddb40 100644 --- a/LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp +++ b/LEGO1/lego/legoomni/src/control/legocontrolmanager.cpp @@ -185,7 +185,7 @@ MxBool LegoControlManager::FUN_10029630() while (cursor.Next(presenter)) { if (((MxControlPresenter*) presenter)->FUN_10044480(&m_event, m_unk0x14)) { - g_unk0x100f31b0 = m_event.GetClickedObjectId(); + g_unk0x100f31b0 = m_event.m_clickedObjectId; g_unk0x100f31b4 = m_event.GetClickedAtom(); FUN_100292e0(); m_unk0x08 = 1; diff --git a/LEGO1/lego/legoomni/src/race/legoracemap.cpp b/LEGO1/lego/legoomni/src/race/legoracemap.cpp index 73867608..0606b312 100644 --- a/LEGO1/lego/legoomni/src/race/legoracemap.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracemap.cpp @@ -128,9 +128,9 @@ MxLong LegoRaceMap::Notify(MxParam& p_param) if (param.GetNotification() == c_notificationControl && m_Map_Ctl->GetAction()->GetObjectId() == - ((LegoControlManagerNotificationParam&) p_param).GetClickedObjectId()) { + ((LegoControlManagerNotificationParam&) p_param).m_clickedObjectId) { - if (((LegoControlManagerNotificationParam&) p_param).GetUnknown0x28() == 1) { + if (((LegoControlManagerNotificationParam&) p_param).m_unk0x28 == 1) { m_unk0x08 = TRUE; FUN_1005d4b0(); m_stillPresenter->Enable(TRUE); diff --git a/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp b/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp index d01c9f7c..7affe1c8 100644 --- a/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp +++ b/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp @@ -87,8 +87,8 @@ MxLong ElevatorBottom::HandleControl(LegoControlManagerNotificationParam& p_para { MxLong result = 0; - if (p_param.GetUnknown0x28() == 1) { - switch (p_param.GetClickedObjectId()) { + if (p_param.m_unk0x28 == 1) { + switch (p_param.m_clickedObjectId) { case ElevbottScript::c_LeftArrow_Ctl: m_destLocation = LegoGameState::e_infodoor; TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); diff --git a/LEGO1/lego/legoomni/src/worlds/gasstation.cpp b/LEGO1/lego/legoomni/src/worlds/gasstation.cpp index f9972f07..f83ca18c 100644 --- a/LEGO1/lego/legoomni/src/worlds/gasstation.cpp +++ b/LEGO1/lego/legoomni/src/worlds/gasstation.cpp @@ -387,10 +387,10 @@ MxLong GasStation::HandleButtonDown(LegoControlManagerNotificationParam& p_param // FUNCTION: BETA10 0x10029445 MxLong GasStation::HandleControl(LegoControlManagerNotificationParam& p_param) { - if (p_param.GetUnknown0x28() == 1) { + if (p_param.m_unk0x28 == 1) { MxDSAction action; - switch (p_param.GetClickedObjectId()) { + switch (p_param.m_clickedObjectId) { case GarageScript::c_LeftArrow_Ctl: case GarageScript::c_RightArrow_Ctl: m_state->m_unk0x14 = 0; diff --git a/LEGO1/lego/legoomni/src/worlds/hospital.cpp b/LEGO1/lego/legoomni/src/worlds/hospital.cpp index fbf276dd..c393d117 100644 --- a/LEGO1/lego/legoomni/src/worlds/hospital.cpp +++ b/LEGO1/lego/legoomni/src/worlds/hospital.cpp @@ -553,8 +553,8 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param) // FUNCTION: LEGO1 0x10075f90 MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param) { - if (p_param.GetUnknown0x28() == 1) { - switch (p_param.GetClickedObjectId()) { + if (p_param.m_unk0x28 == 1) { + switch (p_param.m_clickedObjectId) { case HospitalScript::c_Info_Ctl: BackgroundAudioManager()->RaiseVolume(); DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim); diff --git a/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp b/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp index 085d76d7..9931523f 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp @@ -96,10 +96,10 @@ MxLong InfocenterDoor::HandleControl(LegoControlManagerNotificationParam& p_para { MxLong result = 0; - if (p_param.GetUnknown0x28() == 1) { + if (p_param.m_unk0x28 == 1) { DeleteObjects(&m_atomId, InfodoorScript::c_iic037in_PlayWav, 510); - switch (p_param.GetClickedObjectId()) { + switch (p_param.m_clickedObjectId) { case InfodoorScript::c_LeftArrow_Ctl: m_destLocation = LegoGameState::e_infoscor; TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index aeb9be41..7829d6e8 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -289,10 +289,10 @@ void Isle::ReadyWorld() // FUNCTION: LEGO1 0x10031030 MxLong Isle::HandleControl(LegoControlManagerNotificationParam& p_param) { - if (p_param.GetUnknown0x28() == 1) { + if (p_param.m_unk0x28 == 1) { MxDSAction action; - switch (p_param.GetClickedObjectId()) { + switch (p_param.m_clickedObjectId) { case IsleScript::c_ElevRide_Info_Ctl: m_act1state->m_unk0x018 = 2; diff --git a/LEGO1/lego/legoomni/src/worlds/police.cpp b/LEGO1/lego/legoomni/src/worlds/police.cpp index 0a031509..c1298bf3 100644 --- a/LEGO1/lego/legoomni/src/worlds/police.cpp +++ b/LEGO1/lego/legoomni/src/worlds/police.cpp @@ -101,8 +101,8 @@ void Police::ReadyWorld() // FUNCTION: LEGO1 0x1005e550 MxLong Police::HandleControl(LegoControlManagerNotificationParam& p_param) { - if (p_param.GetUnknown0x28() == 1) { - switch (p_param.GetClickedObjectId()) { + if (p_param.m_unk0x28 == 1) { + switch (p_param.m_clickedObjectId) { case PoliceScript::c_LeftArrow_Ctl: case PoliceScript::c_RightArrow_Ctl: if (m_policeState->GetUnknown0x0c() == 1) { diff --git a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp index c1aed0a9..e9a78bd6 100644 --- a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp +++ b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp @@ -226,10 +226,10 @@ MxLong RegistrationBook::HandleKeyPress(MxU8 p_key) // FUNCTION: LEGO1 0x100774a0 MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_param) { - MxS16 unk0x28 = p_param.GetUnknown0x28(); + MxS16 unk0x28 = p_param.m_unk0x28; if (unk0x28 >= 1 && unk0x28 <= 28) { - if (p_param.GetClickedObjectId() == RegbookScript::c_Alphabet_Ctl) { + if (p_param.m_clickedObjectId == RegbookScript::c_Alphabet_Ctl) { if (unk0x28 == 28) { DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); @@ -256,7 +256,7 @@ MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_pa MxS16 i; for (i = 0; i < 10; i++) { - if (m_checkmark[i]->GetAction()->GetObjectId() == p_param.GetClickedObjectId()) { + if (m_checkmark[i]->GetAction()->GetObjectId() == p_param.m_clickedObjectId) { break; } } diff --git a/LEGO1/lego/legoomni/src/worlds/score.cpp b/LEGO1/lego/legoomni/src/worlds/score.cpp index d1547fb8..b5b66d87 100644 --- a/LEGO1/lego/legoomni/src/worlds/score.cpp +++ b/LEGO1/lego/legoomni/src/worlds/score.cpp @@ -165,10 +165,10 @@ void Score::ReadyWorld() // FUNCTION: LEGO1 0x100016d0 MxLong Score::FUN_100016d0(LegoControlManagerNotificationParam& p_param) { - MxS16 unk0x28 = p_param.GetUnknown0x28(); + MxS16 unk0x28 = p_param.m_unk0x28; - if (unk0x28 == 1 || p_param.GetClickedObjectId() == InfoscorScript::c_LegoBox_Ctl) { - switch (p_param.GetClickedObjectId()) { + if (unk0x28 == 1 || p_param.m_clickedObjectId == InfoscorScript::c_LegoBox_Ctl) { + switch (p_param.m_clickedObjectId) { case InfoscorScript::c_LeftArrow_Ctl: m_destLocation = LegoGameState::e_infomain; DeleteScript();