X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=snd_mix.c;h=79e6e0738803091e83f3ad084e286bc46c5fcb6f;hb=16aa505c55e4f8c8f4bc085055657117a0c5632d;hp=28fd81ef00ebedccb6ac8df466eea77510dfe3b7;hpb=100b264f202fa71c35a7c89782a280fc55dda284;p=xonotic%2Fdarkplaces.git diff --git a/snd_mix.c b/snd_mix.c index 28fd81ef..79e6e073 100644 --- a/snd_mix.c +++ b/snd_mix.c @@ -105,6 +105,10 @@ static void S_ConvertPaintBuffer(const portable_sampleframe_t *painted_ptr, void *snd_out++ = bound(-32768, val, 32767); } } + + // noise is really really annoying + if (cls.timedemo) + memset(rb_ptr, 0, nbframes * channels * width); } else // 8bit { @@ -161,6 +165,10 @@ static void S_ConvertPaintBuffer(const portable_sampleframe_t *painted_ptr, void *snd_out++ = bound(0, val, 255); } } + + // noise is really really annoying + if (cls.timedemo) + memset(rb_ptr, 128, nbframes * channels); } } @@ -459,8 +467,8 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes) for (i = 0; i < total_channels ; i++, ch++) { sfx_t *sfx; - unsigned int ltime; - unsigned int count; + int ltime; + int count; sfx = ch->sfx; if (sfx == NULL) @@ -474,16 +482,16 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes) if (ch->pos < 0) { count = -ch->pos; - count = min(count, frames - ltime); + count = min(count, (int)frames - ltime); ch->pos += count; ltime += count; } - while (ltime < frames) + while (ltime < (int)frames) { // paint up to end of buffer or of input, whichever is lower count = sfx->total_length - ch->pos; - count = bound(0, count, frames - ltime); + count = bound(0, count, (int)frames - ltime); if (count) { SND_PaintChannel (ch, paintbuffer + ltime, count);