MxSoundPresenter (#227)

* MxSoundPresenter

Destructor, destroy, function adding itself to the sound manager and vtable38.

* Fix virtual function declarations

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Joshua Peisach
2023-10-21 18:41:05 -04:00
committed by GitHub
parent 85d94baa50
commit af0e38176c
3 changed files with 53 additions and 2 deletions

View File

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