Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions src/OpenSHC/Audio/SFX/SFXState/playAmbientSoundStream2Unk.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include "../SFXState.func.hpp"

#include "OpenSHC/Audio/mss/SoundSystem.func.hpp"

#include "OpenSHC/Globals/DAT_SoundSystemState.hpp"
#include "OpenSHC/Globals/DAT_SpeechDefinedData.hpp"

namespace OpenSHC {
namespace Audio {
namespace SFX {

// FUNCTION: STRONGHOLDCRUSADER 0x0044A1B0
void SFXState::playAmbientSoundStream2Unk(int ambientSoundIndexUnk)
{
if (MACRO_CALL_MEMBER(MSS::SoundSystem_Func::isSampleOrStreamPlaying, DAT_SoundSystemState::ptr)(
MSS::enums::SND_STR_SFX_2Unk)) {
return;
}
DAT_SoundSystemState::instance.streamFileVolumeNextUnk_0x48[2]
= DAT_SpeechDefinedData::instance.field5_0x41eb04[ambientSoundIndexUnk].volumeUnk_0x28
[DAT_SpeechDefinedData::instance.field5_0x41eb04[ambientSoundIndexUnk].field3_0x44];
if (ambientSoundIndexUnk == 5) {
MACRO_CALL_MEMBER(MSS::SoundSystem_Func::playSoundOnSfxSoundStream2, DAT_SoundSystemState::ptr)(
DAT_SpeechDefinedData::instance.field5_0x41eb04[ambientSoundIndexUnk].ambientWavs_0x8
[DAT_SpeechDefinedData::instance.field5_0x41eb04[ambientSoundIndexUnk].field3_0x44],
50);
} else {
MACRO_CALL_MEMBER(MSS::SoundSystem_Func::playSoundOnSoundStream2, DAT_SoundSystemState::ptr)(
DAT_SpeechDefinedData::instance.field5_0x41eb04[ambientSoundIndexUnk].ambientWavs_0x8
[DAT_SpeechDefinedData::instance.field5_0x41eb04[ambientSoundIndexUnk].field3_0x44]);
}
DAT_SpeechDefinedData::instance.field5_0x41eb04[ambientSoundIndexUnk].field3_0x44++;
if (DAT_SpeechDefinedData::instance.field5_0x41eb04[ambientSoundIndexUnk].field3_0x44
>= DAT_SpeechDefinedData::instance.field5_0x41eb04[ambientSoundIndexUnk].field0_0x0) {
DAT_SpeechDefinedData::instance.field5_0x41eb04[ambientSoundIndexUnk].field3_0x44 = 0;
}
}

}
}
}
2 changes: 1 addition & 1 deletion status/addresses-SHC-3BB0A8C1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16271,7 +16271,7 @@ SHC_3BB0A8C1_0x0044A0D0 | 100.0% | Reimplemented

SHC_3BB0A8C1_0x0044A0F0 | 0.0% | Pending

SHC_3BB0A8C1_0x0044A1B0 | 0.0% | Pending
SHC_3BB0A8C1_0x0044A1B0 | 100.0% | Reimplemented

SHC_3BB0A8C1_0x0044A240 | 0.0% | Pending

Expand Down