MxSoundManager: dtor, destroy, update types

Also make MxThread's destructor public
This commit is contained in:
Joshua Peisach 2023-10-04 19:21:02 -04:00
parent 6916aa49e3
commit 8b3a1e50ed
No known key found for this signature in database
GPG Key ID: 41C3D4189AFEDB5A
4 changed files with 39 additions and 5 deletions

View File

@ -7,6 +7,8 @@
#include "mxpresenterlist.h" #include "mxpresenterlist.h"
#include "mxtypes.h" #include "mxtypes.h"
#include <dsound.h>
// VTABLE 0x100dc6b0 // VTABLE 0x100dc6b0
// SIZE 0x2c // SIZE 0x2c
class MxMediaManager : public MxCore class MxMediaManager : public MxCore

View File

@ -1,21 +1,48 @@
#include "mxsoundmanager.h" #include "mxsoundmanager.h"
#include "mxomni.h"
DECOMP_SIZE_ASSERT(MxSoundManager, 0x3c);
// OFFSET: LEGO1 0x100ae740 // OFFSET: LEGO1 0x100ae740
MxSoundManager::MxSoundManager() MxSoundManager::MxSoundManager()
{ {
Init(); Init();
} }
// OFFSET: LEGO1 0x100ae7d0 STUB // OFFSET: LEGO1 0x100ae7d0
MxSoundManager::~MxSoundManager() MxSoundManager::~MxSoundManager()
{ {
// TODO Destroy(TRUE);
} }
// OFFSET: LEGO1 0x100ae830 // OFFSET: LEGO1 0x100ae830
void MxSoundManager::Init() void MxSoundManager::Init()
{ {
m_unk30 = 0; m_unk30 = 0;
m_unk34 = 0; m_dsBuffer = NULL;
} }
// OFFSET: LEGO1 0x100ae840
void MxSoundManager::Destroy(MxBool p_param)
{
if(this->m_thread) {
this->m_thread->Terminate();
delete this->m_thread;
} else {
TickleManager()->UnregisterClient(this);
}
this->m_criticalSection.Enter();
if(this->m_dsBuffer) {
this->m_dsBuffer->Release();
}
Init();
this->m_criticalSection.Leave();
if(!p_param) {
MxAudioManager::Destroy();
}
}

View File

@ -1,6 +1,7 @@
#ifndef MXSOUNDMANAGER_H #ifndef MXSOUNDMANAGER_H
#define MXSOUNDMANAGER_H #define MXSOUNDMANAGER_H
#include "decomp.h"
#include "mxaudiomanager.h" #include "mxaudiomanager.h"
// VTABLE 0x100dc128 // VTABLE 0x100dc128
@ -14,8 +15,10 @@ class MxSoundManager : public MxAudioManager
private: private:
void Init(); void Init();
int m_unk30; void Destroy(MxBool);
int m_unk34; undefined4 m_unk30;
LPDIRECTSOUNDBUFFER m_dsBuffer; // 0x34
undefined m_unk35[4];
}; };
#endif // MXSOUNDMANAGER_H #endif // MXSOUNDMANAGER_H

View File

@ -24,6 +24,8 @@ class MxThread
protected: protected:
MxThread(); MxThread();
public:
virtual ~MxThread(); virtual ~MxThread();
private: private: