aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-08-16 16:07:44 -0700
committerChris Robinson <[email protected]>2010-08-16 16:07:44 -0700
commit6027fda0ce3c5165f7a5494ebe6105c353db91b3 (patch)
tree07ec6b3ec27c6d605c102c95fdc3c85874a84ff4 /Alc/mixer.c
parente5cae875020ceced4a62557c230bb58a67fbe036 (diff)
Combine two arrays into one
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index e454d553..1ca0fcc0 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -318,10 +318,9 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
else if(Channels == 2) /* Stereo */
{
const int chans[] = {
- FRONT_LEFT, FRONT_RIGHT
- };
- const int chans2[] = {
- BACK_LEFT, SIDE_LEFT, BACK_RIGHT, SIDE_RIGHT
+ FRONT_LEFT, FRONT_RIGHT,
+ SIDE_LEFT, SIDE_RIGHT,
+ BACK_LEFT, BACK_RIGHT
};
#define DO_MIX(resampler) do { \
@@ -335,14 +334,14 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
DataPosFrac); \
\
outsamp = lpFilter2PC(DryFilter, chans[i]*2, value); \
- ClickRemoval[chans[i]] -= outsamp*DrySend[chans[i]]; \
- ClickRemoval[chans2[i*2+0]] -= outsamp*DrySend[chans2[i*2+0]]; \
- ClickRemoval[chans2[i*2+1]] -= outsamp*DrySend[chans2[i*2+1]]; \
+ ClickRemoval[chans[i+0]] -= outsamp*DrySend[chans[i+0]]; \
+ ClickRemoval[chans[i+2]] -= outsamp*DrySend[chans[i+2]]; \
+ ClickRemoval[chans[i+4]] -= outsamp*DrySend[chans[i+4]]; \
\
for(out = 0;out < MAX_SENDS;out++) \
{ \
- outsamp = lpFilter1PC(WetFilter[out], chans[out], value) * scaler;\
- WetClickRemoval[out][0] -= outsamp*WetSend[out]; \
+ outsamp = lpFilter1PC(WetFilter[out], chans[i], value); \
+ WetClickRemoval[out][0] -= outsamp*WetSend[out] * scaler; \
} \
} \
} \
@@ -355,14 +354,14 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
DataPosFrac); \
\
outsamp = lpFilter2P(DryFilter, chans[i]*2, value); \
- DryBuffer[j][chans[i]] += outsamp*DrySend[chans[i]]; \
- DryBuffer[j][chans2[i*2+0]] += outsamp*DrySend[chans2[i*2+0]]; \
- DryBuffer[j][chans2[i*2+1]] += outsamp*DrySend[chans2[i*2+1]]; \
+ DryBuffer[j][chans[i+0]] += outsamp*DrySend[chans[i+0]]; \
+ DryBuffer[j][chans[i+2]] += outsamp*DrySend[chans[i+2]]; \
+ DryBuffer[j][chans[i+4]] += outsamp*DrySend[chans[i+4]]; \
\
for(out = 0;out < MAX_SENDS;out++) \
{ \
outsamp = lpFilter1P(WetFilter[out], chans[i], value); \
- WetBuffer[out][j] += outsamp*WetSend[out]*scaler; \
+ WetBuffer[out][j] += outsamp*WetSend[out] * scaler; \
} \
} \
\
@@ -383,14 +382,14 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext,
frac); \
\
outsamp = lpFilter2PC(DryFilter, chans[i]*2, value); \
- PendingClicks[chans[i]] += outsamp*DrySend[chans[i]]; \
- PendingClicks[chans2[i*2+0]] += outsamp*DrySend[chans2[i*2+0]]; \
- PendingClicks[chans2[i*2+1]] += outsamp*DrySend[chans2[i*2+1]]; \
+ PendingClicks[chans[i+0]] += outsamp*DrySend[chans[i+0]]; \
+ PendingClicks[chans[i+2]] += outsamp*DrySend[chans[i+2]]; \
+ PendingClicks[chans[i+4]] += outsamp*DrySend[chans[i+4]]; \
\
for(out = 0;out < MAX_SENDS;out++) \
{ \
- outsamp = lpFilter1PC(WetFilter[out], chans[out], value) * scaler;\
- WetPendingClicks[out][0] += outsamp*WetSend[out]; \
+ outsamp = lpFilter1PC(WetFilter[out], chans[i], value); \
+ WetPendingClicks[out][0] += outsamp*WetSend[out] * scaler; \
} \
} \
} \