From f898462d17352c1ed811d2bd75d4b634010cd781 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 24 Apr 2024 09:19:14 -0400 Subject: [PATCH] Implement/match LegoROI::FUN_100a8fd0 (#845) --- LEGO1/lego/sources/roi/legoroi.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/LEGO1/lego/sources/roi/legoroi.cpp b/LEGO1/lego/sources/roi/legoroi.cpp index 0bbed5da..7bee2c40 100644 --- a/LEGO1/lego/sources/roi/legoroi.cpp +++ b/LEGO1/lego/sources/roi/legoroi.cpp @@ -434,11 +434,31 @@ void LegoROI::FUN_100a8e80(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_t } } -// STUB: LEGO1 0x100a8fd0 +// FUNCTION: LEGO1 0x100a8fd0 // FUNCTION: BETA10 0x1018ac81 void LegoROI::FUN_100a8fd0(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_roiMap) { - // TODO + MxMatrix mat; + + LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData(); + FUN_100a8cb0(data, p_time, mat); + + LegoROI* roi = p_roiMap[data->GetUnknown0x20()]; + if (roi != NULL) { + 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); + } + } + else { + MxMatrix local2world; + 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); + } + } } // FUNCTION: LEGO1 0x100a90f0