diff options
author | Chris Robinson <[email protected]> | 2014-05-17 07:17:48 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-05-17 07:17:48 -0700 |
commit | 0b5b39d5e60b250a41a6f306f3167a553d5dad58 (patch) | |
tree | 22141ce0bc2e5e009d217b3beedaa3f59eec48cd /Alc/ALu.c | |
parent | 70f1e54068f2ccfce30f9e5db8ea61b01283f59b (diff) |
Add a flag to specify when the low-pass filter needs to apply
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -581,23 +581,29 @@ ALvoid CalcNonAttnSourceParams(ALactivesource *src, const ALCcontext *ALContext) src->WetMix = SelectSendMixer(); { - ALfloat gain = maxf(0.01f, DryGainHF); + ALfloat gainhf = maxf(0.01f, DryGainHF); ALfloat hfscale = ALSource->Direct.HFReference / Frequency; for(c = 0;c < num_channels;c++) + { + src->Direct.Filters[c] = (gainhf != 1.0f) ? AF_LowPass : AF_None; ALfilterState_setParams( - &src->Direct.LpFilter[c], ALfilterType_HighShelf, gain, + &src->Direct.LpFilter[c], ALfilterType_HighShelf, gainhf, hfscale, 0.0f ); + } } for(i = 0;i < NumSends;i++) { - ALfloat gain = maxf(0.01f, WetGainHF[i]); + ALfloat gainhf = maxf(0.01f, WetGainHF[i]); ALfloat hfscale = ALSource->Send[i].HFReference / Frequency; for(c = 0;c < num_channels;c++) + { + src->Send[i].Filters[c] = (gainhf != 1.0f) ? AF_LowPass : AF_None; ALfilterState_setParams( - &src->Send[i].LpFilter[c], ALfilterType_HighShelf, gain, + &src->Send[i].LpFilter[c], ALfilterType_HighShelf, gainhf, hfscale, 0.0f ); + } } } @@ -1082,19 +1088,21 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext) src->WetMix = SelectSendMixer(); { - ALfloat gain = maxf(0.01f, DryGainHF); + ALfloat gainhf = maxf(0.01f, DryGainHF); ALfloat hfscale = ALSource->Direct.HFReference / Frequency; + src->Direct.Filters[0] = (gainhf != 1.0f) ? AF_LowPass : AF_None; ALfilterState_setParams( - &src->Direct.LpFilter[0], ALfilterType_HighShelf, gain, + &src->Direct.LpFilter[0], ALfilterType_HighShelf, gainhf, hfscale, 0.0f ); } for(i = 0;i < NumSends;i++) { - ALfloat gain = maxf(0.01f, WetGainHF[i]); + ALfloat gainhf = maxf(0.01f, WetGainHF[i]); ALfloat hfscale = ALSource->Send[i].HFReference / Frequency; + src->Direct.Filters[0] = (gainhf != 1.0f) ? AF_LowPass : AF_None; ALfilterState_setParams( - &src->Send[i].LpFilter[0], ALfilterType_HighShelf, gain, + &src->Send[i].LpFilter[0], ALfilterType_HighShelf, gainhf, hfscale, 0.0f ); } |