2023-06-29 04:10:08 -04:00
|
|
|
#include "mxsoundpresenter.h"
|
2023-10-21 18:41:05 -04:00
|
|
|
|
|
|
|
#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);
|
2023-10-21 18:41:05 -04:00
|
|
|
}
|
|
|
|
|
2023-11-14 15:10:43 -05:00
|
|
|
// OFFSET: LEGO1 0x1000d490
|
|
|
|
void MxSoundPresenter::Destroy()
|
|
|
|
{
|
|
|
|
Destroy(FALSE);
|
|
|
|
}
|
|
|
|
|
2023-10-21 18:41:05 -04:00
|
|
|
// OFFSET: LEGO1 0x100b1a50
|
|
|
|
void MxSoundPresenter::Destroy(MxBool p_fromDestructor)
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
if (MSoundManager())
|
|
|
|
MSoundManager()->RemovePresenter(*this);
|
2023-10-21 18:41:05 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
this->m_criticalSection.Enter();
|
|
|
|
MxMediaPresenter::Init();
|
|
|
|
this->m_criticalSection.Leave();
|
2023-10-21 18:41:05 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (!p_fromDestructor)
|
|
|
|
MxMediaPresenter::Destroy(FALSE);
|
2023-10-21 18:41:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b1aa0
|
|
|
|
MxResult MxSoundPresenter::AddToManager()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
MxResult ret = FAILURE;
|
2023-10-21 18:41:05 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (MSoundManager()) {
|
|
|
|
ret = SUCCESS;
|
|
|
|
MSoundManager()->AddPresenter(*this);
|
|
|
|
}
|
2023-10-21 18:41:05 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
return ret;
|
2023-10-21 18:41:05 -04:00
|
|
|
}
|