aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-11 10:07:17 -0700
committerChris Robinson <[email protected]>2014-05-11 10:07:17 -0700
commit343200d2296f8ceb14371d12d6032056ec7fb9a3 (patch)
tree48c42a51476b862eabec4d71c801691dbb84928a /Alc/ALu.c
parent58235bec174e97790c7567327521dfa9e2c16bdf (diff)
Store the filter reference frequency in the source
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 7135343d..07b6d501 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -582,18 +582,22 @@ ALvoid CalcNonAttnSourceParams(ALactivesource *src, const ALCcontext *ALContext)
{
ALfloat gain = maxf(0.01f, DryGainHF);
+ ALfloat hfscale = ALSource->Direct.HFReference / Frequency;
for(c = 0;c < num_channels;c++)
- ALfilterState_setParams(&src->Direct.LpFilter[c],
- ALfilterType_HighShelf, gain,
- (ALfloat)LOWPASSFREQREF/Frequency, 0.0f);
+ ALfilterState_setParams(
+ &src->Direct.LpFilter[c], ALfilterType_HighShelf, gain,
+ hfscale, 0.0f
+ );
}
for(i = 0;i < NumSends;i++)
{
ALfloat gain = maxf(0.01f, WetGainHF[i]);
+ ALfloat hfscale = ALSource->Send[i].HFReference / Frequency;
for(c = 0;c < num_channels;c++)
- ALfilterState_setParams(&src->Send[i].LpFilter[c],
- ALfilterType_HighShelf, gain,
- (ALfloat)LOWPASSFREQREF/Frequency, 0.0f);
+ ALfilterState_setParams(
+ &src->Send[i].LpFilter[c], ALfilterType_HighShelf, gain,
+ hfscale, 0.0f
+ );
}
}
@@ -1079,16 +1083,20 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext)
{
ALfloat gain = maxf(0.01f, DryGainHF);
- ALfilterState_setParams(&src->Direct.LpFilter[0],
- ALfilterType_HighShelf, gain,
- (ALfloat)LOWPASSFREQREF/Frequency, 0.0f);
+ ALfloat hfscale = ALSource->Direct.HFReference / Frequency;
+ ALfilterState_setParams(
+ &src->Direct.LpFilter[0], ALfilterType_HighShelf, gain,
+ hfscale, 0.0f
+ );
}
for(i = 0;i < NumSends;i++)
{
ALfloat gain = maxf(0.01f, WetGainHF[i]);
- ALfilterState_setParams(&src->Send[i].LpFilter[0],
- ALfilterType_HighShelf, gain,
- (ALfloat)LOWPASSFREQREF/Frequency, 0.0f);
+ ALfloat hfscale = ALSource->Send[i].HFReference / Frequency;
+ ALfilterState_setParams(
+ &src->Send[i].LpFilter[0], ALfilterType_HighShelf, gain,
+ hfscale, 0.0f
+ );
}
}