diff --git a/LEGO1/lego/sources/roi/legoroi.cpp b/LEGO1/lego/sources/roi/legoroi.cpp index d4649093..e5f5e490 100644 --- a/LEGO1/lego/sources/roi/legoroi.cpp +++ b/LEGO1/lego/sources/roi/legoroi.cpp @@ -404,10 +404,34 @@ LegoResult LegoROI::FUN_100a8da0(LegoTreeNode* p_node, const Matrix4& p_matrix, return SUCCESS; } -// STUB: LEGO1 0x100a8e80 -void LegoROI::FUN_100a8e80(LegoTreeNode*, Matrix4&, LegoTime, LegoROI**) +// FUNCTION: LEGO1 0x100a8e80 +void LegoROI::FUN_100a8e80(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_rois) { - // TODO + MxMatrix mat; + + LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData(); + FUN_100a8cb0(data, p_time, mat); + + LegoROI* roi = p_rois[data->GetUnknown0x20()]; + if (roi != NULL) { + roi->m_local2world.Product(mat, p_matrix); + roi->VTable0x1c(); + + LegoBool und = data->FUN_100a0990(p_time); + roi->SetVisibility(und); + + for (LegoU32 i = 0; i < p_node->GetNumChildren(); i++) { + FUN_100a8e80(p_node->GetChild(i), roi->m_local2world, p_time, p_rois); + } + } + else { + MxMatrix local2world; + local2world.Product(mat, p_matrix); + + for (LegoU32 i = 0; i < p_node->GetNumChildren(); i++) { + FUN_100a8e80(p_node->GetChild(i), local2world, p_time, p_rois); + } + } } // FUNCTION: LEGO1 0x100a90f0 diff --git a/LEGO1/lego/sources/roi/legoroi.h b/LEGO1/lego/sources/roi/legoroi.h index 32ce1371..68309a91 100644 --- a/LEGO1/lego/sources/roi/legoroi.h +++ b/LEGO1/lego/sources/roi/legoroi.h @@ -32,7 +32,7 @@ class LegoROI : public ViewROI { ); LegoROI* FUN_100a8ce0(const LegoChar* p_name, LegoROI* p_roi); LegoResult FUN_100a8da0(LegoTreeNode* p_node, const Matrix4& p_matrix, LegoTime p_time, LegoROI* p_roi); - static void FUN_100a8e80(LegoTreeNode*, Matrix4&, LegoTime, LegoROI**); + static void FUN_100a8e80(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_time, LegoROI** p_rois); LegoResult SetFrame(LegoAnim* p_anim, LegoTime p_time); LegoResult FUN_100a9170(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha); LegoResult FUN_100a9210(LegoTextureInfo* p_textureInfo);