Quick patch for EqualsDataProduct (#134)

This commit is contained in:
MS 2023-09-21 05:27:27 -04:00 committed by GitHub
parent 99c27a6a50
commit 611afb7799
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,21 +111,20 @@ void MxMatrix::EqualsMxProduct(const MxMatrix *p_a, const MxMatrix *p_b)
EqualsDataProduct(p_a->m_data, p_b->m_data); EqualsDataProduct(p_a->m_data, p_b->m_data);
} }
// Just a placeholder matrix multiply implementation. I think the decomp will // OFFSET: LEGO1 0x100024d0
// look roughly like this but it's not close to matching and won't be until
// an exact match is found given it's all loop and float crunching.
// OFFSET: LEGO1 0x100024d0 STUB
void MxMatrix::EqualsDataProduct(const float *p_a, const float *p_b) void MxMatrix::EqualsDataProduct(const float *p_a, const float *p_b)
{ {
float *cur = m_data;
for (int row = 0; row < 4; ++row) for (int row = 0; row < 4; ++row)
{ {
for (int col = 0; col < 4; ++col) for (int col = 0; col < 4; ++col)
{ {
m_data[row * 4 + col] = 0.0f; *cur = 0.0f;
for (int k = 0; k < 4; ++k) for (int k = 0; k < 4; ++k)
{ {
m_data[row * 4 + col] += p_a[row * 4 + k] * p_b[k * 4 + col]; *cur += p_a[row * 4 + k] * p_b[k * 4 + col];
} }
cur++;
} }
} }
} }