diff options
author | Chris Robinson <[email protected]> | 2014-09-10 16:52:54 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-09-10 16:52:54 -0700 |
commit | 01adfde1994c5482305b5ce54ffd921988a84616 (patch) | |
tree | 1f0fc7b4c54e9b485993884512b90bfe37794138 /Alc/ALu.c | |
parent | 49cb2421c71e3ef22d81ddfc3eac65e464eaeb2d (diff) |
Invert the ChannelOffsets array
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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); \ } |