From 99d5fd4905322c05c12f8395fa32c0cc9f753fc3 Mon Sep 17 00:00:00 2001 From: icculus Date: Mon, 14 Sep 2009 16:25:29 +0000 Subject: Added s_muteWhenUnfocused cvar (thanks, Chris!). Fixes Bugzilla #3768. git-svn-id: svn://svn.icculus.org/quake3/trunk@1588 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/client/snd_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'code/client') diff --git a/code/client/snd_main.c b/code/client/snd_main.c index 2f48117..99f8304 100644 --- a/code/client/snd_main.c +++ b/code/client/snd_main.c @@ -31,6 +31,7 @@ cvar_t *s_musicVolume; cvar_t *s_doppler; cvar_t *s_backend; cvar_t *s_muteWhenMinimized; +cvar_t *s_muteWhenUnfocused; static soundInterface_t si; @@ -228,7 +229,8 @@ S_Update */ void S_Update( void ) { - if( s_muteWhenMinimized->integer && com_minimized->integer ) { + if( ( s_muteWhenMinimized->integer && com_minimized->integer ) || + ( s_muteWhenUnfocused->integer && com_unfocused->integer ) ) { S_StopAllSounds( ); return; } @@ -451,6 +453,7 @@ void S_Init( void ) 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 ); + s_muteWhenUnfocused = Cvar_Get( "s_muteWhenUnfocused", "0", CVAR_ARCHIVE ); cv = Cvar_Get( "s_initsound", "1", 0 ); if( !cv->integer ) { -- cgit v1.2.3