From 6d6971734bf7daa48b61c3ef7e2f8df7080fd818 Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Thu, 17 Jul 2025 01:19:17 +0200 Subject: [PATCH 1/3] Clear unknowns in `LegoROI` (#1630) --- LEGO1/lego/legoomni/src/actors/act2actor.cpp | 2 +- LEGO1/lego/legoomni/src/actors/act3actors.cpp | 6 ++-- .../lego/legoomni/src/paths/legoanimactor.cpp | 2 +- .../legoomni/src/paths/legoextraactor.cpp | 2 +- .../legoomni/src/video/legoanimpresenter.cpp | 4 +-- LEGO1/lego/sources/roi/legoroi.cpp | 34 +++++++++---------- LEGO1/lego/sources/roi/legoroi.h | 21 +++++++----- 7 files changed, 38 insertions(+), 33 deletions(-) diff --git a/LEGO1/lego/legoomni/src/actors/act2actor.cpp b/LEGO1/lego/legoomni/src/actors/act2actor.cpp index bf531641..743934c1 100644 --- a/LEGO1/lego/legoomni/src/actors/act2actor.cpp +++ b/LEGO1/lego/legoomni/src/actors/act2actor.cpp @@ -631,7 +631,7 @@ MxU32 Act2Actor::FUN_10019700(MxFloat p_param) MxFloat time = p_param - (m_unk0x2c - m_shootAnim->GetDuration()); for (MxS32 i = 0; i < root->GetNumChildren(); i++) { - LegoROI::FUN_100a8e80(root->GetChild(i), matrix, time, m_shootAnim->GetROIMap()); + LegoROI::ApplyAnimationTransformation(root->GetChild(i), matrix, time, m_shootAnim->GetROIMap()); } return FALSE; diff --git a/LEGO1/lego/legoomni/src/actors/act3actors.cpp b/LEGO1/lego/legoomni/src/actors/act3actors.cpp index c9750667..9a2acd16 100644 --- a/LEGO1/lego/legoomni/src/actors/act3actors.cpp +++ b/LEGO1/lego/legoomni/src/actors/act3actors.cpp @@ -638,7 +638,7 @@ void Act3Brickster::Animate(float p_time) float time = p_time - (m_unk0x50 - m_shootAnim->GetDuration()); for (MxS32 i = 0; i < root->GetNumChildren(); i++) { - LegoROI::FUN_100a8e80(root->GetChild(i), local70, time, m_shootAnim->GetROIMap()); + LegoROI::ApplyAnimationTransformation(root->GetChild(i), local70, time, m_shootAnim->GetROIMap()); } } @@ -685,7 +685,7 @@ void Act3Brickster::Animate(float p_time) float time = p_time - (m_unk0x50 - m_shootAnim->GetDuration()); for (MxS32 i = 0; i < root->GetNumChildren(); i++) { - LegoROI::FUN_100a8e80(root->GetChild(i), locale4, time, m_shootAnim->GetROIMap()); + LegoROI::ApplyAnimationTransformation(root->GetChild(i), locale4, time, m_shootAnim->GetROIMap()); } } @@ -1186,7 +1186,7 @@ void Act3Shark::Animate(float p_time) vec = m_unk0x3c; LegoTreeNode* node = m_unk0x34->GetAnimTreePtr()->GetRoot(); - LegoROI::FUN_100a8e80(node, mat, duration, m_unk0x34->GetROIMap()); + LegoROI::ApplyAnimationTransformation(node, mat, duration, m_unk0x34->GetROIMap()); } else { roiMap[1] = m_unk0x38; diff --git a/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp b/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp index 182945d5..f6ca062c 100644 --- a/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp @@ -133,7 +133,7 @@ MxResult LegoAnimActor::FUN_1001c360(float p_und, Matrix4& p_transform) } for (MxS32 j = 0; j < n->GetNumChildren(); j++) { - LegoROI::FUN_100a8e80(n->GetChild(j), p_transform, p_und, roiMap); + LegoROI::ApplyAnimationTransformation(n->GetChild(j), p_transform, p_und, roiMap); } if (m_cameraFlag) { diff --git a/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp b/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp index 45633818..b9cd25bb 100644 --- a/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp @@ -373,7 +373,7 @@ void LegoExtraActor::Animate(float p_time) MxS32 count = root->GetNumChildren(); for (MxS32 i = 0; i < count; i++) { - LegoROI::FUN_100a8e80(root->GetChild(i), matrix, duration2, laas->m_roiMap); + LegoROI::ApplyAnimationTransformation(root->GetChild(i), matrix, duration2, laas->m_roiMap); } } } diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index f966cf38..d3f38b22 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -906,7 +906,7 @@ void LegoAnimPresenter::FUN_1006b900(LegoAnim* p_anim, MxLong p_time, Matrix4* p } } - LegoROI::FUN_100a8fd0(root, mat, p_time, m_roiMap); + LegoROI::ApplyTransform(root, mat, p_time, m_roiMap); } // FUNCTION: LEGO1 0x1006b9a0 @@ -940,7 +940,7 @@ void LegoAnimPresenter::FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, Matrix4* p } } - LegoROI::FUN_100a8e80(root, mat, p_time, m_roiMap); + LegoROI::ApplyAnimationTransformation(root, mat, p_time, m_roiMap); } // FUNCTION: LEGO1 0x1006bac0 diff --git a/LEGO1/lego/sources/roi/legoroi.cpp b/LEGO1/lego/sources/roi/legoroi.cpp index 25d4362e..02ed727a 100644 --- a/LEGO1/lego/sources/roi/legoroi.cpp +++ b/LEGO1/lego/sources/roi/legoroi.cpp @@ -114,7 +114,7 @@ LegoROI::~LegoROI() // FUNCTION: LEGO1 0x100a84a0 // FUNCTION: BETA10 0x10189b99 LegoResult LegoROI::Read( - OrientableROI* p_unk0xd4, + OrientableROI* p_parentROI, Tgl::Renderer* p_renderer, ViewLODListManager* p_viewLODListManager, LegoTextureContainer* p_textureContainer, @@ -134,7 +134,7 @@ LegoResult LegoROI::Read( LegoSphere sphere; LegoBox box; - m_parentROI = p_unk0xd4; + m_parentROI = p_parentROI; if (p_storage->Read(&length, sizeof(LegoU32)) != SUCCESS) { goto done; @@ -177,11 +177,11 @@ LegoResult LegoROI::Read( textureName = NULL; } - if (p_storage->Read(&m_unk0x100, sizeof(undefined)) != SUCCESS) { + if (p_storage->Read(&m_sharedLodList, sizeof(LegoBool)) != SUCCESS) { goto done; } - if (m_unk0x100) { + if (m_sharedLodList) { for (roiLength = strlen(m_name); roiLength; roiLength--) { if (m_name[roiLength - 1] < '0' || m_name[roiLength - 1] > '9') { break; @@ -389,7 +389,7 @@ LegoROI* LegoROI::FindChildROI(const LegoChar* p_name, LegoROI* p_roi) // FUNCTION: LEGO1 0x100a8da0 // FUNCTION: BETA10 0x1018a9fb -LegoResult LegoROI::ApplyAnimationTransformation( +LegoResult LegoROI::ApplyChildAnimationTransformation( LegoTreeNode* p_node, const Matrix4& p_matrix, LegoTime p_time, @@ -410,11 +410,11 @@ LegoResult LegoROI::ApplyAnimationTransformation( roi->m_local2world.Product(mat, p_matrix); roi->UpdateWorldData(); - LegoBool und = data->GetVisibility(p_time); - roi->SetVisibility(und); + LegoBool visibility = data->GetVisibility(p_time); + roi->SetVisibility(visibility); for (LegoU32 i = 0; i < p_node->GetNumChildren(); i++) { - ApplyAnimationTransformation(p_node->GetChild(i), roi->m_local2world, p_time, roi); + ApplyChildAnimationTransformation(p_node->GetChild(i), roi->m_local2world, p_time, roi); } } else { @@ -426,7 +426,7 @@ LegoResult LegoROI::ApplyAnimationTransformation( // FUNCTION: LEGO1 0x100a8e80 // FUNCTION: BETA10 0x1018ab3a -void LegoROI::FUN_100a8e80(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap) +void LegoROI::ApplyAnimationTransformation(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap) { MxMatrix mat; @@ -438,11 +438,11 @@ void LegoROI::FUN_100a8e80(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_t roi->m_local2world.Product(mat, p_matrix); roi->UpdateWorldData(); - LegoBool und = data->GetVisibility(p_time); - roi->SetVisibility(und); + LegoBool visiblity = data->GetVisibility(p_time); + roi->SetVisibility(visiblity); for (LegoU32 i = 0; i < p_node->GetNumChildren(); i++) { - FUN_100a8e80(p_node->GetChild(i), roi->m_local2world, p_time, p_roiMap); + ApplyAnimationTransformation(p_node->GetChild(i), roi->m_local2world, p_time, p_roiMap); } } else { @@ -450,14 +450,14 @@ void LegoROI::FUN_100a8e80(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_t local2world.Product(mat, p_matrix); for (LegoU32 i = 0; i < p_node->GetNumChildren(); i++) { - FUN_100a8e80(p_node->GetChild(i), local2world, p_time, p_roiMap); + ApplyAnimationTransformation(p_node->GetChild(i), local2world, p_time, p_roiMap); } } } // FUNCTION: LEGO1 0x100a8fd0 // FUNCTION: BETA10 0x1018ac81 -void LegoROI::FUN_100a8fd0(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap) +void LegoROI::ApplyTransform(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap) { MxMatrix mat; @@ -469,7 +469,7 @@ void LegoROI::FUN_100a8fd0(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_t roi->m_local2world.Product(mat, p_matrix); for (LegoU32 i = 0; i < p_node->GetNumChildren(); i++) { - FUN_100a8fd0(p_node->GetChild(i), roi->m_local2world, p_time, p_roiMap); + ApplyTransform(p_node->GetChild(i), roi->m_local2world, p_time, p_roiMap); } } else { @@ -477,7 +477,7 @@ void LegoROI::FUN_100a8fd0(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_t local2world.Product(mat, p_matrix); for (LegoU32 i = 0; i < p_node->GetNumChildren(); i++) { - FUN_100a8fd0(p_node->GetChild(i), local2world, p_time, p_roiMap); + ApplyTransform(p_node->GetChild(i), local2world, p_time, p_roiMap); } } } @@ -492,7 +492,7 @@ LegoResult LegoROI::SetFrame(LegoAnim* p_anim, LegoTime p_time) mat = m_local2world; mat.SetIdentity(); // this clears the matrix, assignment above is redundant - return ApplyAnimationTransformation(root, mat, p_time, this); + return ApplyChildAnimationTransformation(root, mat, p_time, this); } // FUNCTION: LEGO1 0x100a9170 diff --git a/LEGO1/lego/sources/roi/legoroi.h b/LEGO1/lego/sources/roi/legoroi.h index 216bb68d..47e0a74d 100644 --- a/LEGO1/lego/sources/roi/legoroi.h +++ b/LEGO1/lego/sources/roi/legoroi.h @@ -26,21 +26,26 @@ class LegoROI : public ViewROI { ~LegoROI() override; LegoResult Read( - OrientableROI* p_unk0xd4, + OrientableROI* p_parentROI, Tgl::Renderer* p_renderer, ViewLODListManager* p_viewLODListManager, LegoTextureContainer* p_textureContainer, LegoStorage* p_storage ); LegoROI* FindChildROI(const LegoChar* p_name, LegoROI* p_roi); - LegoResult ApplyAnimationTransformation( + LegoResult ApplyChildAnimationTransformation( LegoTreeNode* p_node, const Matrix4& p_matrix, LegoTime p_time, LegoROI* p_roi ); - static void FUN_100a8e80(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap); - static void FUN_100a8fd0(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap); + static void ApplyAnimationTransformation( + LegoTreeNode* p_node, + Matrix4& p_matrix, + LegoTime p_time, + LegoROI** p_roiMap + ); + static void ApplyTransform(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap); LegoResult SetFrame(LegoAnim* p_anim, LegoTime p_time); LegoResult SetLodColor(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha); LegoResult SetTextureInfo(LegoTextureInfo* p_textureInfo); @@ -91,10 +96,10 @@ class LegoROI : public ViewROI { // LegoROI::`scalar deleting destructor' private: - LegoChar* m_name; // 0xe4 - BoundingSphere m_sphere; // 0xe8 - undefined m_unk0x100; // 0x100 - LegoEntity* m_entity; // 0x104 + LegoChar* m_name; // 0xe4 + BoundingSphere m_sphere; // 0xe8 + LegoBool m_sharedLodList; // 0x100 + LegoEntity* m_entity; // 0x104 }; // VTABLE: LEGO1 0x100dbea8 From 66844aa9458bab54e7ccc7188f242a4c26141c2c Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Fri, 18 Jul 2025 01:53:35 +0200 Subject: [PATCH 2/3] Clear unknown in `TimeROI` (#1631) --- LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp | 2 +- LEGO1/lego/legoomni/src/entity/legopovcontroller.cpp | 2 +- LEGO1/lego/sources/roi/legoroi.cpp | 2 +- LEGO1/lego/sources/roi/legoroi.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp b/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp index 563ba615..2f192058 100644 --- a/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp +++ b/LEGO1/lego/legoomni/src/entity/legocameracontroller.cpp @@ -171,7 +171,7 @@ void LegoCameraController::FUN_100123e0(const Matrix4& p_transform, MxU32 p_und) mat = p_transform; } - ((TimeROI*) pov)->FUN_100a9b40(mat, Timer()->GetTime()); + ((TimeROI*) pov)->CalculateWorldVelocity(mat, Timer()->GetTime()); pov->WrappedSetLocal2WorldWithWorldDataUpdate(mat); m_lego3DView->Moved(*pov); diff --git a/LEGO1/lego/legoomni/src/entity/legopovcontroller.cpp b/LEGO1/lego/legoomni/src/entity/legopovcontroller.cpp index 7541e98b..fc823c60 100644 --- a/LEGO1/lego/legoomni/src/entity/legopovcontroller.cpp +++ b/LEGO1/lego/legoomni/src/entity/legopovcontroller.cpp @@ -153,7 +153,7 @@ MxResult LegoPointOfViewController::Tickle() MxMatrix mat; CalcLocalTransform(newPos, newDir, pov->GetWorldUp(), mat); - ((TimeROI*) pov)->FUN_100a9b40(mat, Timer()->GetTime()); + ((TimeROI*) pov)->CalculateWorldVelocity(mat, Timer()->GetTime()); pov->WrappedSetLocal2WorldWithWorldDataUpdate(mat); m_lego3DView->Moved(*pov); diff --git a/LEGO1/lego/sources/roi/legoroi.cpp b/LEGO1/lego/sources/roi/legoroi.cpp index 02ed727a..a8f16636 100644 --- a/LEGO1/lego/sources/roi/legoroi.cpp +++ b/LEGO1/lego/sources/roi/legoroi.cpp @@ -755,7 +755,7 @@ TimeROI::TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, LegoTime p_t // FUNCTION: LEGO1 0x100a9b40 // FUNCTION: BETA10 0x1018bbf0 -void TimeROI::FUN_100a9b40(Matrix4& p_matrix, LegoTime p_time) +void TimeROI::CalculateWorldVelocity(Matrix4& p_matrix, LegoTime p_time) { LegoTime time = p_time - m_time; diff --git a/LEGO1/lego/sources/roi/legoroi.h b/LEGO1/lego/sources/roi/legoroi.h index 47e0a74d..7f475680 100644 --- a/LEGO1/lego/sources/roi/legoroi.h +++ b/LEGO1/lego/sources/roi/legoroi.h @@ -109,7 +109,7 @@ class TimeROI : public LegoROI { public: TimeROI(Tgl::Renderer* p_renderer, ViewLODList* p_lodList, LegoTime p_time); - void FUN_100a9b40(Matrix4& p_matrix, LegoTime p_time); + void CalculateWorldVelocity(Matrix4& p_matrix, LegoTime p_time); // SYNTHETIC: LEGO1 0x100a9ad0 // SYNTHETIC: BETA10 0x1018c540 From cfd36ec88ff47b1eb3c58a33c3fec26b3ca06854 Mon Sep 17 00:00:00 2001 From: Fabian Neundorf Date: Fri, 18 Jul 2025 23:26:34 +0200 Subject: [PATCH 3/3] Clear unknowns in `LegoPhonemePresenter` (#1632) --- LEGO1/lego/legoomni/include/legophonemepresenter.h | 4 ++-- .../legoomni/src/video/legophonemepresenter.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legophonemepresenter.h b/LEGO1/lego/legoomni/include/legophonemepresenter.h index e470f6b7..4a6a3c05 100644 --- a/LEGO1/lego/legoomni/include/legophonemepresenter.h +++ b/LEGO1/lego/legoomni/include/legophonemepresenter.h @@ -42,9 +42,9 @@ class LegoPhonemePresenter : public MxFlcPresenter { MxS32 m_rectCount; // 0x68 LegoTextureInfo* m_textureInfo; // 0x6c - MxBool m_unk0x70; // 0x70 + MxBool m_reusedPhoneme; // 0x70 MxString m_roiName; // 0x74 - MxBool m_unk0x84; // 0x84 + MxBool m_isPartOfAnimMM; // 0x84 }; // TEMPLATE: LEGO1 0x1004eb20 diff --git a/LEGO1/lego/legoomni/src/video/legophonemepresenter.cpp b/LEGO1/lego/legoomni/src/video/legophonemepresenter.cpp index 3e931ce6..ff019526 100644 --- a/LEGO1/lego/legoomni/src/video/legophonemepresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legophonemepresenter.cpp @@ -25,8 +25,8 @@ void LegoPhonemePresenter::Init() { m_rectCount = 0; m_textureInfo = NULL; - m_unk0x70 = FALSE; - m_unk0x84 = FALSE; + m_reusedPhoneme = FALSE; + m_isPartOfAnimMM = FALSE; } // FUNCTION: LEGO1 0x1004e3d0 @@ -49,7 +49,7 @@ void LegoPhonemePresenter::StartingTickle() if (m_compositePresenter != NULL && m_compositePresenter->IsA("LegoAnimMMPresenter")) { entityROI = FindROI(m_roiName.GetData()); - m_unk0x84 = TRUE; + m_isPartOfAnimMM = TRUE; } else { entityROI = CharacterManager()->GetActorROI(m_roiName.GetData(), TRUE); @@ -81,7 +81,7 @@ void LegoPhonemePresenter::StartingTickle() phoneme->SetCount(phoneme->GetCount() + 1); cursor.SetValue(phoneme); - m_unk0x70 = TRUE; + m_reusedPhoneme = TRUE; } } } @@ -139,7 +139,7 @@ void LegoPhonemePresenter::EndAction() if (phoneme->GetCount() == 1) { LegoROI* roi; - if (m_unk0x84) { + if (m_isPartOfAnimMM) { roi = FindROI(m_roiName.GetData()); } else { @@ -150,7 +150,7 @@ void LegoPhonemePresenter::EndAction() CharacterManager()->SetHeadTexture(roi, NULL); } - if (!m_unk0x84) { + if (!m_isPartOfAnimMM) { CharacterManager()->ReleaseActor(m_roiName.GetData()); } @@ -163,7 +163,7 @@ void LegoPhonemePresenter::EndAction() cursor.SetValue(phoneme); } - if (!m_unk0x84) { + if (!m_isPartOfAnimMM) { CharacterManager()->ReleaseActor(m_roiName.GetData()); } }