isle/LEGO1/mxmusicpresenter.cpp

60 lines
951 B
C++
Raw Normal View History

#include "mxmusicpresenter.h"
#include "decomp.h"
#include "mxmusicmanager.h"
#include "mxomni.h"
DECOMP_SIZE_ASSERT(MxMusicPresenter, 0x54);
// OFFSET: LEGO1 0x100c22c0
MxMusicPresenter::MxMusicPresenter()
{
2023-10-24 19:38:27 -04:00
Init();
}
// OFFSET: LEGO1 0x100c24e0
MxMusicPresenter::~MxMusicPresenter()
{
2023-10-24 19:38:27 -04:00
Destroy(TRUE);
}
// OFFSET: LEGO1 0x100c2540
void MxMusicPresenter::Init()
{
}
// OFFSET: LEGO1 0x100c2550
void MxMusicPresenter::Destroy(MxBool p_fromDestructor)
{
2023-10-24 19:38:27 -04:00
if (MusicManager()) {
MusicManager()->RemovePresenter(*this);
}
2023-11-24 12:21:26 -05:00
2023-10-24 19:38:27 -04:00
m_criticalSection.Enter();
Init();
m_criticalSection.Leave();
2023-11-24 12:21:26 -05:00
2023-10-24 19:38:27 -04:00
if (!p_fromDestructor) {
MxMediaPresenter::Destroy(FALSE);
}
}
// OFFSET: LEGO1 0x100c25a0
MxResult MxMusicPresenter::AddToManager()
{
2023-10-24 19:38:27 -04:00
MxResult result = FAILURE;
2023-11-24 12:21:26 -05:00
2023-10-24 19:38:27 -04:00
if (MusicManager()) {
result = SUCCESS;
MusicManager()->AddPresenter(*this);
}
2023-11-24 12:21:26 -05:00
2023-10-24 19:38:27 -04:00
return result;
}
// OFFSET: LEGO1 0x100c25d0
void MxMusicPresenter::Destroy()
{
2023-10-24 19:38:27 -04:00
Destroy(FALSE);
}