From db90807d536f4be299071171ae5e6d3d6e46f0c4 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 24 May 2024 13:07:45 -0400 Subject: [PATCH] Implement/match LegoPathActor::ParseAction (#946) * Implement/match LegoPathActor::ParseAction * Fix naming * Space --- LEGO1/define.cpp | 12 +++++ LEGO1/define.h | 3 ++ LEGO1/lego/legoomni/include/isle.h | 2 +- LEGO1/lego/legoomni/include/islepathactor.h | 2 +- LEGO1/lego/legoomni/include/legomain.h | 8 +-- LEGO1/lego/legoomni/include/legopathactor.h | 2 +- LEGO1/lego/legoomni/include/legoworld.h | 1 - LEGO1/lego/legoomni/include/misc.h | 6 +-- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 13 ++--- .../legoomni/src/actors/islepathactor.cpp | 2 +- .../legoomni/src/actors/jukeboxentity.cpp | 2 +- LEGO1/lego/legoomni/src/actors/skateboard.cpp | 2 +- .../src/common/legoanimationmanager.cpp | 10 ++-- .../src/common/legoanimmmpresenter.cpp | 2 +- .../legoomni/src/common/legogamestate.cpp | 28 ++++++----- LEGO1/lego/legoomni/src/common/misc.cpp | 4 +- LEGO1/lego/legoomni/src/entity/legoworld.cpp | 3 +- .../src/gasstation/gasstationentity.cpp | 2 +- .../legoomni/src/hospital/hospitalentity.cpp | 2 +- .../src/infocenter/infocenterentity.cpp | 2 +- .../legoomni/src/isle/beachhouseentity.cpp | 2 +- .../lego/legoomni/src/paths/legopathactor.cpp | 48 ++++++++++++++++-- .../lego/legoomni/src/police/policeentity.cpp | 2 +- .../legoomni/src/race/racestandsentity.cpp | 2 +- LEGO1/lego/legoomni/src/worlds/isle.cpp | 50 ++++++++++--------- 25 files changed, 137 insertions(+), 75 deletions(-) diff --git a/LEGO1/define.cpp b/LEGO1/define.cpp index 89d70dd0..0c04bb50 100644 --- a/LEGO1/define.cpp +++ b/LEGO1/define.cpp @@ -20,6 +20,10 @@ const char* g_strAUTO_CREATE = "AUTO_CREATE"; // STRING: LEGO1 0x10102000 const char* g_strBOTTOM_TO_TOP = "BOTTOM_TO_TOP"; +// GLOBAL: LEGO1 0x10102060 +// STRING: LEGO1 0x10101ff4 +const char* g_strCOLLIDEBOX = "COLLIDEBOX"; + // GLOBAL: LEGO1 0x10102064 // STRING: LEGO1 0x10101fec const char* g_strSTYLE = "STYLE"; @@ -68,6 +72,14 @@ const char* g_strMUST_SUCCEED = "MUST_SUCCEED"; // STRING: LEGO1 0x10101f58 const char* g_strOBJECT = "OBJECT"; +// GLOBAL: LEGO1 0x101020a0 +// STRING: LEGO1 0x10101f50 +const char* g_strPATH = "PATH"; + +// GLOBAL: LEGO1 0x101020a4 +// STRING: LEGO1 0x10101f40 +const char* g_strPERMIT_NAVIGATE = "PERMIT_NAVIGATE"; + // GLOBAL: LEGO1 0x101020a8 // STRING: LEGO1 0x10101f38 const char* g_strPTATCAM = "PTATCAM"; diff --git a/LEGO1/define.h b/LEGO1/define.h index 9bb1962a..a73a80f8 100644 --- a/LEGO1/define.h +++ b/LEGO1/define.h @@ -34,5 +34,8 @@ extern const char* g_strVARIABLE; extern const char* g_strBMP_ISMAP; extern const char* g_strAUTO_CREATE; extern const char* g_strDB_CREATE; +extern const char* g_strPERMIT_NAVIGATE; +extern const char* g_strPATH; +extern const char* g_strCOLLIDEBOX; #endif // DEFINE_H diff --git a/LEGO1/lego/legoomni/include/isle.h b/LEGO1/lego/legoomni/include/isle.h index 76971271..ae7e1af7 100644 --- a/LEGO1/lego/legoomni/include/isle.h +++ b/LEGO1/lego/legoomni/include/isle.h @@ -59,7 +59,7 @@ class Isle : public LegoWorld { MxBool VTable0x64() override; // vtable+64 void Enable(MxBool p_enable) override; // vtable+68 - virtual void VTable0x6c(IslePathActor* p_actor); // vtable+6c + virtual void VTable0x6c(LegoPathActor* p_actor); // vtable+6c MxLong HandleEndAction(MxEndActionNotificationParam& p_param); MxLong HandleClick(LegoControlManagerEvent& p_param); diff --git a/LEGO1/lego/legoomni/include/islepathactor.h b/LEGO1/lego/legoomni/include/islepathactor.h index 6a2c1e78..1b795be0 100644 --- a/LEGO1/lego/legoomni/include/islepathactor.h +++ b/LEGO1/lego/legoomni/include/islepathactor.h @@ -137,7 +137,7 @@ class IslePathActor : public LegoPathActor { protected: LegoWorld* m_world; // 0x154 - IslePathActor* m_unk0x158; // 0x158 + LegoPathActor* m_unk0x158; // 0x158 MxFloat m_unk0x15c; // 0x15c }; diff --git a/LEGO1/lego/legoomni/include/legomain.h b/LEGO1/lego/legoomni/include/legomain.h index 1d2191d5..4a2fad65 100644 --- a/LEGO1/lego/legoomni/include/legomain.h +++ b/LEGO1/lego/legoomni/include/legomain.h @@ -6,7 +6,6 @@ #include "mxomni.h" class Isle; -class IslePathActor; class LegoAnimationManager; class LegoBuildingManager; class LegoCharacterManager; @@ -14,6 +13,7 @@ class LegoEntity; class LegoGameState; class LegoInputManager; class LegoNavController; +class LegoPathActor; class LegoPathBoundary; class LegoPlantManager; class LegoROI; @@ -127,7 +127,7 @@ class LegoOmni : public MxOmni { ViewLODListManager* GetViewLODListManager() { return m_viewLODListManager; } LegoWorld* GetCurrentWorld() { return m_currentWorld; } LegoNavController* GetNavController() { return m_navController; } - IslePathActor* GetCurrentActor() { return m_currentActor; } + LegoPathActor* GetCurrentActor() { return m_currentActor; } LegoPlantManager* GetLegoPlantManager() { return m_plantManager; } LegoAnimationManager* GetAnimationManager() { return m_animationManager; } LegoBuildingManager* GetLegoBuildingManager() { return m_buildingManager; } @@ -139,7 +139,7 @@ class LegoOmni : public MxOmni { LegoWorldList* GetWorldList() { return m_worldList; } inline void SetNavController(LegoNavController* p_navController) { m_navController = p_navController; } - inline void SetCurrentActor(IslePathActor* p_currentActor) { m_currentActor = p_currentActor; } + inline void SetCurrentActor(LegoPathActor* p_currentActor) { m_currentActor = p_currentActor; } inline void SetCurrentWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; } inline void SetExit(MxBool p_exit) { m_exit = p_exit; } inline MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction) @@ -162,7 +162,7 @@ class LegoOmni : public MxOmni { LegoWorld* m_currentWorld; // 0x7c MxBool m_exit; // 0x80 LegoNavController* m_navController; // 0x84 - IslePathActor* m_currentActor; // 0x88 + LegoPathActor* m_currentActor; // 0x88 LegoCharacterManager* m_characterManager; // 0x8c LegoPlantManager* m_plantManager; // 0x90 LegoAnimationManager* m_animationManager; // 0x94 diff --git a/LEGO1/lego/legoomni/include/legopathactor.h b/LEGO1/lego/legoomni/include/legopathactor.h index 4acc28e7..10f79b50 100644 --- a/LEGO1/lego/legoomni/include/legopathactor.h +++ b/LEGO1/lego/legoomni/include/legopathactor.h @@ -155,7 +155,7 @@ class LegoPathActor : public LegoActor { MxU32 m_state; // 0xdc LegoUnknown100db7f4* m_destEdge; // 0xe0 MxFloat m_unk0xe4; // 0xe4 - undefined m_unk0xe8; // 0xe8 + MxBool m_collideBox; // 0xe8 undefined m_unk0xe9; // 0xe9 MxBool m_userNavFlag; // 0xea MxMatrix m_unk0xec; // 0xec diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index 5e54c748..15f103a8 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -8,7 +8,6 @@ #include "mxpresenterlist.h" #include "roi/legoroi.h" -class IslePathActor; class LegoCameraController; class LegoPathBoundary; class LegoHideAnimPresenter; diff --git a/LEGO1/lego/legoomni/include/misc.h b/LEGO1/lego/legoomni/include/misc.h index 65606dfb..34824772 100644 --- a/LEGO1/lego/legoomni/include/misc.h +++ b/LEGO1/lego/legoomni/include/misc.h @@ -7,7 +7,6 @@ #include "lego/legoomni/include/actions/actionsfwd.h" #include "mxtypes.h" -class IslePathActor; class LegoAnimationManager; class LegoBuildingManager; class LegoCharacterManager; @@ -16,6 +15,7 @@ class LegoGameState; class LegoInputManager; class LegoNavController; class LegoOmni; +class LegoPathActor; class LegoPlantManager; class LegoROI; class LegoSoundManager; @@ -40,7 +40,7 @@ LegoControlManager* ControlManager(); LegoGameState* GameState(); LegoAnimationManager* AnimationManager(); LegoNavController* NavController(); -IslePathActor* CurrentActor(); +LegoPathActor* CurrentActor(); LegoWorld* CurrentWorld(); LegoCharacterManager* CharacterManager(); ViewManager* GetViewManager(); @@ -51,7 +51,7 @@ ViewLODListManager* GetViewLODListManager(); void FUN_10015820(MxBool p_disable, MxU16 p_flags); LegoROI* FindROI(const char* p_name); void SetROIVisible(const char* p_name, MxBool p_visible); -void SetCurrentActor(IslePathActor* p_currentActor); +void SetCurrentActor(LegoPathActor* p_currentActor); MxResult StartActionIfUnknown0x13c(MxDSAction& p_dsAction); void DeleteAction(); LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid); diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index f4a92d51..078cb6c1 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -78,11 +78,12 @@ void Helicopter::VTable0xe4() if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { GameState()->SetCurrentArea(LegoGameState::e_copter); if (CurrentActor() && CurrentActor()->IsA("IslePathActor")) { - CurrentActor()->SpawnPlayer( - LegoGameState::e_unk55, - TRUE, - IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 - ); + ((IslePathActor*) CurrentActor()) + ->SpawnPlayer( + LegoGameState::e_unk55, + TRUE, + IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 + ); } } @@ -116,7 +117,7 @@ MxU32 Helicopter::VTable0xcc() if (CurrentActor()) { if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - CurrentActor()->VTable0xe4(); + ((IslePathActor*) CurrentActor())->VTable0xe4(); } } diff --git a/LEGO1/lego/legoomni/src/actors/islepathactor.cpp b/LEGO1/lego/legoomni/src/actors/islepathactor.cpp index 72f558aa..be2bbc4b 100644 --- a/LEGO1/lego/legoomni/src/actors/islepathactor.cpp +++ b/LEGO1/lego/legoomni/src/actors/islepathactor.cpp @@ -27,7 +27,7 @@ IslePathActor::IslePathActor() m_world = NULL; m_unk0x13c = 6.0; m_unk0x15c = 1.0; - m_unk0x158 = 0; + m_unk0x158 = NULL; } // FUNCTION: LEGO1 0x1001a280 diff --git a/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp b/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp index ade45933..72905a76 100644 --- a/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp +++ b/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp @@ -38,7 +38,7 @@ MxLong JukeBoxEntity::Notify(MxParam& p_param) } if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - CurrentActor()->VTable0xe4(); + ((IslePathActor*) CurrentActor())->VTable0xe4(); } ((Isle*) FindWorld(*g_isleScript, 0))->SetDestLocation(LegoGameState::e_jukeboxw); diff --git a/LEGO1/lego/legoomni/src/actors/skateboard.cpp b/LEGO1/lego/legoomni/src/actors/skateboard.cpp index 8b010eb3..2e742d97 100644 --- a/LEGO1/lego/legoomni/src/actors/skateboard.cpp +++ b/LEGO1/lego/legoomni/src/actors/skateboard.cpp @@ -87,7 +87,7 @@ MxU32 SkateBoard::VTable0xcc() if (GameState()->GetActorId() != CurrentActor()->GetActorId()) { if (!CurrentActor()->IsA("SkateBoard")) { - CurrentActor()->VTable0xe4(); + ((IslePathActor*) CurrentActor())->VTable0xe4(); } } diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 2bd84167..95df6202 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -994,7 +994,7 @@ MxResult LegoAnimationManager::FUN_100605e0( FUN_100648f0(tranInfo, m_unk0x404); } else if (p_unk0x0a) { - IslePathActor* actor = CurrentActor(); + LegoPathActor* actor = CurrentActor(); if (actor != NULL) { actor->SetState(4); @@ -1432,7 +1432,7 @@ MxResult LegoAnimationManager::Tickle() return SUCCESS; } - IslePathActor* actor = CurrentActor(); + LegoPathActor* actor = CurrentActor(); LegoROI* roi; if (actor == NULL || (roi = actor->GetROI()) == NULL) { @@ -1655,7 +1655,7 @@ MxBool LegoAnimationManager::FUN_100623a0(AnimInfo& p_info) LegoEntityListCursor cursor(entityList); LegoEntity* entity; - IslePathActor* actor = CurrentActor(); + LegoPathActor* actor = CurrentActor(); while (cursor.Next(entity)) { if (entity != actor && entity->IsA("LegoPathActor")) { @@ -1858,7 +1858,7 @@ void LegoAnimationManager::AddExtra(MxS32 p_location, MxBool p_und) if (world != NULL) { PurgeExtra(FALSE); - IslePathActor* actor = CurrentActor(); + LegoPathActor* actor = CurrentActor(); if (actor == NULL || actor->GetWorldSpeed() <= 20.0f) { MxU32 i; for (i = 0; i < m_numAllowedExtras && m_extras[i].m_roi != NULL; i++) { @@ -2163,7 +2163,7 @@ MxBool LegoAnimationManager::FUN_10064120(LegoLocation::Boundary* p_boundary, Mx { MxU32 local2c = 12; float destScale = ((rand() * 0.5) / 32767.0) + 0.25; - IslePathActor* actor = CurrentActor(); + LegoPathActor* actor = CurrentActor(); if (actor == NULL) { return FALSE; diff --git a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp index d1c73605..d2e37eba 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp @@ -425,7 +425,7 @@ MxBool LegoAnimMMPresenter::FUN_1004b6b0(MxLong p_time) MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time) { LegoROI* viewROI = VideoManager()->GetViewROI(); - IslePathActor* actor = CurrentActor(); + LegoPathActor* actor = CurrentActor(); if (m_tranInfo != NULL && m_tranInfo->m_unk0x14 && m_tranInfo->m_location != -1 && actor != NULL) { if (m_unk0x64 != NULL) { diff --git a/LEGO1/lego/legoomni/src/common/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index 101a3e6a..79d6b1d4 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -172,7 +172,7 @@ void LegoGameState::SetActor(MxU8 p_actorId) m_actorId = p_actorId; } - IslePathActor* oldActor = CurrentActor(); + LegoPathActor* oldActor = CurrentActor(); SetCurrentActor(NULL); IslePathActor* newActor = new IslePathActor(); @@ -199,7 +199,7 @@ void LegoGameState::SetActor(MxU8 p_actorId) // FUNCTION: LEGO1 0x10039910 void LegoGameState::RemoveActor() { - IslePathActor* actor = CurrentActor(); + LegoPathActor* actor = CurrentActor(); SetCurrentActor(NULL); delete actor; m_actorId = 0; @@ -209,7 +209,7 @@ void LegoGameState::RemoveActor() void LegoGameState::ResetROI() { if (m_actorId) { - IslePathActor* actor = CurrentActor(); + LegoPathActor* actor = CurrentActor(); if (actor) { LegoROI* roi = actor->GetROI(); @@ -906,11 +906,12 @@ void LegoGameState::SwitchArea(Area p_area) AnimationManager()->Resume(); } - CurrentActor()->SpawnPlayer( - p_area, - TRUE, - IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 - ); + ((IslePathActor*) CurrentActor()) + ->SpawnPlayer( + p_area, + TRUE, + IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 + ); break; } case e_hospital: @@ -922,11 +923,12 @@ void LegoGameState::SwitchArea(Area p_area) SetCameraControllerFromIsle(); CurrentActor()->ResetWorldTransform(TRUE); AnimationManager()->Resume(); - CurrentActor()->SpawnPlayer( - p_area, - TRUE, - IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 - ); + ((IslePathActor*) CurrentActor()) + ->SpawnPlayer( + p_area, + TRUE, + IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 + ); break; case e_police: VideoManager()->SetUnk0x554(TRUE); diff --git a/LEGO1/lego/legoomni/src/common/misc.cpp b/LEGO1/lego/legoomni/src/common/misc.cpp index bf77f5e8..34060c5f 100644 --- a/LEGO1/lego/legoomni/src/common/misc.cpp +++ b/LEGO1/lego/legoomni/src/common/misc.cpp @@ -67,7 +67,7 @@ LegoNavController* NavController() } // FUNCTION: LEGO1 0x10015790 -IslePathActor* CurrentActor() +LegoPathActor* CurrentActor() { return LegoOmni::GetInstance()->GetCurrentActor(); } @@ -137,7 +137,7 @@ void SetROIVisible(const char* p_name, MxBool p_visible) } // FUNCTION: LEGO1 0x10015880 -void SetCurrentActor(IslePathActor* p_currentActor) +void SetCurrentActor(LegoPathActor* p_currentActor) { LegoOmni::GetInstance()->SetCurrentActor(p_currentActor); } diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index 0455f1a7..2eb76ed2 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -1,7 +1,6 @@ #include "legoworld.h" #include "anim/legoanim.h" -#include "islepathactor.h" #include "legoanimationmanager.h" #include "legoanimpresenter.h" #include "legobuildingmanager.h" @@ -701,7 +700,7 @@ void LegoWorld::Enable(MxBool p_enable) else if (!p_enable && m_set0xd0.empty()) { MxPresenter* presenter; LegoPathController* controller; - IslePathActor* actor = CurrentActor(); + LegoPathActor* actor = CurrentActor(); if (actor) { RemovePathActor(actor); diff --git a/LEGO1/lego/legoomni/src/gasstation/gasstationentity.cpp b/LEGO1/lego/legoomni/src/gasstation/gasstationentity.cpp index cb15b026..aa14a197 100644 --- a/LEGO1/lego/legoomni/src/gasstation/gasstationentity.cpp +++ b/LEGO1/lego/legoomni/src/gasstation/gasstationentity.cpp @@ -24,7 +24,7 @@ MxLong GasStationEntity::VTable0x50(MxParam& p_param) state->SetUnknown18(0); if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - CurrentActor()->VTable0xe4(); + ((IslePathActor*) CurrentActor())->VTable0xe4(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); diff --git a/LEGO1/lego/legoomni/src/hospital/hospitalentity.cpp b/LEGO1/lego/legoomni/src/hospital/hospitalentity.cpp index 9b2f4eb0..b6c995d9 100644 --- a/LEGO1/lego/legoomni/src/hospital/hospitalentity.cpp +++ b/LEGO1/lego/legoomni/src/hospital/hospitalentity.cpp @@ -24,7 +24,7 @@ MxLong HospitalEntity::VTable0x50(MxParam& p_param) act1State->SetUnknown18(0); if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - CurrentActor()->VTable0xe4(); + ((IslePathActor*) CurrentActor())->VTable0xe4(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); diff --git a/LEGO1/lego/legoomni/src/infocenter/infocenterentity.cpp b/LEGO1/lego/legoomni/src/infocenter/infocenterentity.cpp index 4c89044e..1928f1c7 100644 --- a/LEGO1/lego/legoomni/src/infocenter/infocenterentity.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/infocenterentity.cpp @@ -26,7 +26,7 @@ MxLong InfoCenterEntity::VTable0x50(MxParam& p_param) switch (GameState()->GetCurrentAct()) { case LegoGameState::Act::e_act1: { if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - CurrentActor()->VTable0xe4(); + ((IslePathActor*) CurrentActor())->VTable0xe4(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); diff --git a/LEGO1/lego/legoomni/src/isle/beachhouseentity.cpp b/LEGO1/lego/legoomni/src/isle/beachhouseentity.cpp index 5e11a4bd..1e7167dd 100644 --- a/LEGO1/lego/legoomni/src/isle/beachhouseentity.cpp +++ b/LEGO1/lego/legoomni/src/isle/beachhouseentity.cpp @@ -22,7 +22,7 @@ MxLong BeachHouseEntity::VTable0x50(MxParam& p_param) state->SetUnknown18(0); if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - CurrentActor()->VTable0xe4(); + ((IslePathActor*) CurrentActor())->VTable0xe4(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); diff --git a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp index c26aec13..661c3e95 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathactor.cpp @@ -1,5 +1,6 @@ #include "legopathactor.h" +#include "define.h" #include "geom/legounkown100db7f4.h" #include "legocachesoundmanager.h" #include "legocameracontroller.h" @@ -11,6 +12,7 @@ #include "misc.h" #include "mxmisc.h" #include "mxtimer.h" +#include "mxutilities.h" #include "mxvariabletable.h" #include @@ -44,7 +46,7 @@ LegoPathActor::LegoPathActor() m_state = 0; m_grec = NULL; m_controller = NULL; - m_unk0xe8 = 0; + m_collideBox = FALSE; m_unk0x148 = 0; m_unk0x14c = 0; m_unk0x140 = 0.0099999999f; @@ -454,7 +456,7 @@ MxU32 LegoPathActor::VTable0x6c( LegoROI* roi = actor->GetROI(); if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) { - if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_unk0xe8 != 0 && actor->m_unk0xe8 != 0)) { + if (roi->FUN_100a9410(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->m_collideBox)) { VTable0x94(actor, TRUE); actor->VTable0x94(this, FALSE); return 2; @@ -540,10 +542,50 @@ inline MxU32 LegoPathActor::FUN_1002edd0( return result; } -// STUB: LEGO1 0x1002f020 +// FUNCTION: LEGO1 0x1002f020 +// FUNCTION: BETA10 0x100af54a void LegoPathActor::ParseAction(char* p_extra) { LegoActor::ParseAction(p_extra); + + char value[256]; + value[0] = '\0'; + + if (KeyValueStringParse(value, g_strPERMIT_NAVIGATE, p_extra)) { + SetUserNavFlag(TRUE); + NavController()->ResetLinearVel(m_worldSpeed); + SetCurrentActor(this); + } + + char* token; + if (KeyValueStringParse(value, g_strPATH, p_extra)) { + char name[12]; + + token = strtok(value, g_parseExtraTokens); + strcpy(name, token); + + token = strtok(NULL, g_parseExtraTokens); + MxS32 src = atoi(token); + + token = strtok(NULL, g_parseExtraTokens); + float srcScale = atof(token); + + token = strtok(NULL, g_parseExtraTokens); + MxS32 dest = atoi(token); + + token = strtok(NULL, g_parseExtraTokens); + float destScale = atof(token); + + LegoWorld* world = CurrentWorld(); + if (world != NULL) { + world->PlaceActor(this, name, src, srcScale, dest, destScale); + } + } + + if (KeyValueStringParse(value, g_strCOLLIDEBOX, p_extra)) { + token = strtok(value, g_parseExtraTokens); + m_collideBox = atoi(token); + } } // FUNCTION: LEGO1 0x1002f1b0 diff --git a/LEGO1/lego/legoomni/src/police/policeentity.cpp b/LEGO1/lego/legoomni/src/police/policeentity.cpp index 936d3859..a9090b61 100644 --- a/LEGO1/lego/legoomni/src/police/policeentity.cpp +++ b/LEGO1/lego/legoomni/src/police/policeentity.cpp @@ -24,7 +24,7 @@ MxLong PoliceEntity::VTable0x50(MxParam& p_param) state->SetUnknown18(0); if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - CurrentActor()->VTable0xe4(); + ((IslePathActor*) CurrentActor())->VTable0xe4(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); diff --git a/LEGO1/lego/legoomni/src/race/racestandsentity.cpp b/LEGO1/lego/legoomni/src/race/racestandsentity.cpp index 91d9a07f..8cceb324 100644 --- a/LEGO1/lego/legoomni/src/race/racestandsentity.cpp +++ b/LEGO1/lego/legoomni/src/race/racestandsentity.cpp @@ -22,7 +22,7 @@ MxLong RaceStandsEntity::VTable0x50(MxParam& p_param) state->SetUnknown18(0); if (CurrentActor()->GetActorId() != GameState()->GetActorId()) { - CurrentActor()->VTable0xe4(); + ((IslePathActor*) CurrentActor())->VTable0xe4(); } Isle* isle = (Isle*) FindWorld(*g_isleScript, IsleScript::c__Isle); diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index 9d787a8d..a1bbe9aa 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -503,7 +503,7 @@ void Isle::Enable(MxBool p_enable) } if (CurrentActor() != NULL && CurrentActor()->IsA("Jetski")) { - IslePathActor* actor = CurrentActor(); + IslePathActor* actor = (IslePathActor*) CurrentActor(); actor->SpawnPlayer( LegoGameState::e_unk45, FALSE, @@ -657,11 +657,12 @@ void Isle::Enable(MxBool p_enable) } break; case 5: { - CurrentActor()->SpawnPlayer( - LegoGameState::e_jetrace2, - FALSE, - IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 - ); + ((IslePathActor*) CurrentActor()) + ->SpawnPlayer( + LegoGameState::e_jetrace2, + FALSE, + IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 + ); JetskiRaceState* raceState = (JetskiRaceState*) GameState()->GetState("JetskiRaceState"); if (raceState->GetUnknown0x28() == 2) { @@ -689,11 +690,12 @@ void Isle::Enable(MxBool p_enable) } case 6: { GameState()->m_currentArea = LegoGameState::e_carraceExterior; - CurrentActor()->SpawnPlayer( - LegoGameState::e_unk21, - FALSE, - IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 - ); + ((IslePathActor*) CurrentActor()) + ->SpawnPlayer( + LegoGameState::e_unk21, + FALSE, + IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 + ); CarRaceState* raceState = (CarRaceState*) GameState()->GetState("CarRaceState"); if (raceState->GetUnknown0x28() == 2) { @@ -738,11 +740,12 @@ void Isle::Enable(MxBool p_enable) break; case 11: m_act1state->m_unk0x018 = 0; - CurrentActor()->SpawnPlayer( - LegoGameState::e_unk54, - TRUE, - IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 - ); + ((IslePathActor*) CurrentActor()) + ->SpawnPlayer( + LegoGameState::e_unk54, + TRUE, + IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 + ); GameState()->m_currentArea = LegoGameState::e_unk66; FUN_1003ef00(TRUE); m_jukebox->StartAction(); @@ -789,7 +792,7 @@ void Isle::FUN_10032620() case LegoGameState::e_unk66: { MxMatrix mat(CurrentActor()->GetROI()->GetLocal2World()); LegoPathBoundary* boundary = CurrentActor()->GetBoundary(); - CurrentActor()->VTable0xec(mat, boundary, TRUE); + ((IslePathActor*) CurrentActor())->VTable0xec(mat, boundary, TRUE); break; } case LegoGameState::e_unk4: @@ -802,11 +805,12 @@ void Isle::FUN_10032620() case LegoGameState::e_hospitalExterior: case LegoGameState::e_unk31: case LegoGameState::e_policeExterior: - CurrentActor()->SpawnPlayer( - GameState()->m_currentArea, - TRUE, - IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 - ); + ((IslePathActor*) CurrentActor()) + ->SpawnPlayer( + GameState()->m_currentArea, + TRUE, + IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 + ); GameState()->m_currentArea = LegoGameState::e_unk66; break; } @@ -1065,7 +1069,7 @@ void Isle::Add(MxCore* p_object) } // FUNCTION: LEGO1 0x10033050 -void Isle::VTable0x6c(IslePathActor* p_actor) +void Isle::VTable0x6c(LegoPathActor* p_actor) { LegoWorld::Remove(p_actor);