]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Moved the clamping of volumes higher in the mixing code, so that 16 bit sounds are...
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 4 Oct 2004 06:56:58 +0000 (06:56 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 4 Oct 2004 06:56:58 +0000 (06:56 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4584 d7cf8633-e32d-0410-b094-e92efae38249

snd_mix.c

index bf4a1d057f5faab49371af4a00eff118742d19e7..efd562c21de80154a1082b183e2a6db1fe646155 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -344,6 +344,11 @@ void S_PaintChannels(int endtime)
 
                                if (count > 0)
                                {
+                                       if (ch->leftvol > 255)
+                                               ch->leftvol = 255;
+                                       if (ch->rightvol > 255)
+                                               ch->rightvol = 255;
+
                                        if (sfx->format.width == 1)
                                                stop_paint = !SND_PaintChannelFrom8(ch, count);
                                        else
@@ -403,11 +408,6 @@ qboolean SND_PaintChannelFrom8 (channel_t *ch, int count)
        const sfxbuffer_t *sb;
        int i, n;
 
-       if (ch->leftvol > 255)
-               ch->leftvol = 255;
-       if (ch->rightvol > 255)
-               ch->rightvol = 255;
-
        lscale = snd_scaletable[ch->leftvol >> 3];
        rscale = snd_scaletable[ch->rightvol >> 3];