diff options
author | Chris Robinson <[email protected]> | 2013-05-21 07:10:24 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-05-21 07:10:24 -0700 |
commit | e4186f49039a17916dedaa536143761d0a6caa87 (patch) | |
tree | 4db81426d103111f53eae936e520d627e7916ccd /Alc/ALu.c | |
parent | 3ee0f8feb9a011eca3a76848f1ffb139c592f7b4 (diff) |
Use a properly-defined history for the FILTER struct
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -254,6 +254,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALboolean DirectChannels; ALfloat hwidth = 0.0f; ALfloat Pitch; + ALfloat coeff; ALfloat cw; ALint i, c; @@ -459,11 +460,14 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) /* We use two chained one-pole filters, so we need to take the * square root of the squared gain, which is the same as the base * gain. */ - ALSource->Params.Direct.iirFilter.coeff = lpCoeffCalc(DryGainHF, cw); + coeff = lpCoeffCalc(DryGainHF, cw); + for(c = 0;c < num_channels;c++) + ALSource->Params.Direct.Filter[c].coeff = lpCoeffCalc(DryGainHF, cw); for(i = 0;i < NumSends;i++) { - ALfloat a = lpCoeffCalc(WetGainHF[i], cw); - ALSource->Params.Send[i].iirFilter.coeff = a; + coeff = lpCoeffCalc(WetGainHF[i], cw); + for(c = 0;c < num_channels;c++) + ALSource->Params.Send[i].Filter[c].coeff = coeff; } } @@ -903,11 +907,11 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) /* Update filter coefficients. */ cw = cosf(F_PI*2.0f * LOWPASSFREQREF / Frequency); - ALSource->Params.Direct.iirFilter.coeff = lpCoeffCalc(DryGainHF, cw); + ALSource->Params.Direct.Filter[0].coeff = lpCoeffCalc(DryGainHF, cw); for(i = 0;i < NumSends;i++) { ALfloat a = lpCoeffCalc(WetGainHF[i], cw); - ALSource->Params.Send[i].iirFilter.coeff = a; + ALSource->Params.Send[i].Filter[0].coeff = a; } } |