From 605d396eac68a3b9fc79a455f286dfe7b71a22f7 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 24 Apr 2024 09:22:00 -0400 Subject: [PATCH] Implement/match various small LegoAnimPresenter functions --- .../lego/legoomni/include/legoanimpresenter.h | 5 ++- .../legoomni/include/legopathcontroller.h | 1 + LEGO1/lego/legoomni/include/legoworld.h | 1 + .../src/common/legoanimmmpresenter.cpp | 2 +- LEGO1/lego/legoomni/src/entity/legoworld.cpp | 12 ++++++ .../legoomni/src/paths/legopathcontroller.cpp | 6 +++ .../legoomni/src/video/legoanimpresenter.cpp | 39 +++++++++++++++---- 7 files changed, 55 insertions(+), 11 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimpresenter.h b/LEGO1/lego/legoomni/include/legoanimpresenter.h index 02a81b37..141bbdcd 100644 --- a/LEGO1/lego/legoomni/include/legoanimpresenter.h +++ b/LEGO1/lego/legoomni/include/legoanimpresenter.h @@ -10,6 +10,7 @@ class LegoWorld; class LegoAnimClass; class LegoAnimActor; +class LegoPathBoundary; struct LegoAnimStructComparator { MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmp(p_a, p_b) < 0; } @@ -62,7 +63,7 @@ class LegoAnimPresenter : public MxVideoPresenter { virtual void VTable0x8c(); // vtable+0x8c virtual void VTable0x90(); // vtable+0x90 virtual MxResult VTable0x94(Vector3&, Vector3&, float, float, Vector3&); // vtable+0x94 - virtual void VTable0x98(); // vtable+0x98 + virtual MxResult VTable0x98(LegoPathBoundary* p_boundary); // vtable+0x98 // FUNCTION: LEGO1 0x1000c990 virtual LegoROI** GetROIMap(MxU32& p_roiMapSize) @@ -71,7 +72,7 @@ class LegoAnimPresenter : public MxVideoPresenter { return m_roiMap; } // vtable+0x9c - virtual void VTable0xa0(Matrix4*); // vtable+0xa0 + virtual void VTable0xa0(Matrix4& p_matrix); // vtable+0xa0 MxResult FUN_1006afc0(MxMatrix*& p_matrix, float p_und); MxResult FUN_1006b140(LegoROI* p_roi); diff --git a/LEGO1/lego/legoomni/include/legopathcontroller.h b/LEGO1/lego/legoomni/include/legopathcontroller.h index c9037091..5a55fa0e 100644 --- a/LEGO1/lego/legoomni/include/legopathcontroller.h +++ b/LEGO1/lego/legoomni/include/legopathcontroller.h @@ -43,6 +43,7 @@ class LegoPathController : public MxCore { undefined4 FUN_10046770(LegoPathActor* p_actor); void FUN_100468f0(LegoAnimPresenter* p_presenter); + void FUN_10046930(LegoAnimPresenter* p_presenter); MxResult FUN_10046b30(LegoPathBoundary** p_path, MxS32& p_value); void Enable(MxBool p_enable); void FUN_10046bb0(LegoWorld* p_world); diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index d1841669..f882b685 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -75,6 +75,7 @@ class LegoWorld : public LegoEntity { ); void FUN_1001fc80(IslePathActor* p_actor); void FUN_1001fda0(LegoAnimPresenter* p_presenter); + void FUN_1001fe90(LegoAnimPresenter* p_presenter); void AddPath(LegoPathController* p_controller); MxResult GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value); MxCore* Find(const char* p_class, const char* p_name); diff --git a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp index 219502fe..17b47b46 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp @@ -149,7 +149,7 @@ void LegoAnimMMPresenter::ReadyTickle() } if (m_tranInfo != NULL && m_tranInfo->m_unk0x0c != NULL) { - m_presenter->VTable0xa0(m_tranInfo->m_unk0x0c); + m_presenter->VTable0xa0(*m_tranInfo->m_unk0x0c); } if (m_presenter != NULL) { diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index cf42b0e3..cfae9c2e 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -311,6 +311,18 @@ void LegoWorld::FUN_1001fda0(LegoAnimPresenter* p_presenter) } } +// FUNCTION: LEGO1 0x1001fe90 +// FUNCTION: BETA10 0x100da6b5 +void LegoWorld::FUN_1001fe90(LegoAnimPresenter* p_presenter) +{ + LegoPathControllerListCursor cursor(&m_list0x68); + LegoPathController* controller; + + while (cursor.Next(controller)) { + controller->FUN_10046930(p_presenter); + } +} + // FUNCTION: LEGO1 0x1001ff80 void LegoWorld::AddPath(LegoPathController* p_controller) { diff --git a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp index 51c6e723..422b972f 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp @@ -39,6 +39,12 @@ void LegoPathController::FUN_100468f0(LegoAnimPresenter* p_presenter) { } +// STUB: LEGO1 0x10046930 +// FUNCTION: BETA10 0x100b737b +void LegoPathController::FUN_10046930(LegoAnimPresenter* p_presenter) +{ +} + // STUB: LEGO1 0x10046b30 MxResult LegoPathController::FUN_10046b30(LegoPathBoundary** p_path, MxS32& p_value) { diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index 892bc06f..51276c4f 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -805,10 +805,15 @@ void LegoAnimPresenter::ParseExtra() // TODO } -// STUB: LEGO1 0x1006c570 -void LegoAnimPresenter::VTable0xa0(Matrix4*) +// FUNCTION: LEGO1 0x1006c570 +// FUNCTION: BETA10 0x10051ab3 +void LegoAnimPresenter::VTable0xa0(Matrix4& p_matrix) { - // TODO + if (m_unk0x78 != NULL) { + delete m_unk0x78; + } + + m_unk0x78 = new MxMatrix(p_matrix); } // FUNCTION: LEGO1 0x1006c620 @@ -882,10 +887,19 @@ void LegoAnimPresenter::VTable0x8c() } } -// STUB: LEGO1 0x1006c860 +// FUNCTION: LEGO1 0x1006c860 +// FUNCTION: BETA10 0x10051f45 void LegoAnimPresenter::VTable0x90() { - // TODO + if (m_currentWorld != NULL) { + m_currentWorld->FUN_1001fe90(this); + + if (m_compositePresenter != NULL && m_compositePresenter->IsA("LegoAnimMMPresenter")) { + return; + } + + m_currentWorld->Remove(this); + } } // FUNCTION: LEGO1 0x1006c8a0 @@ -914,10 +928,19 @@ MxResult LegoAnimPresenter::VTable0x94(Vector3&, Vector3&, float, float, Vector3 return SUCCESS; } -// STUB: LEGO1 0x1006ca50 -void LegoAnimPresenter::VTable0x98() +// FUNCTION: LEGO1 0x1006ca50 +// FUNCTION: BETA10 0x100521d0 +MxResult LegoAnimPresenter::VTable0x98(LegoPathBoundary* p_boundary) { - // TODO + for (MxU32 i = 1; i <= m_roiMapSize; i++) { + LegoEntity* entity = m_roiMap[i]->GetEntity(); + + if (entity != NULL) { + p_boundary->AddActor((LegoPathActor*) entity); + } + } + + return SUCCESS; } // STUB: LEGO1 0x1006d680