From 777f1b64ac55c7c37984dda2060bbfafa991c474 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 2 Feb 2024 10:52:24 -0500 Subject: [PATCH] WIP VTable0x68 --- .../legoomni/include/legoanimationmanager.h | 3 + LEGO1/lego/legoomni/include/legogamestate.h | 1 + LEGO1/lego/legoomni/include/legoomni.h | 12 +- .../legoomni/include/legopathcontroller.h | 2 + .../legoomni/include/legopathcontrollerlist.h | 44 +++++- .../include/legopointofviewcontroller.h | 1 + LEGO1/lego/legoomni/src/build/helicopter.cpp | 22 +-- .../legoomni/src/common/legogamestate.cpp | 6 + .../src/entity/legoactorpresenter.cpp | 2 +- LEGO1/lego/legoomni/src/entity/legoentity.cpp | 6 +- .../src/entity/legoentitypresenter.cpp | 2 +- LEGO1/lego/legoomni/src/entity/legoworld.cpp | 134 +++++++++++++++++- LEGO1/lego/legoomni/src/isle/isle.cpp | 6 +- LEGO1/lego/legoomni/src/isle/radio.cpp | 10 +- LEGO1/lego/legoomni/src/main/legoomni.cpp | 19 ++- .../legoomni/src/paths/legopathcontroller.cpp | 6 + .../src/video/legoanimationmanager.cpp | 19 +++ .../legoomni/src/video/legoanimpresenter.cpp | 2 +- .../src/video/mxtransitionmanager.cpp | 2 +- LEGO1/viewmanager/viewmanager.cpp | 4 + LEGO1/viewmanager/viewmanager.h | 5 +- 21 files changed, 257 insertions(+), 51 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index 85f1d8ec..94cb5b86 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -27,9 +27,12 @@ class LegoAnimationManager : public MxCore { return !strcmp(p_name, ClassName()) || MxCore::IsA(p_name); } + void FUN_1005ee80(MxBool); void FUN_1005ef10(); + void FUN_1005f0b0(); void FUN_1005f6d0(MxBool); void FUN_1005f720(undefined4); + void FUN_10061010(undefined4); void FUN_10064670(MxBool); static void configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig); diff --git a/LEGO1/lego/legoomni/include/legogamestate.h b/LEGO1/lego/legoomni/include/legogamestate.h index 1af22e55..a799c570 100644 --- a/LEGO1/lego/legoomni/include/legogamestate.h +++ b/LEGO1/lego/legoomni/include/legogamestate.h @@ -47,6 +47,7 @@ class LegoGameState { void SetSomeEnumState(undefined4 p_state); void FUN_1003ceb0(); void FUN_10039780(MxU8); + void FUN_10039940(); struct ScoreStruct { void WriteScoreHistory(); diff --git a/LEGO1/lego/legoomni/include/legoomni.h b/LEGO1/lego/legoomni/include/legoomni.h index 33fc6a46..ff973f95 100644 --- a/LEGO1/lego/legoomni/include/legoomni.h +++ b/LEGO1/lego/legoomni/include/legoomni.h @@ -28,6 +28,7 @@ class MxBackgroundAudioManager; class MxDSFile; class MxTransitionManager; class ViewLODListManager; +class ViewManager; extern MxAtomId* g_copterScript; extern MxAtomId* g_dunecarScript; @@ -125,7 +126,7 @@ class LegoOmni : public MxOmni { LegoUnkSaveDataWriter* GetUnkSaveDataWriter() { return m_saveDataWriter; } inline void SetNavController(LegoNavController* p_navController) { m_navController = p_navController; } - inline void SetWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; } + inline void SetCurrentWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; } inline void SetExit(MxBool p_exit) { m_exit = p_exit; } inline void CloseMainWindow() { PostMessageA(m_windowHandle, WM_CLOSE, 0, 0); } @@ -164,14 +165,15 @@ LegoROI* PickROI(MxLong, MxLong); LegoSoundManager* SoundManager(); MxTransitionManager* TransitionManager(); LegoVideoManager* VideoManager(); - LegoAnimationManager* AnimationManager(); +LegoNavController* NavController(); LegoBuildingManager* BuildingManager(); LegoControlManager* ControlManager(); -IslePathActor* GetCurrentVehicle(); +IslePathActor* CurrentVehicle(); +ViewManager* GetViewManager(); LegoPlantManager* PlantManager(); -LegoWorld* GetCurrentWorld(); -LegoUnkSaveDataWriter* GetUnkSaveDataWriter(); +LegoWorld* CurrentWorld(); +LegoUnkSaveDataWriter* UnkSaveDataWriter(); GifManager* GetGifManager(); void FUN_10015820(MxBool p_disable, MxU16 p_flags); void FUN_10015860(const char*, MxU8); diff --git a/LEGO1/lego/legoomni/include/legopathcontroller.h b/LEGO1/lego/legoomni/include/legopathcontroller.h index 8363ee7a..4ad0b03f 100644 --- a/LEGO1/lego/legoomni/include/legopathcontroller.h +++ b/LEGO1/lego/legoomni/include/legopathcontroller.h @@ -30,6 +30,8 @@ class LegoPathController : public MxCore { virtual void VTable0x14(); // vtable+0x14 virtual void Destroy(); // vtable+0x18 + + void Enable(MxBool p_enable); }; #endif // LEGOPATHCONTROLLER_H diff --git a/LEGO1/lego/legoomni/include/legopathcontrollerlist.h b/LEGO1/lego/legoomni/include/legopathcontrollerlist.h index 0bcd9c09..f093f4d5 100644 --- a/LEGO1/lego/legoomni/include/legopathcontrollerlist.h +++ b/LEGO1/lego/legoomni/include/legopathcontrollerlist.h @@ -5,6 +5,12 @@ #include "mxlist.h" #include "mxtypes.h" +// VTABLE: LEGO1 0x100d6380 +// class MxCollection + +// VTABLE: LEGO1 0x100d6398 +// class MxList + // VTABLE: LEGO1 0x100d6320 // class MxPtrList @@ -19,16 +25,20 @@ class LegoPathControllerList : public MxPtrList { { return p_a == p_b ? 0 : p_a < p_b ? -1 : 1; } // vtable+0x14 - - // SYNTHETIC: LEGO1 0x1001d3d0 - // LegoPathControllerList::`scalar deleting destructor' }; -// VTABLE: LEGO1 0x100d6380 -// class MxCollection +// VTABLE: LEGO1 0x100d6578 +// class MxListCursor -// VTABLE: LEGO1 0x100d6398 -// class MxList +// VTABLE: LEGO1 0x100d6548 +// class MxPtrListCursor + +// VTABLE: LEGO1 0x100d6560 +// SIZE 0x10 +class LegoPathControllerListCursor : public MxPtrListCursor { +public: + LegoPathControllerListCursor(LegoPathControllerList* p_list) : MxPtrListCursor(p_list){}; +}; // TEMPLATE: LEGO1 0x1001d230 // MxCollection::Compare @@ -48,6 +58,9 @@ class LegoPathControllerList : public MxPtrList { // TEMPLATE: LEGO1 0x1001d3c0 // MxPtrList::Destroy +// SYNTHETIC: LEGO1 0x1001d3d0 +// LegoPathControllerList::`scalar deleting destructor' + // TEMPLATE: LEGO1 0x1001d440 // MxPtrList::~MxPtrList @@ -63,4 +76,21 @@ class LegoPathControllerList : public MxPtrList { // SYNTHETIC: LEGO1 0x1001d620 // LegoPathControllerList::~LegoPathControllerList +// SYNTHETIC: LEGO1 0x1001f830 +// LegoPathControllerListCursor::`scalar deleting destructor' + +// FUNCTION: LEGO1 0x1001f8a0 +// MxPtrListCursor::~MxPtrListCursor + +// SYNTHETIC: LEGO1 0x1001f8f0 +// MxListCursor::`scalar deleting destructor' + +// SYNTHETIC: LEGO1 0x1001f960 +// MxPtrListCursor::`scalar deleting destructor' + +// FUNCTION: LEGO1 0x1001f9d0 +// MxListCursor::~MxListCursor + +// LegoPathControllerListCursor::~LegoPathControllerListCursor + #endif // LEGOPATHCONTROLLERLIST_H diff --git a/LEGO1/lego/legoomni/include/legopointofviewcontroller.h b/LEGO1/lego/legoomni/include/legopointofviewcontroller.h index 650ca90b..b6db3014 100644 --- a/LEGO1/lego/legoomni/include/legopointofviewcontroller.h +++ b/LEGO1/lego/legoomni/include/legopointofviewcontroller.h @@ -86,6 +86,7 @@ class LegoPointOfViewController : public LegoMouseController { void OnViewSize(int p_width, int p_height); inline LegoEntity* GetEntity() { return m_entity; } + inline LegoNavController* GetNavController() { return m_nav; } protected: void AffectPointOfView(); diff --git a/LEGO1/lego/legoomni/src/build/helicopter.cpp b/LEGO1/lego/legoomni/src/build/helicopter.cpp index 2b7be890..7e836fcf 100644 --- a/LEGO1/lego/legoomni/src/build/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/build/helicopter.cpp @@ -34,7 +34,7 @@ Helicopter::~Helicopter() MxResult Helicopter::Create(MxDSAction& p_dsAction) { MxResult result = IslePathActor::Create(p_dsAction); - LegoWorld* world = GetCurrentWorld(); + LegoWorld* world = CurrentWorld(); SetWorld(world); if (world->IsA("Act3")) { ((Act3*) GetWorld())->SetUnkown420c(this); @@ -65,9 +65,9 @@ void Helicopter::VTable0xe4() IslePathActor::VTable0xe4(); if (!GameState()->GetUnknown10()) { GameState()->SetCurrentArea(0x3c); - if (GetCurrentVehicle()) { - if (GetCurrentVehicle()->IsA("IslePathActor")) { - ((IslePathActor*) GetCurrentVehicle())->VTable0xe8(0x37, TRUE, 7); + if (CurrentVehicle()) { + if (CurrentVehicle()->IsA("IslePathActor")) { + ((IslePathActor*) CurrentVehicle())->VTable0xe8(0x37, TRUE, 7); } } } @@ -93,12 +93,12 @@ MxU32 Helicopter::VTable0xcc() return 1; } if (!m_world) { - m_world = GetCurrentWorld(); + m_world = CurrentWorld(); } AnimationManager()->FUN_1005f6d0(FALSE); - if (GetCurrentVehicle()) { - if (GetCurrentVehicle()->VTable0x60() != GameState()->GetUnknownC()) { - GetCurrentVehicle()->VTable0xe4(); + if (CurrentVehicle()) { + if (CurrentVehicle()->VTable0x60() != GameState()->GetUnknownC()) { + CurrentVehicle()->VTable0xe4(); } } switch (GameState()->GetUnknown10()) { @@ -106,7 +106,7 @@ MxU32 Helicopter::VTable0xcc() m_script = *g_isleScript; AnimationManager()->FUN_10064670(FALSE); VTable0xe8(0x29, TRUE, 7); - ((Isle*) GetCurrentWorld())->SetUnknown13c(0x3c); + ((Isle*) CurrentWorld())->SetUnknown13c(0x3c); FUN_10015820(TRUE, 0); TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, TRUE); SetUnknownDC(4); @@ -146,7 +146,7 @@ MxU32 Helicopter::VTable0xd4(LegoControlManagerEvent& p_param) switch (p_param.GetClickedObjectId()) { case 0x17: if (*g_act3Script == script) { - ((Act3*) GetCurrentWorld())->SetUnkown4270(2); + ((Act3*) CurrentWorld())->SetUnkown4270(2); TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE); } else if (m_state->GetUnkown8() != 0) { @@ -218,7 +218,7 @@ MxU32 Helicopter::VTable0xd4(LegoControlManagerEvent& p_param) break; case 0x1c: if (GameState()->GetUnknown10() == 0) { - ((Isle*) GetCurrentWorld())->SetUnknown13c(2); + ((Isle*) CurrentWorld())->SetUnknown13c(2); TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE); VTable0xe4(); } diff --git a/LEGO1/lego/legoomni/src/common/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index 28453d61..0637a22c 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -113,6 +113,12 @@ void LegoGameState::FUN_10039780(MxU8) // TODO } +// STUB: LEGO1 0x10039940 +void LegoGameState::FUN_10039940() +{ + // TODO +} + // FUNCTION: LEGO1 0x10039980 MxResult LegoGameState::Save(MxULong p_slot) { diff --git a/LEGO1/lego/legoomni/src/entity/legoactorpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoactorpresenter.cpp index 927677fe..076333a6 100644 --- a/LEGO1/lego/legoomni/src/entity/legoactorpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoactorpresenter.cpp @@ -6,7 +6,7 @@ // FUNCTION: LEGO1 0x10076c30 void LegoActorPresenter::ReadyTickle() { - if (GetCurrentWorld()) { + if (CurrentWorld()) { m_entity = (LegoEntity*) CreateEntity("LegoActor"); if (m_entity) { SetEntityLocation(m_action->GetLocation(), m_action->GetDirection(), m_action->GetUp()); diff --git a/LEGO1/lego/legoomni/src/entity/legoentity.cpp b/LEGO1/lego/legoomni/src/entity/legoentity.cpp index 3057a71f..86ccf923 100644 --- a/LEGO1/lego/legoomni/src/entity/legoentity.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoentity.cpp @@ -55,7 +55,7 @@ void LegoEntity::Destroy(MxBool p_fromDestructor) m_roi->SetUnknown0x104(NULL); } - GetUnkSaveDataWriter()->FUN_10083db0(m_roi); + UnkSaveDataWriter()->FUN_10083db0(m_roi); } else { VideoManager()->Get3DManager()->GetLego3DView()->Remove(*m_roi); @@ -70,7 +70,7 @@ void LegoEntity::Destroy(MxBool p_fromDestructor) // FUNCTION: LEGO1 0x10010880 void LegoEntity::SetWorld() { - LegoWorld* world = GetCurrentWorld(); + LegoWorld* world = CurrentWorld(); if (world != NULL && world != (LegoWorld*) this) { world->Add(this); } @@ -91,7 +91,7 @@ void LegoEntity::SetLocation(Mx3DPointFloat& p_location, Mx3DPointFloat& p_direc // FUNCTION: LEGO1 0x10010c30 void LegoEntity::FUN_10010c30() { - LegoWorld* world = GetCurrentWorld(); + LegoWorld* world = CurrentWorld(); if (m_cameraFlag && world && world->GetCamera() && m_roi) { world->GetCamera()->FUN_100123e0(m_roi->GetLocal2World(), 1); diff --git a/LEGO1/lego/legoomni/src/entity/legoentitypresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoentitypresenter.cpp index 0da082cd..f43f1aa9 100644 --- a/LEGO1/lego/legoomni/src/entity/legoentitypresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoentitypresenter.cpp @@ -62,7 +62,7 @@ MxResult LegoEntityPresenter::StartAction(MxStreamController* p_controller, MxDS // FUNCTION: LEGO1 0x100536c0 void LegoEntityPresenter::ReadyTickle() { - if (GetCurrentWorld()) { + if (CurrentWorld()) { m_entity = (LegoEntity*) MxPresenter::CreateEntity("LegoEntity"); if (m_entity) { m_entity->Create(*m_action); diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index a8111dc8..4a848f63 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -1,10 +1,13 @@ #include "legoworld.h" +#include "legoanimationmanager.h" #include "legoanimpresenter.h" #include "legobuildingmanager.h" #include "legocontrolmanager.h" +#include "legogamestate.h" #include "legoinputmanager.h" #include "legolocomotionanimpresenter.h" +#include "legonavcontroller.h" #include "legoomni.h" #include "legoplantmanager.h" #include "legosoundmanager.h" @@ -80,8 +83,8 @@ MxResult LegoWorld::Create(MxDSAction& p_dsAction) } if (p_dsAction.GetFlags() & MxDSAction::c_enabled) { - if (GetCurrentWorld()) { - GetCurrentWorld()->VTable0x68(0); + if (CurrentWorld()) { + CurrentWorld()->VTable0x68(0); } SetCurrentWorld(this); @@ -99,7 +102,7 @@ void LegoWorld::Destroy(MxBool p_fromDestructor) { m_destroyed = TRUE; - if (GetCurrentWorld() == this) { + if (CurrentWorld() == this) { ControlManager()->FUN_10028df0(NULL); SetCurrentWorld(NULL); } @@ -513,10 +516,129 @@ MxCore* LegoWorld::Find(const MxAtomId& p_atom, MxS32 p_entityId) return NULL; } -// STUB: LEGO1 0x10021a70 -void LegoWorld::VTable0x68(MxBool p_add) +// FUNCTION: LEGO1 0x10021a70 +void LegoWorld::VTable0x68(MxBool p_und) { - // TODO + if (p_und) { + if (!m_set0xd0.empty() && CurrentWorld() != this) { + if (CurrentWorld()) { + AnimationManager()->FUN_10061010(0); + CurrentWorld()->VTable0x68(FALSE); + + LegoEntityListCursor cursor(m_entityList); + LegoEntity* entity; + + while (cursor.Next(entity)) { + if (entity->GetROI()) { + entity->GetROI()->SetUnknown0x104(entity); + GetViewManager()->GetUnknown0x08().push_back(entity->GetROI()); + } + } + } + + while (!m_set0xd0.empty()) { + MxCoreSet::iterator it = m_set0xa8.begin(); + MxCore* object = *it; + + if (object->IsA("MxPresenter")) { + ((MxPresenter*) object)->Enable(TRUE); + } + else if (object->IsA("LegoPathController")) { + ((LegoPathController*) object)->Enable(TRUE); + } + + m_set0xd0.erase(it); + } + + SetCurrentWorld(this); + ControlManager()->FUN_10028df0(&m_controlPresenters); + InputManager()->SetCamera(m_cameraController); + + if (m_cameraController) { + InputManager()->Register(m_cameraController->GetNavController()); + Lego()->SetNavController(m_cameraController->GetNavController()); + } + + if (m_unk0xec != -1) { + PlantManager()->FUN_10026360(m_unk0xec); + AnimationManager()->FUN_1005f720(m_unk0xec); + BuildingManager()->FUN_1002fa00(); + AnimationManager()->FUN_1005f0b0(); + } + + GameState()->FUN_10039940(); + SetIsWorldActive(TRUE); + + return; + } + + if (p_und) + return; + } + + if (m_set0xd0.empty()) { + IslePathActor* vehicle = CurrentVehicle(); + + if (vehicle) { + FUN_1001fc80(vehicle); + } + + AnimationManager()->FUN_1005ee80(FALSE); + m_set0xd0.insert(this); + + if (m_unk0xec != -1) { + PlantManager()->FUN_100263a0(m_unk0xec); + BuildingManager()->FUN_1002fb30(); + } + + MxPresenterListCursor controlPresenterCursor(&m_controlPresenters); + MxPresenter* presenter; + + while (controlPresenterCursor.Next(presenter)) { + if (presenter->IsEnabled()) { + m_set0xd0.insert(presenter); + presenter->Enable(FALSE); + } + } + + for (MxCoreSet::iterator it = m_set0xa8.begin(); it != m_set0xa8.end(); it++) { + if ((*it)->IsA("LegoActionControlPresenter")) { + m_set0xd0.insert(*it); + ((MxPresenter*) *it)->Enable(FALSE); + } + else if ((*it)->IsA("MxPresenter") && ((MxPresenter*) *it)->IsEnabled()) { + m_set0xd0.insert(*it); + ((MxPresenter*) *it)->Enable(FALSE); + } + } + + if (CurrentWorld() && CurrentWorld() == this) { + ControlManager()->FUN_10028df0(NULL); + Lego()->SetCurrentWorld(NULL); + } + + if (InputManager()->GetCamera() == m_cameraController) { + InputManager()->ClearCamera(); + } + + if (m_cameraController) { + InputManager()->UnRegister(m_cameraController->GetNavController()); + + if (NavController() == m_cameraController->GetNavController()) { + Lego()->SetNavController(NULL); + } + } + + LegoPathControllerListCursor pathControllerCursor(&m_list0x68); + LegoPathController* controller; + + while (pathControllerCursor.Next(controller)) { + controller->Enable(FALSE); + m_set0xd0.insert(controller); + } + + GetViewManager()->RemoveAll(NULL); + } } // FUNCTION: LEGO1 0x10022080 diff --git a/LEGO1/lego/legoomni/src/isle/isle.cpp b/LEGO1/lego/legoomni/src/isle/isle.cpp index c8c67570..610dd430 100644 --- a/LEGO1/lego/legoomni/src/isle/isle.cpp +++ b/LEGO1/lego/legoomni/src/isle/isle.cpp @@ -46,8 +46,8 @@ Isle::~Isle() InputManager()->ClearWorld(); } - if (GetCurrentVehicle() != NULL) { - VTable0x6c(GetCurrentVehicle()); + if (CurrentVehicle() != NULL) { + VTable0x6c(CurrentVehicle()); } NotificationManager()->Unregister(this); @@ -121,7 +121,7 @@ MxLong Isle::Notify(MxParam& p_param) case c_notificationType18: switch (m_act1state->GetUnknown18()) { case 4: - result = GetCurrentVehicle()->Notify(p_param); + result = CurrentVehicle()->Notify(p_param); break; case 8: result = m_towtrack->Notify(p_param); diff --git a/LEGO1/lego/legoomni/src/isle/radio.cpp b/LEGO1/lego/legoomni/src/isle/radio.cpp index 86561c16..52bda8f2 100644 --- a/LEGO1/lego/legoomni/src/isle/radio.cpp +++ b/LEGO1/lego/legoomni/src/isle/radio.cpp @@ -54,7 +54,7 @@ MxLong Radio::Notify(MxParam& p_param) void Radio::Play() { if (!m_state->IsActive()) { - GetCurrentWorld(); + CurrentWorld(); MxDSAction action; action.SetObjectId(m_state->FUN_1002d090()); @@ -75,7 +75,7 @@ void Radio::Play() void Radio::Stop() { if (m_state->IsActive()) { - LegoWorld* world = GetCurrentWorld(); + LegoWorld* world = CurrentWorld(); MxControlPresenter* presenter = (MxControlPresenter*) world->Find(world->GetAtom(), 18); @@ -103,12 +103,12 @@ MxLong Radio::HandleClick(LegoControlManagerEvent& p_param) Play(); } - if (GetCurrentWorld()) { + if (CurrentWorld()) { #ifdef COMPAT_MODE MxNotificationParam param(c_notificationEndAction, this); - GetCurrentWorld()->Notify(param); + CurrentWorld()->Notify(param); #else - GetCurrentWorld()->Notify(MxNotificationParam(c_notificationType0, this)); + CurrentWorld()->Notify(MxNotificationParam(c_notificationType0, this)); #endif } diff --git a/LEGO1/lego/legoomni/src/main/legoomni.cpp b/LEGO1/lego/legoomni/src/main/legoomni.cpp index 153d5522..7384da72 100644 --- a/LEGO1/lego/legoomni/src/main/legoomni.cpp +++ b/LEGO1/lego/legoomni/src/main/legoomni.cpp @@ -22,6 +22,7 @@ #include "mxstreamer.h" #include "mxticklemanager.h" #include "mxtransitionmanager.h" +#include "viewmanager/viewmanager.h" DECOMP_SIZE_ASSERT(LegoWorldList, 0x18); DECOMP_SIZE_ASSERT(LegoWorldListCursor, 0x10); @@ -172,23 +173,29 @@ LegoNavController* NavController() } // FUNCTION: LEGO1 0x10015790 -IslePathActor* GetCurrentVehicle() +IslePathActor* CurrentVehicle() { return LegoOmni::GetInstance()->GetCurrentVehicle(); } // FUNCTION: LEGO1 0x100157a0 -LegoWorld* GetCurrentWorld() +LegoWorld* CurrentWorld() { return LegoOmni::GetInstance()->GetCurrentWorld(); } // FUNCTION: LEGO1 0x100157b0 -LegoUnkSaveDataWriter* GetUnkSaveDataWriter() +LegoUnkSaveDataWriter* UnkSaveDataWriter() { return LegoOmni::GetInstance()->GetUnkSaveDataWriter(); } +// FUNCTION: LEGO1 0x100157c0 +ViewManager* GetViewManager() +{ + return VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager(); +} + // FUNCTION: LEGO1 0x100157e0 LegoPlantManager* PlantManager() { @@ -234,7 +241,7 @@ MxDSAction& GetCurrentAction() // FUNCTION: LEGO1 0x100158f0 void SetCurrentWorld(LegoWorld* p_world) { - LegoOmni::GetInstance()->SetWorld(p_world); + LegoOmni::GetInstance()->SetCurrentWorld(p_world); } // FUNCTION: LEGO1 0x10015900 @@ -740,11 +747,11 @@ MxBool LegoOmni::DoesEntityExist(MxDSAction& p_dsAction) // FUNCTION: LEGO1 0x1005b400 MxS32 LegoOmni::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value) { - if (::GetCurrentWorld() == NULL) { + if (::CurrentWorld() == NULL) { return -1; } - return ::GetCurrentWorld()->GetCurrPathInfo(p_path, p_value); + return ::CurrentWorld()->GetCurrPathInfo(p_path, p_value); } // FUNCTION: LEGO1 0x1005b4f0 diff --git a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp index c187344c..f2b4d0bb 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp @@ -24,3 +24,9 @@ MxResult LegoPathController::Tickle() // TODO return SUCCESS; } + +// STUB: LEGO1 0x10046be0 +void LegoPathController::Enable(MxBool p_enable) +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/video/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/video/legoanimationmanager.cpp index 476c6291..0b10ed24 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimationmanager.cpp @@ -21,9 +21,22 @@ LegoAnimationManager::~LegoAnimationManager() // TODO } +// STUB: LEGO1 0x1005ee80 +void LegoAnimationManager::FUN_1005ee80(MxBool) +{ + // TODO +} + // STUB: LEGO1 0x1005ef10 void LegoAnimationManager::FUN_1005ef10() { + // TODO +} + +// STUB: LEGO1 0x1005f0b0 +void LegoAnimationManager::FUN_1005f0b0() +{ + // TODO } // STUB: LEGO1 0x1005f130 @@ -44,6 +57,12 @@ void LegoAnimationManager::FUN_1005f720(undefined4) // TODO } +// STUB: LEGO1 0x10061010 +void LegoAnimationManager::FUN_10061010(undefined4) +{ + // TODO +} + // STUB: LEGO1 0x100619f0 MxLong LegoAnimationManager::Notify(MxParam& p_param) { diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index f01d3ae1..68c664de 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -102,7 +102,7 @@ void LegoAnimPresenter::PutFrame() // FUNCTION: LEGO1 0x1006b550 void LegoAnimPresenter::ReadyTickle() { - m_currentWorld = GetCurrentWorld(); + m_currentWorld = CurrentWorld(); if (m_currentWorld) { MxStreamChunk* chunk = m_subscriber->CurrentChunk(); diff --git a/LEGO1/lego/legoomni/src/video/mxtransitionmanager.cpp b/LEGO1/lego/legoomni/src/video/mxtransitionmanager.cpp index 56fc3c9a..8672cdaa 100644 --- a/LEGO1/lego/legoomni/src/video/mxtransitionmanager.cpp +++ b/LEGO1/lego/legoomni/src/video/mxtransitionmanager.cpp @@ -137,7 +137,7 @@ void MxTransitionManager::EndTransition(MxBool p_notifyWorld) TickleManager()->UnregisterClient(this); if (p_notifyWorld) { - LegoWorld* world = GetCurrentWorld(); + LegoWorld* world = CurrentWorld(); if (world) { #ifdef COMPAT_MODE diff --git a/LEGO1/viewmanager/viewmanager.cpp b/LEGO1/viewmanager/viewmanager.cpp index 3e7344d2..3e68f78e 100644 --- a/LEGO1/viewmanager/viewmanager.cpp +++ b/LEGO1/viewmanager/viewmanager.cpp @@ -1,5 +1,9 @@ #include "viewmanager.h" +#include "decomp.h" + +DECOMP_SIZE_ASSERT(ViewManager, 0x1bc) + // STUB: LEGO1 0x100a5eb0 ViewManager::ViewManager(Tgl::Renderer* pRenderer, Tgl::Group* scene, const OrientableROI* point_of_view) { diff --git a/LEGO1/viewmanager/viewmanager.h b/LEGO1/viewmanager/viewmanager.h index d89b7cef..3ca03cb7 100644 --- a/LEGO1/viewmanager/viewmanager.h +++ b/LEGO1/viewmanager/viewmanager.h @@ -20,8 +20,11 @@ class ViewManager { // SYNTHETIC: LEGO1 0x100a6000 // ViewManager::`scalar deleting destructor' + inline CompoundObject& GetUnknown0x08() { return m_unk0x08; } + private: - undefined m_pad[0x1b8]; + CompoundObject m_unk0x08; // 0x08 + undefined m_pad[0x1cc]; // 0x14 }; #endif // VIEWMANAGER_H