implement/match LegoAnimationManager::DeleteAnimations() (#753)

This commit is contained in:
Ramen2X 2024-03-29 14:09:46 -04:00 committed by GitHub
parent ed1a25a636
commit 2c57e33ce5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 6 deletions

View file

@ -70,7 +70,7 @@ class LegoAnimationManager : public MxCore {
MxBool FindVehicle(const char* p_name, MxU32& p_index); MxBool FindVehicle(const char* p_name, MxU32& p_index);
MxResult ReadAnimInfo(LegoFile* p_file, AnimInfo* p_info); MxResult ReadAnimInfo(LegoFile* p_file, AnimInfo* p_info);
MxResult ReadModelInfo(LegoFile* p_file, ModelInfo* p_info); MxResult ReadModelInfo(LegoFile* p_file, ModelInfo* p_info);
void FUN_100603c0(); void DeleteAnimations();
MxResult StartEntityAction(MxDSAction& p_dsAction, LegoEntity* p_entity); MxResult StartEntityAction(MxDSAction& p_dsAction, LegoEntity* p_entity);
void FUN_10060570(MxBool); void FUN_10060570(MxBool);
undefined4 FUN_10060dc0( undefined4 FUN_10060dc0(

View file

@ -173,7 +173,7 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
m_animState->FUN_10065240(m_animCount, m_anims, m_unk0x3fc); m_animState->FUN_10065240(m_animCount, m_anims, m_unk0x3fc);
} }
FUN_100603c0(); DeleteAnimations();
LegoFile file; LegoFile file;
@ -288,7 +288,7 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
done: done:
if (result == FAILURE) { if (result == FAILURE) {
FUN_100603c0(); DeleteAnimations();
} }
return result; return result;
@ -408,10 +408,29 @@ MxResult LegoAnimationManager::ReadModelInfo(LegoFile* p_file, ModelInfo* p_info
return result; return result;
} }
// STUB: LEGO1 0x100603c0 // FUNCTION: LEGO1 0x100603c0
void LegoAnimationManager::FUN_100603c0() void LegoAnimationManager::DeleteAnimations()
{ {
// TODO undefined unk0x42b = m_unk0x42b;
if (m_anims != NULL) {
for (MxS32 i = 0; i < m_animCount; i++) {
delete m_anims[i].m_animName;
if (m_anims[i].m_models != NULL) {
for (MxS32 j = 0; j < m_anims[i].m_modelCount; j++) {
delete m_anims[i].m_models[j].m_modelName;
}
delete m_anims[i].m_models;
}
}
delete m_anims;
}
Init();
m_unk0x42b = unk0x42b;
} }
// STUB: LEGO1 0x10060570 // STUB: LEGO1 0x10060570