diff options
author | Chris Robinson <[email protected]> | 2012-11-04 04:41:11 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-11-04 04:41:11 -0800 |
commit | e2368eb960ba1a43f365103a69e03803b8171731 (patch) | |
tree | 17c5f08eaf3b45f4903bea71db56362faed3afa7 /Alc/ALu.c | |
parent | 3e71a7cb9473cc403ad324d7e8468e2d6abd7de6 (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.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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); \ } |