Fixes Sound Slider Issue

Fixes #321
This commit is contained in:
westonCoder 2023-10-18 16:15:36 -05:00
parent 99a1303d87
commit d96c5ce81e
2 changed files with 4 additions and 4 deletions

View file

@ -269,7 +269,7 @@ float soundClipDuration(int soundClipId, float pitch) {
return soundPlayerEstimateLength(alSound, pitch);
}
void soundPlayerGameVolumeUpdate(enum SoundType type) {
void soundPlayerGameVolumeUpdate() {
int index = 0;
while (index < gActiveSoundCount) {
struct ActiveSound* sound = &gActiveSounds[index];
@ -279,7 +279,7 @@ void soundPlayerGameVolumeUpdate(enum SoundType type) {
}
float newVolume = sound->originalVolume * gSaveData.audio.soundVolume/0xFFFF;
if (type == SoundTypeMusic){
if (sound->soundType == SoundTypeMusic){
newVolume = newVolume* gSaveData.audio.musicVolume/0xFFFF;
}

View file

@ -141,11 +141,11 @@ enum MenuDirection audioOptionsUpdate(struct AudioOptions* audioOptions) {
switch (audioOptions->selectedItem) {
case AudioOptionGameVolume:
audioOptionsHandleSlider(audioOptions->selectedItem, &gSaveData.audio.soundVolume, &audioOptions->gameVolume.value);
soundPlayerGameVolumeUpdate(SoundTypeAll);
soundPlayerGameVolumeUpdate();
break;
case AudioOptionMusicVolume:
audioOptionsHandleSlider(audioOptions->selectedItem, &gSaveData.audio.musicVolume, &audioOptions->musicVolume.value);
soundPlayerGameVolumeUpdate(SoundTypeMusic);
soundPlayerGameVolumeUpdate();
break;
case AudioOptionSubtitlesEnabled:
if (controllerGetButtonDown(0, A_BUTTON)) {