aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-05-21 03:47:52 -0700
committerChris Robinson <[email protected]>2017-05-21 03:47:52 -0700
commit49e5c535915f52b7888a884f4ed8925682336b28 (patch)
treec43b3af970b86b7cb5840004493cbb9045e629b7 /Alc/ALu.c
parent95ea3fdd05d55020c056e549c74def62c508e761 (diff)
Reduce the amount of variables that hold the same value
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 28dfd7c1..7775d160 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -954,9 +954,9 @@ static void CalcPanningAndFilters(ALvoice *voice, const ALfloat Distance, const
ALfloat gainHF = maxf(DryGainHF, 0.001f); /* Limit -60dB */
ALfloat gainLF = maxf(DryGainLF, 0.001f);
- voice->Direct.Params[0].FilterType = AF_None;
- if(gainHF != 1.0f) voice->Direct.Params[0].FilterType |= AF_LowPass;
- if(gainLF != 1.0f) voice->Direct.Params[0].FilterType |= AF_HighPass;
+ voice->Direct.FilterType = AF_None;
+ if(gainHF != 1.0f) voice->Direct.FilterType |= AF_LowPass;
+ if(gainLF != 1.0f) voice->Direct.FilterType |= AF_HighPass;
ALfilterState_setParams(
&voice->Direct.Params[0].LowPass, ALfilterType_HighShelf,
gainHF, hfScale, calc_rcpQ_from_slope(gainHF, 1.0f)
@@ -967,7 +967,6 @@ static void CalcPanningAndFilters(ALvoice *voice, const ALfloat Distance, const
);
for(c = 1;c < num_channels;c++)
{
- voice->Direct.Params[c].FilterType = voice->Direct.Params[0].FilterType;
ALfilterState_copyParams(&voice->Direct.Params[c].LowPass,
&voice->Direct.Params[0].LowPass);
ALfilterState_copyParams(&voice->Direct.Params[c].HighPass,
@@ -981,9 +980,9 @@ static void CalcPanningAndFilters(ALvoice *voice, const ALfloat Distance, const
ALfloat gainHF = maxf(WetGainHF[i], 0.001f);
ALfloat gainLF = maxf(WetGainLF[i], 0.001f);
- voice->Send[i].Params[0].FilterType = AF_None;
- if(gainHF != 1.0f) voice->Send[i].Params[0].FilterType |= AF_LowPass;
- if(gainLF != 1.0f) voice->Send[i].Params[0].FilterType |= AF_HighPass;
+ voice->Send[i].FilterType = AF_None;
+ if(gainHF != 1.0f) voice->Send[i].FilterType |= AF_LowPass;
+ if(gainLF != 1.0f) voice->Send[i].FilterType |= AF_HighPass;
ALfilterState_setParams(
&voice->Send[i].Params[0].LowPass, ALfilterType_HighShelf,
gainHF, hfScale, calc_rcpQ_from_slope(gainHF, 1.0f)
@@ -994,7 +993,6 @@ static void CalcPanningAndFilters(ALvoice *voice, const ALfloat Distance, const
);
for(c = 1;c < num_channels;c++)
{
- voice->Send[i].Params[c].FilterType = voice->Send[i].Params[0].FilterType;
ALfilterState_copyParams(&voice->Send[i].Params[c].LowPass,
&voice->Send[i].Params[0].LowPass);
ALfilterState_copyParams(&voice->Send[i].Params[c].HighPass,