diff options
author | Chris Robinson <[email protected]> | 2017-03-12 06:58:27 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-03-12 06:58:27 -0700 |
commit | 7b4645f5f8d0269f47517a506297bfb7694ec990 (patch) | |
tree | bfa97603c7c0fbc7dc4914a6c8d8a2b200a21341 /Alc/mixer.c | |
parent | 96aaab93662be289d3b2c5312ae50502afa8d221 (diff) |
Store the HRIR coeff pointer and delays directly in MixHrtfParams
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r-- | Alc/mixer.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index 67e74396..fd2eba01 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -612,7 +612,9 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei if(!Counter) { parms->Hrtf.Old = parms->Hrtf.Target; - hrtfparams.Current = &parms->Hrtf.Target; + hrtfparams.Coeffs = SAFE_CONST(ALfloat2*,parms->Hrtf.Target.Coeffs); + hrtfparams.Delay[0] = parms->Hrtf.Target.Delay[0]; + hrtfparams.Delay[1] = parms->Hrtf.Target.Delay[1]; hrtfparams.Gain = parms->Hrtf.Target.Gain; hrtfparams.GainStep = 0.0f; MixHrtfSamples( @@ -631,7 +633,9 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei * So it needs to fade out over DstBufferSize instead * of Counter. */ - hrtfparams.Current = &parms->Hrtf.Old; + hrtfparams.Coeffs = SAFE_CONST(ALfloat2*,parms->Hrtf.Old.Coeffs); + hrtfparams.Delay[0] = parms->Hrtf.Old.Delay[0]; + hrtfparams.Delay[1] = parms->Hrtf.Old.Delay[1]; hrtfparams.Gain = parms->Hrtf.Old.Gain; hrtfparams.GainStep = -hrtfparams.Gain / (ALfloat)DstBufferSize; @@ -648,8 +652,10 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei * fade time this mix handles. */ gain = lerp(parms->Hrtf.Old.Gain, parms->Hrtf.Target.Gain, - minf(1.0f, (ALfloat)Counter / (ALfloat)DstBufferSize)); - hrtfparams.Current = &parms->Hrtf.Target; + minf(1.0f, (ALfloat)Counter/DstBufferSize)); + hrtfparams.Coeffs = SAFE_CONST(ALfloat2*,parms->Hrtf.Target.Coeffs); + hrtfparams.Delay[0] = parms->Hrtf.Target.Delay[0]; + hrtfparams.Delay[1] = parms->Hrtf.Target.Delay[1]; hrtfparams.Gain = 0.0f; hrtfparams.GainStep = gain / (ALfloat)DstBufferSize; MixHrtfSamples( |