From 401940edadaf80598407cd17ac5df7d8ba76d9a8 Mon Sep 17 00:00:00 2001 From: Michael Day <43701387+mikeday0@users.noreply.github.com> Date: Tue, 2 Jan 2024 11:06:16 -0500 Subject: [PATCH] Always set SDL music volume (#1133) * Always set SDL music volume * Respect DISABLE_SDL2MIXER --- src/i_sound.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/i_sound.c b/src/i_sound.c index 332f06af49..7d732a12fc 100644 --- a/src/i_sound.c +++ b/src/i_sound.c @@ -415,14 +415,18 @@ void I_ShutdownMusic(void) void I_SetMusicVolume(int volume) { - if (active_music_module != NULL) + if (music_module != NULL) { - active_music_module->SetMusicVolume(volume); + music_module->SetMusicVolume(volume); - if (music_packs_active && active_music_module != &music_pack_module) +#ifndef DISABLE_SDL2MIXER + // [crispy] always broadcast volume changes to SDL. This also covers + // the musicpack module. + if (music_module != &music_sdl_module) { - music_pack_module.SetMusicVolume(volume); + music_sdl_module.SetMusicVolume(volume); } +#endif } }