aboutsummaryrefslogtreecommitdiffstats
path: root/code/client/snd_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'code/client/snd_main.c')
-rw-r--r--code/client/snd_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/code/client/snd_main.c b/code/client/snd_main.c
index ea6bbeb..2526336 100644
--- a/code/client/snd_main.c
+++ b/code/client/snd_main.c
@@ -30,6 +30,7 @@ cvar_t *s_volume;
cvar_t *s_musicVolume;
cvar_t *s_doppler;
cvar_t *s_backend;
+cvar_t *s_muteWhenMinimized;
static soundInterface_t si;
@@ -219,6 +220,11 @@ S_Update
*/
void S_Update( void )
{
+ if( s_muteWhenMinimized->integer && com_minimized->integer ) {
+ S_StopAllSounds( );
+ return;
+ }
+
if( si.Update ) {
si.Update( );
}
@@ -372,6 +378,7 @@ void S_Init( void )
s_musicVolume = Cvar_Get( "s_musicvolume", "0.25", CVAR_ARCHIVE );
s_doppler = Cvar_Get( "s_doppler", "1", CVAR_ARCHIVE );
s_backend = Cvar_Get( "s_backend", "", CVAR_ROM );
+ s_muteWhenMinimized = Cvar_Get( "s_muteWhenMinimized", "0", CVAR_ARCHIVE );
cv = Cvar_Get( "s_initsound", "1", 0 );
if( !cv->integer ) {