isle-portable/LEGO1/mxeventpresenter.cpp
Joshua Peisach 4f201eaa48
MxEventPresenter destructor (#223)
* MxEventPresenter destructor

* Fix and implement Destroy

* Fix scope of Destroy decl

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-10-20 20:41:23 +02:00

42 lines
676 B
C++

#include "mxeventpresenter.h"
#include "mxeventmanager.h"
#include "mxomni.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(MxEventPresenter, 0x54);
// OFFSET: LEGO1 0x100c2b70
MxEventPresenter::MxEventPresenter()
{
Init();
}
// OFFSET: LEGO1 0x100c2d40
MxEventPresenter::~MxEventPresenter()
{
Destroy();
}
// OFFSET: LEGO1 0x100c2da0
void MxEventPresenter::Init()
{
m_unk50 = NULL;
}
// OFFSET: LEGO1 0x100c2de0
void MxEventPresenter::Destroy()
{
MxEventManager *eventManager = EventManager();
if (eventManager)
EventManager()->RemovePresenter(*this);
m_criticalSection.Enter();
if (m_unk50)
delete m_unk50;
Init();
m_criticalSection.Leave();
}