diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b161d18..2537059c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,7 @@ add_library(lego1 SHARED LEGO1/jukebox.cpp LEGO1/jukeboxentity.cpp LEGO1/jukeboxstate.cpp + LEGO1/lego3dview.cpp LEGO1/legoact2state.cpp LEGO1/legoactioncontrolpresenter.cpp LEGO1/legoactor.cpp @@ -224,7 +225,6 @@ add_library(lego1 SHARED LEGO1/towtrackmissionstate.cpp LEGO1/viewmanager/viewmanager.cpp LEGO1/viewmanager/viewroi.cpp - LEGO1/lego3dview.cpp ) if (MINGW) target_compile_definitions(lego1 PRIVATE DIRECTINPUT_VERSION=0x0500) diff --git a/LEGO1/lego3dview.cpp b/LEGO1/lego3dview.cpp index 2bbb57ae..0bb384e8 100644 --- a/LEGO1/lego3dview.cpp +++ b/LEGO1/lego3dview.cpp @@ -2,7 +2,7 @@ #include "legoroi.h" -// STUB: LEGO1 0x1003dd70 +// STUB: LEGO1 0x100ab2b0 LegoROI* Lego3DView::PickROI(MxLong p_a, MxLong p_b) { // TODO diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp index b5dc68b5..eab190ac 100644 --- a/LEGO1/legoomni.cpp +++ b/LEGO1/legoomni.cpp @@ -605,7 +605,7 @@ MxBool LegoOmni::DoesEntityExist(MxDSAction& p_dsAction) } // FUNCTION: LEGO1 0x1005b400 -int LegoOmni::GetCurrPathInfo(LegoPathBoundary** p_path, int& p_value) +MxS32 LegoOmni::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value) { if (GetCurrentWorld() == NULL) { return -1; diff --git a/LEGO1/legoworld.cpp b/LEGO1/legoworld.cpp index 9cf5266c..f809e1a0 100644 --- a/LEGO1/legoworld.cpp +++ b/LEGO1/legoworld.cpp @@ -92,7 +92,7 @@ void LegoWorld::FUN_1001fc80(IslePathActor* p_actor) } // STUB: LEGO1 0x10020120 -int LegoWorld::GetCurrPathInfo(LegoPathBoundary** p_path, int& p_value) +MxS32 LegoWorld::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value) { // TODO return 0; diff --git a/LEGO1/mxactionnotificationparam.h b/LEGO1/mxactionnotificationparam.h index b67d0321..be067c7b 100644 --- a/LEGO1/mxactionnotificationparam.h +++ b/LEGO1/mxactionnotificationparam.h @@ -4,6 +4,8 @@ #include "mxdsaction.h" #include "mxnotificationparam.h" +class MxPresenter; + // VTABLE: LEGO1 0x100d8350 // SIZE 0x14 class MxActionNotificationParam : public MxNotificationParam { @@ -88,7 +90,7 @@ class MxEndActionNotificationParam : public MxActionNotificationParam { // SIZE 0x18 class MxType4NotificationParam : public MxActionNotificationParam { public: - inline MxType4NotificationParam(MxCore* p_sender, MxDSAction* p_action, undefined4 p_unk0x14) + inline MxType4NotificationParam(MxCore* p_sender, MxDSAction* p_action, MxPresenter* p_unk0x14) : MxActionNotificationParam(TYPE4, p_sender, p_action, FALSE) { m_unk0x14 = p_unk0x14; @@ -97,7 +99,7 @@ class MxType4NotificationParam : public MxActionNotificationParam { virtual MxNotificationParam* Clone() override; // vtable+0x4 private: - undefined4 m_unk0x14; // 0x14 + MxPresenter* m_unk0x14; // 0x14 }; // SYNTHETIC: LEGO1 0x100b0430 diff --git a/LEGO1/mxomni.cpp b/LEGO1/mxomni.cpp index c298629c..5eddf0ef 100644 --- a/LEGO1/mxomni.cpp +++ b/LEGO1/mxomni.cpp @@ -324,40 +324,40 @@ MxResult MxOmni::CreatePresenter(MxStreamController* p_controller, MxDSAction& p { MxResult result = FAILURE; MxPresenter* object = (MxPresenter*) m_objectFactory->Create(PresenterNameDispatch(p_action)); - if (object == NULL) { - return result; + if (object) { + if (object->AddToManager() == SUCCESS) { + MxPresenter* sender = (MxPresenter*) p_action.GetUnknown28(); + if (sender == NULL && (sender = (MxPresenter*) p_controller->FUN_100c1e70(p_action)) == NULL) { + if (p_action.GetOrigin() == NULL) { + p_action.SetOrigin(this); + } + + object->SetCompositePresenter(NULL); + } + else { + p_action.SetOrigin(sender); + object->SetCompositePresenter((MxCompositePresenter*) sender); + } + + if (object->StartAction(p_controller, &p_action) == SUCCESS) { + if (sender) { + NotificationManager()->Send( + p_action.GetUnknown84(), + &MxType4NotificationParam(this, &p_action, object) + ); + } + + if (p_action.GetUnknown84()) { + NotificationManager()->Send( + p_action.GetUnknown84(), + &MxStartActionNotificationParam(c_notificationStartAction, this, &p_action, FALSE) + ); + } + } + + result = SUCCESS; + } } - - if (object->AddToManager() == SUCCESS) { - MxPresenter* sender = (MxPresenter*) p_action.GetUnknown28(); - if (sender == NULL && (sender = (MxPresenter*) p_controller->FUN_100c1e70(p_action)) == NULL) { - if (p_action.GetOrigin() == NULL) { - p_action.SetOrigin(this); - } - - object->SetCompositePresenter(NULL); - } - else { - p_action.SetOrigin(sender); - object->SetCompositePresenter((MxCompositePresenter*) sender); - } - - if (object->StartAction(p_controller, &p_action) == SUCCESS) { - if (sender) { - NotificationManager()->Send(p_action.GetUnknown84(), &MxType4NotificationParam(this, &p_action, FALSE)); - } - - if (p_action.GetUnknown84()) { - NotificationManager()->Send( - p_action.GetUnknown84(), - &MxStartActionNotificationParam(c_notificationStartAction, this, &p_action, FALSE) - ); - } - } - - result = SUCCESS; - } - return result; } diff --git a/LEGO1/mxpresenter.h b/LEGO1/mxpresenter.h index fae7021a..41b255dc 100644 --- a/LEGO1/mxpresenter.h +++ b/LEGO1/mxpresenter.h @@ -10,6 +10,7 @@ class MxCompositePresenter; class MxStreamController; +class MxPresenter; // VTABLE: LEGO1 0x100d4d38 // SIZE 0x40 diff --git a/LEGO1/mxstreamcontroller.cpp b/LEGO1/mxstreamcontroller.cpp index c0ce4e65..47742680 100644 --- a/LEGO1/mxstreamcontroller.cpp +++ b/LEGO1/mxstreamcontroller.cpp @@ -134,12 +134,12 @@ MxResult MxStreamController::VTable0x30(MxDSAction* p_action) } // FUNCTION: LEGO1 0x100c1e70 -MxCore* MxStreamController::FUN_100c1e70(MxDSAction& p_obj) +MxCore* MxStreamController::FUN_100c1e70(MxDSAction& p_action) { MxAutoLocker locker(&m_criticalSection); MxCore* result = NULL; - if (p_obj.GetObjectId() != -1) { - MxDSAction* action = m_unk0x3c.Find(&p_obj, FALSE); + if (p_action.GetObjectId() != -1) { + MxDSAction* action = m_unk0x3c.Find(&p_action, FALSE); if (action != NULL) { result = (MxCore*) action->GetUnknown28(); } diff --git a/LEGO1/mxstreamcontroller.h b/LEGO1/mxstreamcontroller.h index fc651797..df61085b 100644 --- a/LEGO1/mxstreamcontroller.h +++ b/LEGO1/mxstreamcontroller.h @@ -44,7 +44,7 @@ class MxStreamController : public MxCore { MxResult FUN_100c1800(MxDSAction* p_action, MxU32 p_val); MxBool FUN_100c20d0(MxDSObject& p_obj); MxResult FUN_100c1a00(MxDSAction* p_action, MxU32 p_bufferval); - MxCore* FUN_100c1e70(MxDSAction& p_obj); + MxCore* FUN_100c1e70(MxDSAction& p_action); MxResult FUN_100c1f00(MxDSAction* p_action); inline MxAtomId& GetAtom() { return m_atom; };