Implement/match LegoAnimationManager::GetCharacterIndex (#861)

This commit is contained in:
Christian Semmler 2024-04-27 09:59:00 -04:00 committed by GitHub
parent c7e5457f95
commit f6ffeabed7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 7 deletions

View file

@ -91,7 +91,6 @@ class LegoAnimationManager : public MxCore {
void FUN_10061010(undefined4);
void FUN_100617c0(MxS32, MxU16&, MxU16&);
LegoTranInfo* GetTranInfo(MxU32 p_index);
MxS8 FUN_10062360(char*);
void FUN_10062770();
void FUN_100627d0(MxBool);
void FUN_100629b0(MxU32, MxBool);
@ -120,6 +119,7 @@ class LegoAnimationManager : public MxCore {
);
MxResult FUN_100609f0(MxU32 p_objectId, MxMatrix* p_matrix, MxBool p_und1, MxBool p_und2);
void DeleteAnimations();
MxS8 GetCharacterIndex(const char* p_name);
void FUN_10063aa0();
MxU32 m_scriptIndex; // 0x08

View file

@ -339,7 +339,7 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
goto done;
}
m_anims[j].m_unk0x28 = FUN_10062360(m_anims[j].m_animName + strlen(m_anims[j].m_animName) - 2);
m_anims[j].m_unk0x28 = GetCharacterIndex(m_anims[j].m_animName + strlen(m_anims[j].m_animName) - 2);
m_anims[j].m_unk0x29 = 0;
for (k = 0; k < 3; k++) {
@ -348,7 +348,7 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
if (m_anims[j].m_unk0x08 == -1) {
for (MxS32 l = 0; l < m_anims[j].m_modelCount; l++) {
MxS32 index = FUN_10062360(m_anims[j].m_models[l].m_modelName);
MxS32 index = GetCharacterIndex(m_anims[j].m_models[l].m_modelName);
if (index >= 0) {
g_characters[index].m_active = TRUE;
@ -748,11 +748,19 @@ MxResult LegoAnimationManager::Tickle()
return SUCCESS;
}
// STUB: LEGO1 0x10062360
MxS8 LegoAnimationManager::FUN_10062360(char*)
// FUNCTION: LEGO1 0x10062360
// FUNCTION: BETA10 0x100432dd
MxS8 LegoAnimationManager::GetCharacterIndex(const char* p_name)
{
// TODO
return 0;
MxS8 i;
for (i = 0; i < _countof(g_characters); i++) {
if (!strnicmp(p_name, g_characters[i].m_name, 2)) {
return i;
}
}
return -1;
}
// FUNCTION: LEGO1 0x10062770