mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 08:54:15 +00:00
Implement/match LegoCharacterManager::FUN_10083f10 (#774)
* Implement LegoCharacterManager::FUN_10083f10 * style * Match * Fix naming
This commit is contained in:
committed by
GitHub
parent
75dc04f40a
commit
3bafe2d3a4
@@ -22,7 +22,7 @@ LegoUnknown100d5778::~LegoUnknown100d5778()
|
||||
void LegoUnknown100d5778::Init()
|
||||
{
|
||||
m_dsBuffer = NULL;
|
||||
m_unk0xc = NULL;
|
||||
m_unk0x0c = NULL;
|
||||
m_unk0x10 = 0;
|
||||
m_unk0x18 = 0;
|
||||
m_unk0x14 = FALSE;
|
||||
@@ -57,12 +57,12 @@ void LegoUnknown100d5778::Destroy()
|
||||
m_dsBuffer = NULL;
|
||||
}
|
||||
|
||||
if (m_unk0x14 && m_unk0xc && CharacterManager()) {
|
||||
if (m_unk0x14 && m_unk0x0c && CharacterManager()) {
|
||||
if (m_unk0x15) {
|
||||
CharacterManager()->FUN_10083db0(m_unk0xc);
|
||||
CharacterManager()->FUN_10083db0(m_unk0x0c);
|
||||
}
|
||||
else {
|
||||
CharacterManager()->FUN_10083f10(m_unk0xc);
|
||||
CharacterManager()->FUN_10083f10(m_unk0x0c);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -242,10 +242,45 @@ void LegoCharacterManager::FUN_10083db0(LegoROI* p_roi)
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10083f10
|
||||
// FUNCTION: LEGO1 0x10083f10
|
||||
void LegoCharacterManager::FUN_10083f10(LegoROI* p_roi)
|
||||
{
|
||||
// TODO
|
||||
LegoCharacter* character = NULL;
|
||||
LegoCharacterMap::iterator it;
|
||||
|
||||
for (it = m_characters->begin(); it != m_characters->end(); it++) {
|
||||
character = (*it).second;
|
||||
|
||||
if (character->m_roi == p_roi) {
|
||||
if (character->RemoveRef() == 0) {
|
||||
LegoEntity* entity = character->m_roi->GetEntity();
|
||||
|
||||
if (entity != NULL) {
|
||||
entity->SetROI(NULL, FALSE, FALSE);
|
||||
}
|
||||
|
||||
RemoveROI(character->m_roi);
|
||||
|
||||
delete[] const_cast<char*>((*it).first);
|
||||
delete (*it).second;
|
||||
|
||||
m_characters->erase(it);
|
||||
|
||||
if (entity != NULL && entity->GetFlagsIsSet(LegoEntity::c_bit2)) {
|
||||
entity->ClearFlag(LegoEntity::c_bit2);
|
||||
delete entity;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10084010
|
||||
void LegoCharacterManager::RemoveROI(LegoROI* p_roi)
|
||||
{
|
||||
VideoManager()->Get3DManager()->Remove(*p_roi);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10084030
|
||||
|
||||
Reference in New Issue
Block a user