Implement/match LegoCharacterData::GetData and FUN_10085140 (#755)

This commit is contained in:
Christian Semmler 2024-03-29 14:34:50 -04:00 committed by GitHub
parent dd4d7cca9c
commit 3878f79847
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 4 deletions

View file

@ -55,8 +55,9 @@ class LegoCharacterManager {
void FUN_10083f10(LegoROI* p_roi); void FUN_10083f10(LegoROI* p_roi);
LegoExtraActor* GetActor(const char* p_key); LegoExtraActor* GetActor(const char* p_key);
LegoCharacterData* GetData(const char* p_key); LegoCharacterData* GetData(const char* p_key);
LegoCharacterData* GetData(LegoROI* p_roi);
MxBool FUN_10084ec0(LegoROI* p_roi); MxBool FUN_10084ec0(LegoROI* p_roi);
MxU32 FUN_10085140(LegoROI*, MxBool); MxU32 FUN_10085140(LegoROI* p_roi, MxBool p_und);
LegoROI* FUN_10085210(const char*, char*, undefined); LegoROI* FUN_10085210(const char*, char*, undefined);
LegoROI* FUN_10085a80(char* p_und1, char* p_und2, undefined p_und3); LegoROI* FUN_10085a80(char* p_und1, char* p_und2, undefined p_und3);

View file

@ -17,6 +17,12 @@ DECOMP_SIZE_ASSERT(LegoCharacterManager, 0x08)
// GLOBAL: LEGO1 0x100fc4e4 // GLOBAL: LEGO1 0x100fc4e4
char* LegoCharacterManager::g_customizeAnimFile = NULL; char* LegoCharacterManager::g_customizeAnimFile = NULL;
// GLOBAL: LEGO1 0x100fc4d8
MxU32 g_unk0x100fc4d8 = 50;
// GLOBAL: LEGO1 0x100fc4dc
MxU32 g_unk0x100fc4dc = 66;
// GLOBAL: LEGO1 0x10104f20 // GLOBAL: LEGO1 0x10104f20
LegoCharacterData g_characterData[66]; LegoCharacterData g_characterData[66];
@ -425,6 +431,24 @@ LegoCharacterData* LegoCharacterManager::GetData(const char* p_key)
return NULL; return NULL;
} }
// FUNCTION: LEGO1 0x10084cb0
LegoCharacterData* LegoCharacterManager::GetData(LegoROI* p_roi)
{
MxU32 i;
for (i = 0; i < _countof(g_characterData); i++) {
if (g_characterData[i].m_roi == p_roi) {
break;
}
}
if (i < _countof(g_characterData)) {
return &g_characterData[i];
}
return NULL;
}
// STUB: LEGO1 0x10084ec0 // STUB: LEGO1 0x10084ec0
MxBool LegoCharacterManager::FUN_10084ec0(LegoROI* p_roi) MxBool LegoCharacterManager::FUN_10084ec0(LegoROI* p_roi)
{ {
@ -432,10 +456,19 @@ MxBool LegoCharacterManager::FUN_10084ec0(LegoROI* p_roi)
return FALSE; return FALSE;
} }
// STUB: LEGO1 0x10085140 // FUNCTION: LEGO1 0x10085140
MxU32 LegoCharacterManager::FUN_10085140(LegoROI*, MxBool) MxU32 LegoCharacterManager::FUN_10085140(LegoROI* p_roi, MxBool p_und)
{ {
// TODO LegoCharacterData* data = GetData(p_roi);
if (p_und) {
return data->m_unk0x14 + g_unk0x100fc4dc;
}
if (data != NULL) {
return data->m_unk0x0c + g_unk0x100fc4d8;
}
return 0; return 0;
} }