Match FUN_1006b140() and related functions (#1623)

* Match on BETA10

* Possible improvement on Matrix4::Swap

* Document entropy build result

* Comments at at Matrix4::Invert

---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
jonschz 2025-07-13 16:50:51 +02:00 committed by GitHub
parent 657720c825
commit 40c1a40d2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 2 deletions

View File

@ -92,7 +92,11 @@ public:
const char* GetActionObjectName(); const char* GetActionObjectName();
void SetCurrentWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; } void SetCurrentWorld(LegoWorld* p_currentWorld) { m_currentWorld = p_currentWorld; }
// FUNCTION: BETA10 0x1005aad0
void SetUnknown0x0cTo1() { m_unk0x9c = 1; } void SetUnknown0x0cTo1() { m_unk0x9c = 1; }
// FUNCTION: BETA10 0x1005ab00
void SetUnknown0xa0(Matrix4* p_unk0xa0) { m_unk0xa0 = p_unk0xa0; } void SetUnknown0xa0(Matrix4* p_unk0xa0) { m_unk0xa0 = p_unk0xa0; }
LegoAnim* GetAnimation() { return m_anim; } LegoAnim* GetAnimation() { return m_anim; }

View File

@ -703,6 +703,9 @@ MxResult LegoAnimPresenter::FUN_1006b140(LegoROI* p_roi)
if (p_roi == NULL) { if (p_roi == NULL) {
return FAILURE; return FAILURE;
} }
#ifdef BETA10
MxMatrix unused_matrix;
#endif
Matrix4* mn = new MxMatrix(); Matrix4* mn = new MxMatrix();
assert(mn); assert(mn);

View File

@ -290,6 +290,8 @@ void Matrix4::RotateZ(const float& p_angle)
// FUNCTION: BETA10 0x1005a590 // FUNCTION: BETA10 0x1005a590
int Matrix4::Invert(Matrix4& p_mat) int Matrix4::Invert(Matrix4& p_mat)
{ {
// Inlined at LEGO1 0x1006b2d3
float copyData[4][4]; float copyData[4][4];
Matrix4 copy(copyData); Matrix4 copy(copyData);
copy = *this; copy = *this;
@ -312,6 +314,7 @@ int Matrix4::Invert(Matrix4& p_mat)
} }
if (copy[i][i] < 0.001f && copy[i][i] > -0.001f) { if (copy[i][i] < 0.001f && copy[i][i] > -0.001f) {
// FAILURE from mxtypes.h
return -1; return -1;
} }
@ -349,14 +352,19 @@ int Matrix4::Invert(Matrix4& p_mat)
} }
} }
// SUCCESS from mxtypes.h
return 0; return 0;
} }
// FUNCTION: LEGO1 0x1006b500 // FUNCTION: LEGO1 0x1006b500
// FUNCTION: BETA10 0x1005aa20
void Matrix4::Swap(int p_d1, int p_d2) void Matrix4::Swap(int p_d1, int p_d2)
{ {
for (int i = 0; i < 4; i++) { // This function is affected by entropy even in debug builds
float e = m_data[p_d1][i]; int i;
float e;
for (i = 0; i < 4; i++) {
e = m_data[p_d1][i];
m_data[p_d1][i] = m_data[p_d2][i]; m_data[p_d1][i] = m_data[p_d2][i];
m_data[p_d2][i] = e; m_data[p_d2][i] = e;
} }