Minor fixes

This commit is contained in:
Christian Semmler 2024-02-04 12:44:51 -05:00
parent 434deecee4
commit b4c9d78eb4
No known key found for this signature in database
GPG key ID: 086DAA1360BEEE5C
3 changed files with 17 additions and 15 deletions

View file

@ -7,9 +7,11 @@ MxResult Lego3DWavePresenter::AddToManager()
{ {
MxResult result = MxWavePresenter::AddToManager(); MxResult result = MxWavePresenter::AddToManager();
MxWavePresenter::Init(); MxWavePresenter::Init();
if (MxOmni::IsSound3D()) { if (MxOmni::IsSound3D()) {
m_is3d = TRUE; m_is3d = TRUE;
} }
return result; return result;
} }
@ -30,6 +32,7 @@ void Lego3DWavePresenter::StartingTickle()
if (MxOmni::IsSound3D()) { if (MxOmni::IsSound3D()) {
m_is3d = TRUE; m_is3d = TRUE;
} }
MxWavePresenter::StartingTickle(); MxWavePresenter::StartingTickle();
// TODO // TODO

View file

@ -17,7 +17,7 @@ LegoSoundManager::~LegoSoundManager()
// FUNCTION: LEGO1 0x100299a0 // FUNCTION: LEGO1 0x100299a0
void LegoSoundManager::Init() void LegoSoundManager::Init()
{ {
m_unk0x40 = 0; m_unk0x40 = NULL;
m_listener = NULL; m_listener = NULL;
} }
@ -43,7 +43,7 @@ MxResult LegoSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread)
locked = TRUE; locked = TRUE;
if (MxOmni::IsSound3D()) { if (MxOmni::IsSound3D()) {
if (m_dsBuffer->QueryInterface(IID_IDirectSound3DListener, (LPVOID*) &m_listener) != S_OK) { if (m_dsBuffer->QueryInterface(IID_IDirectSound3DListener, (LPVOID*) &m_listener) != DS_OK) {
goto done; goto done;
} }
@ -87,7 +87,7 @@ void LegoSoundManager::Destroy()
// FUNCTION: LEGO1 0x1002a3a0 // FUNCTION: LEGO1 0x1002a3a0
MxResult LegoSoundManager::Tickle() MxResult LegoSoundManager::Tickle()
{ {
MxMediaManager::Tickle(); MxSoundManager::Tickle();
MxAutoLocker lock(&m_criticalSection); MxAutoLocker lock(&m_criticalSection);
return m_unk0x40->Tickle(); return m_unk0x40->Tickle();

View file

@ -7,6 +7,7 @@
#include "mxpresenter.h" #include "mxpresenter.h"
#include "mxstreamer.h" #include "mxstreamer.h"
#include "mxticklemanager.h" #include "mxticklemanager.h"
#include "mxutil.h"
DECOMP_SIZE_ASSERT(MxBackgroundAudioManager, 0x150) DECOMP_SIZE_ASSERT(MxBackgroundAudioManager, 0x150)
@ -161,26 +162,24 @@ void MxBackgroundAudioManager::FUN_1007ef40()
// FUNCTION: LEGO1 0x1007f0e0 // FUNCTION: LEGO1 0x1007f0e0
void MxBackgroundAudioManager::FadeInOrFadeOut() void MxBackgroundAudioManager::FadeInOrFadeOut()
{ {
// This function probably is the fade in/out routine MxS32 volume, compare;
if (m_unk0xa0 != NULL) { if (m_unk0xa0 != NULL) {
undefined4 volume = m_unk0xa0->GetVolume(); volume = m_unk0xa0->GetVolume();
MxU32 compare = 30;
if (m_unk0x148 == 0) { if (m_unk0x148 != 0) {
compare = 30;
}
else {
compare = m_targetVolume; compare = m_targetVolume;
} }
if (volume < compare) { if (volume < compare) {
volume = m_unk0x140 + volume; volume = Min(volume + m_unk0x140, compare);
if (compare <= volume) {
volume = compare;
}
m_unk0xa0->SetVolume(volume); m_unk0xa0->SetVolume(volume);
} }
else if (compare < volume) { else if (compare < volume) {
volume = volume - m_unk0x140; volume = Max(volume - m_unk0x140, compare);
if (volume <= compare) {
volume = compare;
}
m_unk0xa0->SetVolume(volume); m_unk0xa0->SetVolume(volume);
} }
else { else {