From d1ca8b44708bedf87002b85a7482aed5486d51cd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 9 Dec 2010 05:05:42 -0800 Subject: Use simple loops instead of several explicit lines for the mono mixer --- Alc/mixer.c | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'Alc') diff --git a/Alc/mixer.c b/Alc/mixer.c index 4ce39580..2ebce319 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -95,14 +95,8 @@ static void Mix_##T##_Mono_##sampler(ALsource *Source, ALCdevice *Device, \ value = sampler(data+pos, 1, frac); \ \ value = lpFilter4PC(DryFilter, 0, value); \ - ClickRemoval[FRONT_LEFT] -= value*DrySend[FRONT_LEFT]; \ - ClickRemoval[FRONT_RIGHT] -= value*DrySend[FRONT_RIGHT]; \ - ClickRemoval[SIDE_LEFT] -= value*DrySend[SIDE_LEFT]; \ - ClickRemoval[SIDE_RIGHT] -= value*DrySend[SIDE_RIGHT]; \ - ClickRemoval[BACK_LEFT] -= value*DrySend[BACK_LEFT]; \ - ClickRemoval[BACK_RIGHT] -= value*DrySend[BACK_RIGHT]; \ - ClickRemoval[FRONT_CENTER] -= value*DrySend[FRONT_CENTER]; \ - ClickRemoval[BACK_CENTER] -= value*DrySend[BACK_CENTER]; \ + for(i = 0;i < MAXCHANNELS;i++) \ + ClickRemoval[i] -= value*DrySend[i]; \ } \ for(BufferIdx = 0;BufferIdx < BufferSize;BufferIdx++) \ { \ @@ -111,14 +105,8 @@ static void Mix_##T##_Mono_##sampler(ALsource *Source, ALCdevice *Device, \ \ /* Direct path final mix buffer and panning */ \ value = lpFilter4P(DryFilter, 0, value); \ - DryBuffer[OutPos][FRONT_LEFT] += value*DrySend[FRONT_LEFT]; \ - DryBuffer[OutPos][FRONT_RIGHT] += value*DrySend[FRONT_RIGHT]; \ - DryBuffer[OutPos][SIDE_LEFT] += value*DrySend[SIDE_LEFT]; \ - DryBuffer[OutPos][SIDE_RIGHT] += value*DrySend[SIDE_RIGHT]; \ - DryBuffer[OutPos][BACK_LEFT] += value*DrySend[BACK_LEFT]; \ - DryBuffer[OutPos][BACK_RIGHT] += value*DrySend[BACK_RIGHT]; \ - DryBuffer[OutPos][FRONT_CENTER] += value*DrySend[FRONT_CENTER]; \ - DryBuffer[OutPos][BACK_CENTER] += value*DrySend[BACK_CENTER]; \ + for(i = 0;i < MAXCHANNELS;i++) \ + DryBuffer[OutPos][i] += value*DrySend[i]; \ \ frac += increment; \ pos += frac>>FRACTIONBITS; \ @@ -130,14 +118,8 @@ static void Mix_##T##_Mono_##sampler(ALsource *Source, ALCdevice *Device, \ value = sampler(data+pos, 1, frac); \ \ value = lpFilter4PC(DryFilter, 0, value); \ - PendingClicks[FRONT_LEFT] += value*DrySend[FRONT_LEFT]; \ - PendingClicks[FRONT_RIGHT] += value*DrySend[FRONT_RIGHT]; \ - PendingClicks[SIDE_LEFT] += value*DrySend[SIDE_LEFT]; \ - PendingClicks[SIDE_RIGHT] += value*DrySend[SIDE_RIGHT]; \ - PendingClicks[BACK_LEFT] += value*DrySend[BACK_LEFT]; \ - PendingClicks[BACK_RIGHT] += value*DrySend[BACK_RIGHT]; \ - PendingClicks[FRONT_CENTER] += value*DrySend[FRONT_CENTER]; \ - PendingClicks[BACK_CENTER] += value*DrySend[BACK_CENTER]; \ + for(i = 0;i < MAXCHANNELS;i++) \ + PendingClicks[i] += value*DrySend[i]; \ } \ \ for(out = 0;out < Device->NumAuxSends;out++) \ -- cgit v1.2.3