]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
add missing fabs
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 14 Oct 2011 18:59:55 +0000 (18:59 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 14 Oct 2011 18:59:55 +0000 (18:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11417 d7cf8633-e32d-0410-b094-e92efae38249

snd_mix.c

index 50c07bcc8b1fe9e8ea704d0c368e7e3124a17dec..fa0069aaafce4f1f755401dc0554ddbc9c335351 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -65,7 +65,7 @@ static void S_SoftClipPaintBuffer(portable_sampleframe_t *painted_ptr, int nbfra
                // let's do a simple limiter instead, seems to sound better
                static float maxvol = 0;
                maxvol = max(1.0f, maxvol * (1.0f - nbframes / (0.4f * snd_renderbuffer->format.speed)));
-#define SOFTCLIP(x) if((x)>maxvol) maxvol=(x); (x) /= maxvol;
+#define SOFTCLIP(x) if(fabs(x)>maxvol) maxvol=fabs(x); (x) /= maxvol;
 
                portable_sampleframe_t *p = painted_ptr;
                if (channels == 8)  // 7.1 surround