Implement/match LegoCharacterManager::GetRefCount (#749)

This commit is contained in:
Christian Semmler 2024-03-29 13:30:31 -04:00 committed by GitHub
parent 6fda6ca92b
commit e260a407ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 7 deletions

View file

@ -50,7 +50,7 @@ class LegoCharacterManager {
static MxBool FUN_10084c00(const LegoChar*); static MxBool FUN_10084c00(const LegoChar*);
void FUN_100832a0(); void FUN_100832a0();
undefined4 FUN_10083bc0(LegoROI* p_roi); MxU32 GetRefCount(LegoROI* p_roi);
void FUN_10083db0(LegoROI* p_roi); void FUN_10083db0(LegoROI* p_roi);
void FUN_10083f10(LegoROI* p_roi); void FUN_10083f10(LegoROI* p_roi);
LegoExtraActor* FUN_10084c40(const LegoChar*); LegoExtraActor* FUN_10084c40(const LegoChar*);

View file

@ -49,11 +49,11 @@ void LegoCharacterManager::FUN_100832a0()
if (actor != NULL && actor->IsA("LegoExtraActor")) { if (actor != NULL && actor->IsA("LegoExtraActor")) {
LegoROI* roi = g_characterData[i].m_roi; LegoROI* roi = g_characterData[i].m_roi;
undefined4 und = FUN_10083bc0(roi); MxU32 refCount = GetRefCount(roi);
while (und) { while (refCount != 0) {
FUN_10083db0(roi); FUN_10083db0(roi);
und = FUN_10083bc0(roi); refCount = GetRefCount(roi);
} }
} }
} }
@ -205,10 +205,20 @@ LegoROI* LegoCharacterManager::GetROI(const char* p_key, MxBool p_createEntity)
return NULL; return NULL;
} }
// STUB: LEGO1 0x10083bc0 // FUNCTION: LEGO1 0x10083bc0
undefined4 LegoCharacterManager::FUN_10083bc0(LegoROI* p_roi) MxU32 LegoCharacterManager::GetRefCount(LegoROI* p_roi)
{ {
// TODO LegoCharacterMap::iterator it;
for (it = m_characters->begin(); it != m_characters->end(); it++) {
LegoCharacter* character = (*it).second;
LegoROI* roi = character->m_roi;
if (roi == p_roi) {
return character->m_refCount;
}
}
return 0; return 0;
} }