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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 73 additions and 5 deletions

View file

@ -97,6 +97,7 @@ class LegoAnimPresenter : public MxVideoPresenter {
void FUN_10069b10(); void FUN_10069b10();
void FUN_1006a3c0(LegoAnimPresenterMap& p_map, LegoTreeNode* p_node, LegoROI* p_roi); void FUN_1006a3c0(LegoAnimPresenterMap& p_map, LegoTreeNode* p_node, LegoROI* p_roi);
void FUN_1006a4f0(LegoAnimPresenterMap& p_map, LegoAnimNodeData* p_data, const LegoChar* p_und, LegoROI* p_roi); void FUN_1006a4f0(LegoAnimPresenterMap& p_map, LegoAnimNodeData* p_data, const LegoChar* p_und, LegoROI* p_roi);
void FUN_1006aa60();
void FUN_1006ab70(); void FUN_1006ab70();
LegoBool FUN_1006aba0(); LegoBool FUN_1006aba0();
MxBool FUN_1006abb0(LegoTreeNode* p_node, LegoROI* p_roi); MxBool FUN_1006abb0(LegoTreeNode* p_node, LegoROI* p_roi);
@ -123,7 +124,7 @@ class LegoAnimPresenter : public MxVideoPresenter {
undefined m_unk0x97; // 0x97 undefined m_unk0x97; // 0x97
LegoAnimSubstMap* m_substMap; // 0x98 LegoAnimSubstMap* m_substMap; // 0x98
MxS16 m_unk0x9c; // 0x9c MxS16 m_unk0x9c; // 0x9c
undefined4 m_unk0xa0; // 0xa0 undefined4* m_unk0xa0; // 0xa0
undefined4 m_unk0xa4; // 0xa4 undefined4 m_unk0xa4; // 0xa4
Mx3DPointFloat m_unk0xa8; // 0xa8 Mx3DPointFloat m_unk0xa8; // 0xa8
}; };

View file

@ -8,6 +8,7 @@
#include "legovideomanager.h" #include "legovideomanager.h"
#include "legoworld.h" #include "legoworld.h"
#include "misc.h" #include "misc.h"
#include "mxautolock.h"
#include "mxcompositepresenter.h" #include "mxcompositepresenter.h"
#include "mxdsanim.h" #include "mxdsanim.h"
#include "mxmisc.h" #include "mxmisc.h"
@ -55,14 +56,74 @@ void LegoAnimPresenter::Init()
m_unk0x90 = NULL; m_unk0x90 = NULL;
m_unk0x94 = 0; m_unk0x94 = 0;
m_unk0x96 = TRUE; m_unk0x96 = TRUE;
m_unk0xa0 = 0; m_unk0xa0 = NULL;
} }
// STUB: LEGO1 0x10068770 // FUNCTION: LEGO1 0x10068770
// FUNCTION: BETA10 0x1004e833
void LegoAnimPresenter::Destroy(MxBool p_fromDestructor) 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 // FUNCTION: LEGO1 0x10068fb0
@ -453,6 +514,12 @@ void LegoAnimPresenter::FUN_1006a4f0(
} }
} }
// STUB: LEGO1 0x1006aa60
void LegoAnimPresenter::FUN_1006aa60()
{
// TODO
}
// FUNCTION: LEGO1 0x1006ab70 // FUNCTION: LEGO1 0x1006ab70
void LegoAnimPresenter::FUN_1006ab70() void LegoAnimPresenter::FUN_1006ab70()
{ {