Implement/match LegoAnimationManager::FUN_100617c0 (#891)

This commit is contained in:
Christian Semmler 2024-05-09 10:30:34 -04:00 committed by GitHub
parent 55299229c2
commit 36d681fde4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 51 additions and 4 deletions

View file

@ -96,7 +96,6 @@ class LegoAnimationManager : public MxCore {
MxBool p_param9
);
void FUN_10061010(MxBool p_und);
void FUN_100617c0(MxS32, MxU16&, MxU16&);
LegoTranInfo* GetTranInfo(MxU32 p_index);
void FUN_10062770();
void FUN_100627d0(MxBool);
@ -127,6 +126,7 @@ class LegoAnimationManager : public MxCore {
MxResult FUN_100609f0(MxU32 p_objectId, MxMatrix* p_matrix, MxBool p_und1, MxBool p_und2);
void DeleteAnimations();
void FUN_10061530();
MxResult FUN_100617c0(MxS32 p_unk0x08, MxU16& p_unk0x0e, MxU16& p_unk0x10);
MxU16 FUN_10062110(
LegoROI* p_roi,
Vector3& p_direction,

View file

@ -1021,10 +1021,57 @@ void LegoAnimationManager::FUN_10061530()
}
}
// STUB: LEGO1 0x100617c0
void LegoAnimationManager::FUN_100617c0(MxS32, MxU16&, MxU16&)
// FUNCTION: LEGO1 0x100617c0
// FUNCTION: BETA10 0x1004240b
MxResult LegoAnimationManager::FUN_100617c0(MxS32 p_unk0x08, MxU16& p_unk0x0e, MxU16& p_unk0x10)
{
// TODO
MxResult result = FAILURE;
MxU16 unk0x0e = 0;
MxU16 unk0x10 = 0;
MxBool success = FALSE;
if (p_unk0x08 == -1) {
MxS32 i;
for (i = 0; i < m_animCount; i++) {
if (m_anims[i].m_unk0x08 == p_unk0x08) {
unk0x0e = i;
success = TRUE;
break;
}
}
if (success) {
for (; i < m_animCount && m_anims[i].m_unk0x08 == p_unk0x08; i++) {
unk0x10 = i;
}
}
}
else {
MxS32 i;
for (i = 0; m_animCount > i && m_anims[i].m_unk0x08 != -1; i++) {
if (m_anims[i].m_unk0x08 == p_unk0x08) {
unk0x0e = i;
success = TRUE;
break;
}
}
if (success) {
for (; i < m_animCount && m_anims[i].m_unk0x08 == p_unk0x08; i++) {
unk0x10 = i;
}
}
}
if (success) {
p_unk0x0e = unk0x0e;
p_unk0x10 = unk0x10;
result = SUCCESS;
}
return result;
}
// FUNCTION: LEGO1 0x100618f0