aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-11-04 04:41:11 -0800
committerChris Robinson <[email protected]>2012-11-04 04:41:11 -0800
commite2368eb960ba1a43f365103a69e03803b8171731 (patch)
tree17c5f08eaf3b45f4903bea71db56362faed3afa7 /Alc/ALu.c
parent3e71a7cb9473cc403ad324d7e8468e2d6abd7de6 (diff)
Use an array to specify the offset for each channel of the device buffer
This effectively inverts the DevChannels array
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index e0e5f8a3..a44c04b3 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -931,16 +931,19 @@ static int Write_##T(ALCdevice *device, T *RESTRICT buffer, \
{ \
ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE] = device->DryBuffer; \
ALuint numchans = ChannelsFromDevFmt(device->FmtChans); \
- const enum Channel *ChanMap = device->DevChannels; \
+ const ALuint *offsets = device->ChannelOffsets; \
ALuint i, j; \
\
- for(j = 0;j < numchans;j++) \
+ for(j = 0;j < MaxChannels;j++) \
{ \
- T *RESTRICT out = buffer + j; \
- enum Channel chan = ChanMap[j]; \
+ T *RESTRICT out; \
\
+ if(offsets[j] == INVALID_OFFSET) \
+ continue; \
+ \
+ out = buffer + offsets[j]; \
for(i = 0;i < SamplesToDo;i++) \
- out[i*numchans] = func(DryBuffer[chan][i]); \
+ out[i*numchans] = func(DryBuffer[j][i]); \
} \
return SamplesToDo*numchans*sizeof(T); \
}