Implement/match LegoAnimPresenter::FUN_1006b140 (#963)

This commit is contained in:
Christian Semmler
2024-05-28 15:23:23 -04:00
committed by GitHub
parent 60b747d7b2
commit da48dfb40d
3 changed files with 136 additions and 10 deletions

View File

@@ -84,11 +84,11 @@ public:
const char* GetActionObjectName();
inline void SetCurrentWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; }
inline void SetUnknown0x0cTo1() { m_unk0x9c = 1; }
inline void SetUnknown0xa0(MxMatrix* p_unk0xa0) { m_unk0xa0 = p_unk0xa0; }
inline LegoAnim* GetAnimation() { return m_anim; }
friend class LegoPathBoundary;
protected:
void Init();
void Destroy(MxBool p_fromDestructor);
@@ -128,9 +128,11 @@ protected:
undefined m_unk0x97; // 0x97
LegoAnimSubstMap* m_substMap; // 0x98
MxS16 m_unk0x9c; // 0x9c
undefined4* m_unk0xa0; // 0xa0
float m_unk0xa4; // 0xa4
Mx3DPointFloat m_unk0xa8; // 0xa8
MxMatrix* m_unk0xa0; // 0xa0
public:
float m_unk0xa4; // 0xa4
Mx3DPointFloat m_unk0xa8; // 0xa8
};
// clang-format off

View File

@@ -121,7 +121,7 @@ void LegoAnimPresenter::Destroy(MxBool p_fromDestructor)
}
if (m_unk0xa0 != NULL) {
delete m_unk0xa0; // TODO
delete m_unk0xa0;
}
Init();
@@ -699,11 +699,57 @@ MxResult LegoAnimPresenter::FUN_1006afc0(MxMatrix*& p_matrix, float p_und)
return SUCCESS;
}
// STUB: LEGO1 0x1006b140
// FUNCTION: LEGO1 0x1006b140
// FUNCTION: BETA10 0x100507e0
MxResult LegoAnimPresenter::FUN_1006b140(LegoROI* p_roi)
{
// TODO
if (p_roi == NULL) {
return FAILURE;
}
MxMatrix* mn = new MxMatrix();
MxMatrix local58;
const Matrix4& local2world = p_roi->GetLocal2World();
MxMatrix* local5c;
MxU32 i;
if (FUN_1006afc0(local5c, 0.0f) != SUCCESS) {
goto done;
}
for (i = 1; i <= m_roiMapSize; i++) {
if (m_roiMap[i] == p_roi) {
if (local5c[i].Unknown(local58) != SUCCESS) {
goto done;
}
break;
}
}
{
((Matrix4*) mn)->Product(local58, local2world);
SetUnknown0xa0(mn);
delete[] local5c;
SetUnknown0x0cTo1();
MxMatrix local140(*m_unk0x78);
MxMatrix localf8;
localf8.Product(local140, *m_unk0xa0);
((Matrix4&) *m_unk0x78) = localf8;
return SUCCESS;
}
done:
if (mn != NULL) {
delete mn;
}
if (local5c != NULL) {
delete[] local5c;
}
return FAILURE;
}