Implement/match LegoAnimPresenter::FUN_1006b9a0 (#797)

This commit is contained in:
Christian Semmler 2024-04-13 12:05:43 -04:00 committed by GitHub
parent 67127e2515
commit 54421ebcdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 4 deletions

View file

@ -92,7 +92,7 @@ class LegoAnimPresenter : public MxVideoPresenter {
LegoBool FUN_1006aba0(); LegoBool FUN_1006aba0();
MxBool FUN_1006abb0(LegoTreeNode* p_node, LegoROI* p_roi); MxBool FUN_1006abb0(LegoTreeNode* p_node, LegoROI* p_roi);
void FUN_1006ac90(); void FUN_1006ac90();
void FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, MxMatrix& p_matrix); void FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix);
void FUN_1006c8a0(MxBool p_bool); void FUN_1006c8a0(MxBool p_bool);
LegoAnim* m_anim; // 0x64 LegoAnim* m_anim; // 0x64

View file

@ -523,7 +523,7 @@ void LegoAnimPresenter::PutFrame()
time = 0; time = 0;
} }
FUN_1006b9a0(m_anim, time, *m_unk0x78); FUN_1006b9a0(m_anim, time, m_unk0x78);
if (m_unk0x8c != NULL && m_currentWorld != NULL && m_currentWorld->GetCamera() != NULL) { if (m_unk0x8c != NULL && m_currentWorld != NULL && m_currentWorld->GetCamera() != NULL) {
for (MxS32 i = 0; i < m_unk0x94; i++) { for (MxS32 i = 0; i < m_unk0x94; i++) {
@ -690,9 +690,37 @@ const char* LegoAnimPresenter::GetActionObjectName()
return m_action->GetObjectName(); return m_action->GetObjectName();
} }
// STUB: LEGO1 0x1006b9a0 // FUNCTION: LEGO1 0x1006b9a0
void LegoAnimPresenter::FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, MxMatrix& p_matrix) void LegoAnimPresenter::FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix)
{ {
LegoTreeNode* root = p_anim->GetRoot();
MxMatrix mat;
LegoAnimNodeData* data = (LegoAnimNodeData*) root->GetData();
if (p_matrix != NULL) {
mat = *p_matrix;
}
else {
LegoROI* roi = m_unk0x68[data->GetUnknown0x20()];
if (roi != NULL) {
mat = roi->GetLocal2World();
}
else {
mat.SetIdentity();
}
}
if (p_anim->GetScene() != NULL) {
MxMatrix transform(mat);
p_anim->GetScene()->FUN_1009f490(p_time, transform);
if (m_currentWorld != NULL && m_currentWorld->GetCamera() != NULL) {
m_currentWorld->GetCamera()->FUN_100123e0(transform, 0);
}
}
LegoROI::FUN_100a8e80(root, mat, p_time, m_unk0x68);
} }
// STUB: LEGO1 0x1006bac0 // STUB: LEGO1 0x1006bac0

View file

@ -136,6 +136,13 @@ LegoResult LegoAnimScene::Read(LegoStorage* p_storage)
return result; return result;
} }
// STUB: LEGO1 0x1009f490
undefined4 LegoAnimScene::FUN_1009f490(LegoFloat p_time, Matrix4& p_matrix)
{
// TODO
return 0;
}
// FUNCTION: LEGO1 0x1009f900 // FUNCTION: LEGO1 0x1009f900
LegoAnimKey::LegoAnimKey() LegoAnimKey::LegoAnimKey()
{ {

View file

@ -123,6 +123,7 @@ class LegoAnimNodeData : public LegoTreeNodeData {
LegoU32 GetRotationIndex() { return m_rotationIndex; } LegoU32 GetRotationIndex() { return m_rotationIndex; }
LegoU32 GetScaleIndex() { return m_scaleIndex; } LegoU32 GetScaleIndex() { return m_scaleIndex; }
LegoU32 GetMorphIndex() { return m_morphIndex; } LegoU32 GetMorphIndex() { return m_morphIndex; }
undefined2 GetUnknown0x20() { return m_unk0x20; }
void SetTranslationIndex(LegoU32 p_translationIndex) { m_translationIndex = p_translationIndex; } void SetTranslationIndex(LegoU32 p_translationIndex) { m_translationIndex = p_translationIndex; }
void SetRotationIndex(LegoU32 p_rotationIndex) { m_rotationIndex = p_rotationIndex; } void SetRotationIndex(LegoU32 p_rotationIndex) { m_rotationIndex = p_rotationIndex; }
@ -207,6 +208,7 @@ class LegoAnimScene {
LegoAnimScene(); LegoAnimScene();
~LegoAnimScene(); ~LegoAnimScene();
LegoResult Read(LegoStorage* p_storage); LegoResult Read(LegoStorage* p_storage);
undefined4 FUN_1009f490(LegoFloat p_time, Matrix4& p_matrix);
private: private:
LegoU16 m_unk0x00; // 0x00 LegoU16 m_unk0x00; // 0x00
@ -234,6 +236,8 @@ class LegoAnim : public LegoTree {
const LegoChar* GetActorName(LegoU32 p_index); const LegoChar* GetActorName(LegoU32 p_index);
undefined4 GetActorUnknown0x04(LegoU32 p_index); undefined4 GetActorUnknown0x04(LegoU32 p_index);
inline LegoAnimScene* GetScene() { return m_scene; }
// SYNTHETIC: LEGO1 0x100a0ba0 // SYNTHETIC: LEGO1 0x100a0ba0
// LegoAnim::`scalar deleting destructor' // LegoAnim::`scalar deleting destructor'