mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +00:00
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:
@@ -43,9 +43,8 @@ public:
|
|||||||
undefined4 m_unk44;
|
undefined4 m_unk44;
|
||||||
undefined4 m_unk48;
|
undefined4 m_unk48;
|
||||||
undefined4 m_unk4c;
|
undefined4 m_unk4c;
|
||||||
private:
|
|
||||||
void Init();
|
|
||||||
protected:
|
protected:
|
||||||
|
void Init();
|
||||||
void Destroy(MxBool p_fromDestructor);
|
void Destroy(MxBool p_fromDestructor);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1,45 @@
|
|||||||
#include "mxsoundpresenter.h"
|
#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);
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,11 +2,14 @@
|
|||||||
#define MXSOUNDPRESENTER_H
|
#define MXSOUNDPRESENTER_H
|
||||||
|
|
||||||
#include "mxaudiopresenter.h"
|
#include "mxaudiopresenter.h"
|
||||||
|
#include "mxomni.h"
|
||||||
|
|
||||||
// VTABLE 0x100d4b08
|
// VTABLE 0x100d4b08
|
||||||
class MxSoundPresenter : public MxAudioPresenter
|
class MxSoundPresenter : public MxAudioPresenter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~MxSoundPresenter() override;
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x1000d4a0
|
// OFFSET: LEGO1 0x1000d4a0
|
||||||
inline virtual const char *ClassName() const // vtable+0x0c
|
inline virtual const char *ClassName() const // vtable+0x0c
|
||||||
{
|
{
|
||||||
@@ -20,6 +23,11 @@ public:
|
|||||||
return !strcmp(name, MxSoundPresenter::ClassName()) || MxAudioPresenter::IsA(name);
|
return !strcmp(name, MxSoundPresenter::ClassName()) || MxAudioPresenter::IsA(name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual MxResult AddToManager() override; // vtable+0x34
|
||||||
|
virtual void Destroy() override; // vtable+0x38
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Destroy(MxBool);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MXSOUNDPRESENTER_H
|
#endif // MXSOUNDPRESENTER_H
|
||||||
|
|||||||
Reference in New Issue
Block a user