Implement/match remaining MxSoundManager virtual functions (#250)

This commit is contained in:
Christian Semmler 2023-10-26 07:20:14 -04:00 committed by GitHub
parent 89b3c5f8ae
commit 6594cc78ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 6 deletions

View file

@ -1,7 +1,10 @@
#include "mxsoundmanager.h"
#include "mxautolocker.h"
#include "mxomni.h"
#include "mxpresenter.h"
#include "mxticklemanager.h"
#include "mxwavepresenter.h"
DECOMP_SIZE_ASSERT(MxSoundManager, 0x3c);
@ -124,16 +127,30 @@ MxResult MxSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread)
return status;
}
// OFFSET: LEGO1 0x100aed10 STUB
// OFFSET: LEGO1 0x100aed10
void MxSoundManager::vtable0x34()
{
// TODO
MxAutoLocker lock(&m_criticalSection);
MxPresenter* presenter;
MxPresenterListCursor cursor(m_presenters);
while (cursor.Next(presenter))
if (presenter->IsA("MxWavePresenter"))
((MxWavePresenter*) presenter)->VTable0x64();
}
// OFFSET: LEGO1 0x100aee10 STUB
// OFFSET: LEGO1 0x100aee10
void MxSoundManager::vtable0x38()
{
// TODO
MxAutoLocker lock(&m_criticalSection);
MxPresenter* presenter;
MxPresenterListCursor cursor(m_presenters);
while (cursor.Next(presenter))
if (presenter->IsA("MxWavePresenter"))
((MxWavePresenter*) presenter)->VTable0x68();
}
// OFFSET: LEGO1 0x100aeab0
@ -142,8 +159,18 @@ void MxSoundManager::Destroy()
Destroy(FALSE);
}
// OFFSET: LEGO1 0x100aeac0 STUB
// OFFSET: LEGO1 0x100aeac0
void MxSoundManager::SetVolume(MxS32 p_volume)
{
// TODO
MxAudioManager::SetVolume(p_volume);
m_criticalSection.Enter();
MxPresenter* presenter;
MxPresenterListCursor cursor(m_presenters);
while (cursor.Next(presenter))
((MxAudioPresenter*) presenter)->vtable60(((MxAudioPresenter*) presenter)->vtable5c());
m_criticalSection.Leave();
}

View file

@ -16,3 +16,21 @@ void MxWavePresenter::Init()
m_unk66 = 0;
m_unk68 = 0;
}
// OFFSET: LEGO1 0x100b2440 STUB
void MxWavePresenter::VTable0x64()
{
// TODO
}
// OFFSET: LEGO1 0x100b2470 STUB
void MxWavePresenter::VTable0x68()
{
// TODO
}
// OFFSET: LEGO1 0x1000d6b0
undefined MxWavePresenter::VTable0x6c()
{
return m_unk68;
}

View file

@ -26,6 +26,11 @@ class MxWavePresenter : public MxSoundPresenter {
return !strcmp(name, MxWavePresenter::ClassName()) || MxSoundPresenter::IsA(name);
}
virtual void VTable0x64(); // vtable+0x64
virtual void VTable0x68(); // vtable+0x68
virtual undefined VTable0x6c(); // vtable+0x6c
private:
undefined4 m_unk54;
undefined4 m_unk58;
undefined4 m_unk5c;