From b6b84aa9d93eb8aaa213e35bcfb780b172cf619e Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 19 Aug 2009 06:11:51 +0000 Subject: [PATCH] support mute-when-idle properly git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9124 d7cf8633-e32d-0410-b094-e92efae38249 --- vid_agl.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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; + } } } -- 2.39.2