Merge branch 'mute-music' into 'master'
Mute music instead of pausing if lose focus See merge request KartKrew/Kart-Public!235
This commit is contained in:
commit
583eede2b8
2 files changed
+5
-5
No files matched your search
+3
-3
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user