diff --git a/LEGO1/lego/legoomni/include/legohideanimpresenter.h b/LEGO1/lego/legoomni/include/legohideanimpresenter.h index fda96c98..59449283 100644 --- a/LEGO1/lego/legoomni/include/legohideanimpresenter.h +++ b/LEGO1/lego/legoomni/include/legohideanimpresenter.h @@ -1,6 +1,7 @@ #ifndef LEGOHIDEANIMPRESENTER_H #define LEGOHIDEANIMPRESENTER_H +#include "decomp.h" #include "legoloopinganimpresenter.h" // VTABLE: LEGO1 0x100d9278 @@ -23,8 +24,13 @@ class LegoHideAnimPresenter : public LegoLoopingAnimPresenter { return !strcmp(p_name, ClassName()) || LegoAnimPresenter::IsA(p_name); } + virtual void Destroy() override; // vtable+0x38 + private: void Init(); + void Destroy(MxBool p_fromDestructor); + + undefined4* m_unk0xc0; // 0xc0 }; // SYNTHETIC: LEGO1 0x1006d9d0 diff --git a/LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp index 9aa9f2fe..00718629 100644 --- a/LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legohideanimpresenter.cpp @@ -1,18 +1,43 @@ #include "legohideanimpresenter.h" +DECOMP_SIZE_ASSERT(LegoHideAnimPresenter, 0xc4) + // FUNCTION: LEGO1 0x1006d7e0 LegoHideAnimPresenter::LegoHideAnimPresenter() { Init(); } -// STUB: LEGO1 0x1006d9f0 +// FUNCTION: LEGO1 0x1006d9f0 LegoHideAnimPresenter::~LegoHideAnimPresenter() { - // TODO + Destroy(TRUE); } -// STUB: LEGO1 0x1006da50 +// FUNCTION: LEGO1 0x1006da50 void LegoHideAnimPresenter::Init() { + m_unk0xc0 = NULL; +} + +// FUNCTION: LEGO1 0x1006da60 +void LegoHideAnimPresenter::Destroy(MxBool p_fromDestructor) +{ + m_criticalSection.Enter(); + + if (m_unk0xc0) + delete m_unk0xc0; + Init(); + + m_criticalSection.Leave(); + + // This appears to be a bug, since it results in an endless loop + if (!p_fromDestructor) + LegoHideAnimPresenter::Destroy(); +} + +// FUNCTION: LEGO1 0x1006dac0 +void LegoHideAnimPresenter::Destroy() +{ + Destroy(FALSE); }