From a3bd98a04d2788bc4ee74f0886f715f623e8f545 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 20 Apr 2024 12:03:42 -0400 Subject: [PATCH] Implement/match LegoAnimMMPresenter::FUN_1004b5b0 (#830) --- .../legoomni/include/legoanimmmpresenter.h | 3 ++- .../lego/legoomni/include/legoanimpresenter.h | 3 ++- .../src/common/legoanimmmpresenter.cpp | 26 ++++++++++++++++--- .../legoomni/src/video/legoanimpresenter.cpp | 2 +- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimmmpresenter.h b/LEGO1/lego/legoomni/include/legoanimmmpresenter.h index eb040af0..aeeed0a2 100644 --- a/LEGO1/lego/legoomni/include/legoanimmmpresenter.h +++ b/LEGO1/lego/legoomni/include/legoanimmmpresenter.h @@ -2,6 +2,7 @@ #define LEGOANIMMMPRESENTER_H #include "mxcompositepresenter.h" +#include "mxgeometry/mxmatrix.h" class LegoAnimPresenter; class LegoWorld; @@ -74,7 +75,7 @@ class LegoAnimMMPresenter : public MxCompositePresenter { MxU32 m_animmanId; // 0x5c LegoTranInfo* m_tranInfo; // 0x60 LegoWorld* m_unk0x64; // 0x64 - Matrix4* m_unk0x68; // 0x68 + MxMatrix* m_unk0x68; // 0x68 LegoROI** m_roiMap; // 0x6c MxU32 m_roiMapSize; // 0x70 }; diff --git a/LEGO1/lego/legoomni/include/legoanimpresenter.h b/LEGO1/lego/legoomni/include/legoanimpresenter.h index 17d741d1..b948bdad 100644 --- a/LEGO1/lego/legoomni/include/legoanimpresenter.h +++ b/LEGO1/lego/legoomni/include/legoanimpresenter.h @@ -4,6 +4,7 @@ #include "anim/legoanim.h" #include "legoroilist.h" #include "mxgeometry/mxgeometry3d.h" +#include "mxgeometry/mxmatrix.h" #include "mxvideopresenter.h" class LegoWorld; @@ -71,7 +72,7 @@ class LegoAnimPresenter : public MxVideoPresenter { virtual void VTable0xa0(Matrix4*); // vtable+0xa0 - MxResult FUN_1006afc0(Matrix4*&, undefined4); + MxResult FUN_1006afc0(MxMatrix*&, undefined4); MxResult FUN_1006b140(LegoROI* p_roi); void FUN_1006d680(LegoAnimActor* p_actor, MxFloat p_value); diff --git a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp index 487f4fff..364454d3 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp @@ -325,6 +325,7 @@ MxBool LegoAnimMMPresenter::FUN_1004b580(MxLong p_time) m_tranInfo->m_unk0x20[0] > p_time) { return FALSE; } + break; case 1: case 2: case 3: @@ -336,12 +337,31 @@ MxBool LegoAnimMMPresenter::FUN_1004b580(MxLong p_time) return TRUE; } -// STUB: LEGO1 0x1004b5b0 +// FUNCTION: LEGO1 0x1004b5b0 // FUNCTION: BETA10 0x1004cb09 MxBool LegoAnimMMPresenter::FUN_1004b5b0(MxLong p_time) { - // TODO - return FALSE; + switch (m_unk0x59) { + case 0: + if (m_roiMap != NULL && m_unk0x68 != NULL) { + for (MxU32 i = 0; i < m_roiMapSize; i++) { + LegoROI* roi = m_roiMap[i]; + + if (roi != NULL) { + roi->WrappedSetLocalTransform(m_unk0x68[i]); + } + } + } + break; + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + + return TRUE; } // STUB: LEGO1 0x1004b600 diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index 2c545dda..3728fb97 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -565,7 +565,7 @@ void LegoAnimPresenter::PutFrame() // STUB: LEGO1 0x1006afc0 // FUNCTION: BETA10 0x1005059a -MxResult LegoAnimPresenter::FUN_1006afc0(Matrix4*&, undefined4) +MxResult LegoAnimPresenter::FUN_1006afc0(MxMatrix*&, undefined4) { // TODO return SUCCESS;