isle-portable/LEGO1/mxsoundpresenter.cpp

46 lines
803 B
C++
Raw Normal View History

#include "mxsoundpresenter.h"
#include "decomp.h"
#include "mxsoundmanager.h"
DECOMP_SIZE_ASSERT(MxSoundPresenter, 0x54)
// OFFSET: LEGO1 0x1000d430
MxSoundPresenter::~MxSoundPresenter()
{
2023-10-24 19:38:27 -04:00
Destroy(TRUE);
}
// OFFSET: LEGO1 0x1000d490
void MxSoundPresenter::Destroy()
{
Destroy(FALSE);
}
// OFFSET: LEGO1 0x100b1a50
void MxSoundPresenter::Destroy(MxBool p_fromDestructor)
{
2023-10-24 19:38:27 -04:00
if (MSoundManager())
MSoundManager()->RemovePresenter(*this);
2023-10-24 19:38:27 -04:00
this->m_criticalSection.Enter();
MxMediaPresenter::Init();
this->m_criticalSection.Leave();
2023-10-24 19:38:27 -04:00
if (!p_fromDestructor)
MxMediaPresenter::Destroy(FALSE);
}
// OFFSET: LEGO1 0x100b1aa0
MxResult MxSoundPresenter::AddToManager()
{
2023-10-24 19:38:27 -04:00
MxResult ret = FAILURE;
2023-10-24 19:38:27 -04:00
if (MSoundManager()) {
ret = SUCCESS;
MSoundManager()->AddPresenter(*this);
}
2023-10-24 19:38:27 -04:00
return ret;
}