sound mixing: PROPERLY detect silent sounds. Old code would cut off sounds at -15dB...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 8 Oct 2011 17:57:23 +0000 (17:57 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 8 Oct 2011 17:57:23 +0000 (17:57 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11393 d7cf8633-e32d-0410-b094-e92efae38249

snd_mix.c

index 6789891..eab51a6 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -249,7 +249,7 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes)
                        sum = 0;
                        for (i = 0;i < SND_LISTENERS;i++)
                                sum += vol[i]*vol[i];
-                       silent = sum < 0.001f;
+                       silent = sum < (1.0f / (65536.0f * 65536.0f)); // so silent it has zero effect
 
                        // when doing prologic mixing, some channels invert one side
                        if (ch->prologic_invert == -1)