From a39762a8fde1e7755d66468057eb2b6a42ef35b7 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 28 Sep 2020 11:58:24 -0700 Subject: [PATCH] Mute music instead of pausing if lose focus --- src/s_sound.c | 6 +++--- src/sdl/i_video.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 22586321..ea0a1bbe 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1952,7 +1952,7 @@ static boolean S_PlayMusic(boolean looping, UINT32 fadeinms) S_InitMusicVolume(); // switch between digi and sequence volume if (window_notinfocus && !cv_playmusicifunfocused.value) - I_PauseSong(); + I_SetMusicVolume(0); return true; } @@ -2418,9 +2418,9 @@ static void PlayMusicIfUnfocused_OnChange(void) if (window_notinfocus) { if (cv_playmusicifunfocused.value) - I_PauseSong(); + I_SetMusicVolume(0); else - I_ResumeSong(); + S_InitMusicVolume(); } } diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 37eedf14..2858e9b6 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -625,7 +625,7 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt) window_notinfocus = false; if (!paused) - I_ResumeSong(); //resume it + S_InitMusicVolume(); if (cv_gamesounds.value) S_EnableSound(); @@ -641,7 +641,7 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt) // Tell game we lost focus, pause music window_notinfocus = true; if (!cv_playmusicifunfocused.value) - I_PauseSong(); + I_SetMusicVolume(0); if (!cv_playsoundifunfocused.value) S_DisableSound();