Implement/match LegoAnimPresenter::Destroy (#849)

* WIP Destroy

* Match
This commit is contained in:
Christian Semmler
2024-04-25 10:24:06 -04:00
committed by GitHub
parent 916c039e72
commit 830c0827af
2 changed files with 73 additions and 5 deletions

View File

@@ -8,6 +8,7 @@
#include "legovideomanager.h"
#include "legoworld.h"
#include "misc.h"
#include "mxautolock.h"
#include "mxcompositepresenter.h"
#include "mxdsanim.h"
#include "mxmisc.h"
@@ -55,14 +56,74 @@ void LegoAnimPresenter::Init()
m_unk0x90 = NULL;
m_unk0x94 = 0;
m_unk0x96 = TRUE;
m_unk0xa0 = 0;
m_unk0xa0 = NULL;
}
// STUB: LEGO1 0x10068770
// FUNCTION: LEGO1 0x10068770
// FUNCTION: BETA10 0x1004e833
void LegoAnimPresenter::Destroy(MxBool p_fromDestructor)
{
// TODO
MxVideoPresenter::Destroy(p_fromDestructor);
{
AUTOLOCK(m_criticalSection);
if (m_anim != NULL) {
delete m_anim;
}
if (m_roiMap != NULL) {
delete[] m_roiMap;
}
if (m_unk0x70 != NULL) {
delete m_unk0x70;
}
if (m_unk0x74 != NULL) {
FUN_1006aa60();
delete m_unk0x74;
}
if (m_unk0x78 != NULL) {
delete m_unk0x78;
}
if (m_substMap != NULL) {
MxVariableTable* variableTable = VariableTable();
for (LegoAnimSubstMap::iterator it = m_substMap->begin(); it != m_substMap->end(); it++) {
variableTable->SetVariable((*it).first, "");
delete[] const_cast<char*>((*it).first);
delete[] const_cast<char*>((*it).second);
}
delete m_substMap;
}
if (m_unk0x90 != NULL) {
for (MxS32 i = 0; i < m_unk0x94; i++) {
if (m_unk0x90[i] != NULL) {
delete[] m_unk0x90[i];
}
}
delete[] m_unk0x90;
}
if (m_unk0x8c != NULL) {
delete[] m_unk0x8c;
}
if (m_unk0xa0 != NULL) {
delete m_unk0xa0; // TODO
}
Init();
}
if (!p_fromDestructor) {
MxVideoPresenter::Destroy(FALSE);
}
}
// FUNCTION: LEGO1 0x10068fb0
@@ -453,6 +514,12 @@ void LegoAnimPresenter::FUN_1006a4f0(
}
}
// STUB: LEGO1 0x1006aa60
void LegoAnimPresenter::FUN_1006aa60()
{
// TODO
}
// FUNCTION: LEGO1 0x1006ab70
void LegoAnimPresenter::FUN_1006ab70()
{