aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-09-10 16:52:54 -0700
committerChris Robinson <[email protected]>2014-09-10 16:52:54 -0700
commit01adfde1994c5482305b5ce54ffd921988a84616 (patch)
tree1f0fc7b4c54e9b485993884512b90bfe37794138 /Alc/ALu.c
parent49cb2421c71e3ef22d81ddfc3eac65e464eaeb2d (diff)
Invert the ChannelOffsets array
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index b7311d8a..f3641226 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1108,19 +1108,22 @@ static void Write_##T(ALCdevice *device, ALvoid **buffer, ALuint SamplesToDo) \
{ \
ALfloat (*restrict DryBuffer)[BUFFERSIZE] = device->DryBuffer; \
const ALuint numchans = ChannelsFromDevFmt(device->FmtChans); \
- const ALuint *offsets = device->ChannelOffsets; \
+ const enum Channel *chans = device->ChannelName; \
ALuint i, j; \
\
for(j = 0;j < MaxChannels;j++) \
{ \
+ const enum Channel c = chans[j]; \
+ const ALfloat *in; \
T *restrict out; \
\
- if(offsets[j] == INVALID_OFFSET) \
+ if(c == InvalidChannel) \
continue; \
\
- out = (T*)(*buffer) + offsets[j]; \
+ in = DryBuffer[c]; \
+ out = (T*)(*buffer) + j; \
for(i = 0;i < SamplesToDo;i++) \
- out[i*numchans] = func(DryBuffer[j][i]); \
+ out[i*numchans] = func(in[i]); \
} \
*buffer = (char*)(*buffer) + SamplesToDo*numchans*sizeof(T); \
}