mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 04:11:18 +00:00
Mute music instead of pausing if lose focus
This commit is contained in:
parent
e2749f8fdc
commit
a39762a8fd
2 changed files with 5 additions and 5 deletions
|
@ -1952,7 +1952,7 @@ static boolean S_PlayMusic(boolean looping, UINT32 fadeinms)
|
||||||
S_InitMusicVolume(); // switch between digi and sequence volume
|
S_InitMusicVolume(); // switch between digi and sequence volume
|
||||||
|
|
||||||
if (window_notinfocus && !cv_playmusicifunfocused.value)
|
if (window_notinfocus && !cv_playmusicifunfocused.value)
|
||||||
I_PauseSong();
|
I_SetMusicVolume(0);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2418,9 +2418,9 @@ static void PlayMusicIfUnfocused_OnChange(void)
|
||||||
if (window_notinfocus)
|
if (window_notinfocus)
|
||||||
{
|
{
|
||||||
if (cv_playmusicifunfocused.value)
|
if (cv_playmusicifunfocused.value)
|
||||||
I_PauseSong();
|
I_SetMusicVolume(0);
|
||||||
else
|
else
|
||||||
I_ResumeSong();
|
S_InitMusicVolume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -625,7 +625,7 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
|
||||||
window_notinfocus = false;
|
window_notinfocus = false;
|
||||||
|
|
||||||
if (!paused)
|
if (!paused)
|
||||||
I_ResumeSong(); //resume it
|
S_InitMusicVolume();
|
||||||
|
|
||||||
if (cv_gamesounds.value)
|
if (cv_gamesounds.value)
|
||||||
S_EnableSound();
|
S_EnableSound();
|
||||||
|
@ -641,7 +641,7 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
|
||||||
// Tell game we lost focus, pause music
|
// Tell game we lost focus, pause music
|
||||||
window_notinfocus = true;
|
window_notinfocus = true;
|
||||||
if (!cv_playmusicifunfocused.value)
|
if (!cv_playmusicifunfocused.value)
|
||||||
I_PauseSong();
|
I_SetMusicVolume(0);
|
||||||
if (!cv_playsoundifunfocused.value)
|
if (!cv_playsoundifunfocused.value)
|
||||||
S_DisableSound();
|
S_DisableSound();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue