diff options
author | Chris Robinson <[email protected]> | 2016-03-11 20:59:12 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-03-11 20:59:12 -0800 |
commit | 22abaa287d7c10fb1ae8ae34b32d5e0ebbbfad78 (patch) | |
tree | d2bc8ff92512024e5fefae19ca6ed6208ad1e61d /Alc/mixer_inc.c | |
parent | 532897219326e5ee47eb08810734b2f2ed4409a3 (diff) |
Use the real output's left and right channels with HRTF
Diffstat (limited to 'Alc/mixer_inc.c')
-rw-r--r-- | Alc/mixer_inc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c index a57a3ecb..e9d81c2a 100644 --- a/Alc/mixer_inc.c +++ b/Alc/mixer_inc.c @@ -23,9 +23,10 @@ static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], ALfloat left, ALfloat right); -void MixHrtf(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data, - ALuint Counter, ALuint Offset, ALuint OutPos, const ALuint IrSize, - const MixHrtfParams *hrtfparams, HrtfState *hrtfstate, ALuint BufferSize) +void MixHrtf(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx, + const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos, + const ALuint IrSize, const MixHrtfParams *hrtfparams, HrtfState *hrtfstate, + ALuint BufferSize) { ALfloat (*Coeffs)[2] = hrtfparams->Current->Coeffs; ALuint Delay[2] = { hrtfparams->Current->Delay[0], hrtfparams->Current->Delay[1] }; @@ -66,9 +67,9 @@ void MixHrtf(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data, } for(i = 0;i < todo;i++) - OutBuffer[0][OutPos+i] += out[i][0]; + OutBuffer[lidx][OutPos+i] += out[i][0]; for(i = 0;i < todo;i++) - OutBuffer[1][OutPos+i] += out[i][1]; + OutBuffer[ridx][OutPos+i] += out[i][1]; OutPos += todo; } @@ -107,9 +108,9 @@ skip_stepping: } for(i = 0;i < todo;i++) - OutBuffer[0][OutPos+i] += out[i][0]; + OutBuffer[lidx][OutPos+i] += out[i][0]; for(i = 0;i < todo;i++) - OutBuffer[1][OutPos+i] += out[i][1]; + OutBuffer[ridx][OutPos+i] += out[i][1]; OutPos += todo; } } |