From: divverent Date: Wed, 19 Aug 2009 06:11:51 +0000 (+0000) Subject: support mute-when-idle properly X-Git-Tag: xonotic-v0.1.0preview~1505 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b6b84aa9d93eb8aaa213e35bcfb780b172cf619e;p=xonotic%2Fdarkplaces.git support mute-when-idle properly git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9124 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/vid_agl.c b/vid_agl.c index 0c0fd7a7..b8201b6d 100644 --- a/vid_agl.c +++ b/vid_agl.c @@ -473,13 +473,21 @@ static void VID_AppFocusChanged(qboolean windowIsActive) VID_RestoreSystemGamma(); } - if (sound_active != windowIsActive) + if (windowIsActive || !snd_mutewhenidle.integer) { - sound_active = windowIsActive; - if (sound_active) + if (!sound_active) + { S_UnblockSound (); - else + sound_active = true; + } + } + else + { + if (sound_active) + { S_BlockSound (); + sound_active = false; + } } }