mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
Clear unknowns in LegoAnimPresenter
and related classes (#1565)
* Clear unknowns in `LegoAnimPresenter` and related classes * Update LEGO1/lego/legoomni/include/legoanimpresenter.h --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
@@ -337,7 +337,7 @@ done:
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a8cb0
|
||||
LegoResult LegoROI::FUN_100a8cb0(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix)
|
||||
LegoResult LegoROI::CreateLocalTransform(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix)
|
||||
{
|
||||
p_matrix.SetIdentity();
|
||||
p_data->CreateLocalTransform(p_time, p_matrix);
|
||||
@@ -379,27 +379,32 @@ LegoROI* LegoROI::FindChildROI(const LegoChar* p_name, LegoROI* p_roi)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a8da0
|
||||
LegoResult LegoROI::FUN_100a8da0(LegoTreeNode* p_node, const Matrix4& p_matrix, LegoTime p_time, LegoROI* p_roi)
|
||||
LegoResult LegoROI::ApplyAnimationTransformation(
|
||||
LegoTreeNode* p_node,
|
||||
const Matrix4& p_matrix,
|
||||
LegoTime p_time,
|
||||
LegoROI* p_parentROI
|
||||
)
|
||||
{
|
||||
MxMatrix mat;
|
||||
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
|
||||
const LegoChar* name = data->GetName();
|
||||
LegoROI* roi = FindChildROI(name, p_roi);
|
||||
LegoROI* roi = FindChildROI(name, p_parentROI);
|
||||
|
||||
if (roi == NULL) {
|
||||
roi = FindChildROI(name, this);
|
||||
}
|
||||
|
||||
if (roi != NULL) {
|
||||
FUN_100a8cb0(data, p_time, mat);
|
||||
CreateLocalTransform(data, p_time, mat);
|
||||
roi->m_local2world.Product(mat, p_matrix);
|
||||
roi->UpdateWorldData();
|
||||
|
||||
LegoBool und = data->FUN_100a0990(p_time);
|
||||
LegoBool und = data->GetVisibility(p_time);
|
||||
roi->SetVisibility(und);
|
||||
|
||||
for (LegoU32 i = 0; i < p_node->GetNumChildren(); i++) {
|
||||
FUN_100a8da0(p_node->GetChild(i), roi->m_local2world, p_time, roi);
|
||||
ApplyAnimationTransformation(p_node->GetChild(i), roi->m_local2world, p_time, roi);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -416,14 +421,14 @@ void LegoROI::FUN_100a8e80(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_t
|
||||
MxMatrix mat;
|
||||
|
||||
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
|
||||
FUN_100a8cb0(data, p_time, mat);
|
||||
CreateLocalTransform(data, p_time, mat);
|
||||
|
||||
LegoROI* roi = p_roiMap[data->GetUnknown0x20()];
|
||||
LegoROI* roi = p_roiMap[data->GetROIIndex()];
|
||||
if (roi != NULL) {
|
||||
roi->m_local2world.Product(mat, p_matrix);
|
||||
roi->UpdateWorldData();
|
||||
|
||||
LegoBool und = data->FUN_100a0990(p_time);
|
||||
LegoBool und = data->GetVisibility(p_time);
|
||||
roi->SetVisibility(und);
|
||||
|
||||
for (LegoU32 i = 0; i < p_node->GetNumChildren(); i++) {
|
||||
@@ -447,9 +452,9 @@ void LegoROI::FUN_100a8fd0(LegoTreeNode* p_node, Matrix4& p_matrix, LegoTime p_t
|
||||
MxMatrix mat;
|
||||
|
||||
LegoAnimNodeData* data = (LegoAnimNodeData*) p_node->GetData();
|
||||
FUN_100a8cb0(data, p_time, mat);
|
||||
CreateLocalTransform(data, p_time, mat);
|
||||
|
||||
LegoROI* roi = p_roiMap[data->GetUnknown0x20()];
|
||||
LegoROI* roi = p_roiMap[data->GetROIIndex()];
|
||||
if (roi != NULL) {
|
||||
roi->m_local2world.Product(mat, p_matrix);
|
||||
|
||||
@@ -474,9 +479,9 @@ LegoResult LegoROI::SetFrame(LegoAnim* p_anim, LegoTime p_time)
|
||||
MxMatrix mat;
|
||||
|
||||
mat = m_local2world;
|
||||
mat.SetIdentity();
|
||||
mat.SetIdentity(); // this clears the matrix, assignment above is redundant
|
||||
|
||||
return FUN_100a8da0(root, mat, p_time, this);
|
||||
return ApplyAnimationTransformation(root, mat, p_time, this);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100a9170
|
||||
|
@@ -32,7 +32,12 @@ public:
|
||||
LegoStorage* p_storage
|
||||
);
|
||||
LegoROI* FindChildROI(const LegoChar* p_name, LegoROI* p_roi);
|
||||
LegoResult FUN_100a8da0(LegoTreeNode* p_node, const Matrix4& p_matrix, LegoTime p_time, LegoROI* p_roi);
|
||||
LegoResult ApplyAnimationTransformation(
|
||||
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);
|
||||
LegoResult SetFrame(LegoAnim* p_anim, LegoTime p_time);
|
||||
@@ -51,7 +56,7 @@ public:
|
||||
void ClearMeshOffset();
|
||||
void SetDisplayBB(int p_displayBB);
|
||||
|
||||
static LegoResult FUN_100a8cb0(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix);
|
||||
static LegoResult CreateLocalTransform(LegoAnimNodeData* p_data, LegoTime p_time, Matrix4& p_matrix);
|
||||
static void FUN_100a81b0(const LegoChar* p_error, const LegoChar* p_name);
|
||||
static void configureLegoROI(int p_roi);
|
||||
static void SetColorOverride(ColorOverride p_colorOverride);
|
||||
|
Reference in New Issue
Block a user