From 418e862c46c86f780f73e01e303fd039de913a48 Mon Sep 17 00:00:00 2001 From: molivier Date: Mon, 4 Oct 2004 06:56:58 +0000 Subject: [PATCH] Moved the clamping of volumes higher in the mixing code, so that 16 bit sounds are clamped too git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4584 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_mix.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snd_mix.c b/snd_mix.c index bf4a1d05..efd562c2 100644 --- 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]; -- 2.39.2