aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-09-24 13:44:28 -0700
committerChris Robinson <[email protected]>2015-09-24 13:44:28 -0700
commit17e2b4b3a5c1778df5c8bea6aa6b74f03918218c (patch)
treea7025ae660bb248de32b64c0c5fcf7c62d99d2f2 /Alc
parentd8e2308adbc1a96bb651346789bc39cf547939ca (diff)
Remove unneeded clamping
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 1bed3f8e..9da1a658 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -640,42 +640,38 @@ ALvoid CalcNonAttnSourceParams(ALvoice *voice, const ALsource *ALSource, const A
}
{
- ALfloat gainhf = maxf(0.01f, DryGainHF);
- ALfloat gainlf = maxf(0.01f, DryGainLF);
ALfloat hfscale = ALSource->Direct.HFReference / Frequency;
ALfloat lfscale = ALSource->Direct.LFReference / Frequency;
for(c = 0;c < num_channels;c++)
{
voice->Direct.Filters[c].ActiveType = AF_None;
- if(gainhf != 1.0f) voice->Direct.Filters[c].ActiveType |= AF_LowPass;
- if(gainlf != 1.0f) voice->Direct.Filters[c].ActiveType |= AF_HighPass;
+ if(DryGainHF != 1.0f) voice->Direct.Filters[c].ActiveType |= AF_LowPass;
+ if(DryGainLF != 1.0f) voice->Direct.Filters[c].ActiveType |= AF_HighPass;
ALfilterState_setParams(
- &voice->Direct.Filters[c].LowPass, ALfilterType_HighShelf, gainhf,
+ &voice->Direct.Filters[c].LowPass, ALfilterType_HighShelf, DryGainHF,
hfscale, 0.0f
);
ALfilterState_setParams(
- &voice->Direct.Filters[c].HighPass, ALfilterType_LowShelf, gainlf,
+ &voice->Direct.Filters[c].HighPass, ALfilterType_LowShelf, DryGainLF,
lfscale, 0.0f
);
}
}
for(i = 0;i < NumSends;i++)
{
- ALfloat gainhf = maxf(0.01f, WetGainHF[i]);
- ALfloat gainlf = maxf(0.01f, WetGainLF[i]);
ALfloat hfscale = ALSource->Send[i].HFReference / Frequency;
ALfloat lfscale = ALSource->Send[i].LFReference / Frequency;
for(c = 0;c < num_channels;c++)
{
voice->Send[i].Filters[c].ActiveType = AF_None;
- if(gainhf != 1.0f) voice->Send[i].Filters[c].ActiveType |= AF_LowPass;
- if(gainlf != 1.0f) voice->Send[i].Filters[c].ActiveType |= AF_HighPass;
+ if(WetGainHF[i] != 1.0f) voice->Send[i].Filters[c].ActiveType |= AF_LowPass;
+ if(WetGainLF[i] != 1.0f) voice->Send[i].Filters[c].ActiveType |= AF_HighPass;
ALfilterState_setParams(
- &voice->Send[i].Filters[c].LowPass, ALfilterType_HighShelf, gainhf,
+ &voice->Send[i].Filters[c].LowPass, ALfilterType_HighShelf, WetGainHF[i],
hfscale, 0.0f
);
ALfilterState_setParams(
- &voice->Send[i].Filters[c].HighPass, ALfilterType_LowShelf, gainlf,
+ &voice->Send[i].Filters[c].HighPass, ALfilterType_LowShelf, WetGainLF[i],
lfscale, 0.0f
);
}
@@ -1116,37 +1112,33 @@ ALvoid CalcSourceParams(ALvoice *voice, const ALsource *ALSource, const ALCconte
}
{
- ALfloat gainhf = maxf(0.01f, DryGainHF);
- ALfloat gainlf = maxf(0.01f, DryGainLF);
ALfloat hfscale = ALSource->Direct.HFReference / Frequency;
ALfloat lfscale = ALSource->Direct.LFReference / Frequency;
voice->Direct.Filters[0].ActiveType = AF_None;
- if(gainhf != 1.0f) voice->Direct.Filters[0].ActiveType |= AF_LowPass;
- if(gainlf != 1.0f) voice->Direct.Filters[0].ActiveType |= AF_HighPass;
+ if(DryGainHF != 1.0f) voice->Direct.Filters[0].ActiveType |= AF_LowPass;
+ if(DryGainLF != 1.0f) voice->Direct.Filters[0].ActiveType |= AF_HighPass;
ALfilterState_setParams(
- &voice->Direct.Filters[0].LowPass, ALfilterType_HighShelf, gainhf,
+ &voice->Direct.Filters[0].LowPass, ALfilterType_HighShelf, DryGainHF,
hfscale, 0.0f
);
ALfilterState_setParams(
- &voice->Direct.Filters[0].HighPass, ALfilterType_LowShelf, gainlf,
+ &voice->Direct.Filters[0].HighPass, ALfilterType_LowShelf, DryGainLF,
lfscale, 0.0f
);
}
for(i = 0;i < NumSends;i++)
{
- ALfloat gainhf = maxf(0.01f, WetGainHF[i]);
- ALfloat gainlf = maxf(0.01f, WetGainLF[i]);
ALfloat hfscale = ALSource->Send[i].HFReference / Frequency;
ALfloat lfscale = ALSource->Send[i].LFReference / Frequency;
voice->Send[i].Filters[0].ActiveType = AF_None;
- if(gainhf != 1.0f) voice->Send[i].Filters[0].ActiveType |= AF_LowPass;
- if(gainlf != 1.0f) voice->Send[i].Filters[0].ActiveType |= AF_HighPass;
+ if(WetGainHF[i] != 1.0f) voice->Send[i].Filters[0].ActiveType |= AF_LowPass;
+ if(WetGainLF[i] != 1.0f) voice->Send[i].Filters[0].ActiveType |= AF_HighPass;
ALfilterState_setParams(
- &voice->Send[i].Filters[0].LowPass, ALfilterType_HighShelf, gainhf,
+ &voice->Send[i].Filters[0].LowPass, ALfilterType_HighShelf, WetGainHF[i],
hfscale, 0.0f
);
ALfilterState_setParams(
- &voice->Send[i].Filters[0].HighPass, ALfilterType_LowShelf, gainlf,
+ &voice->Send[i].Filters[0].HighPass, ALfilterType_LowShelf, WetGainLF[i],
lfscale, 0.0f
);
}