diff options
author | Chris Robinson <[email protected]> | 2020-05-21 09:46:39 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-05-21 09:46:39 -0700 |
commit | e98017b475e830d0b93ebb1b71ac72c55ac994a7 (patch) | |
tree | 0aed5ce4328d8339f00f013602c1d77bde5321c0 /alc/alu.cpp | |
parent | 5bbbe8341ee54e8bfeb3817d332a8413c8c7eb81 (diff) |
Avoid a log10 constant call
Diffstat (limited to 'alc/alu.cpp')
-rw-r--r-- | alc/alu.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp index e6ff37ba..5ee1b4c3 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -1300,8 +1300,8 @@ void CalcAttnSourceParams(Voice *voice, const VoiceProps *props, const ALCcontex * decay distance (so it doesn't take any longer to decay * than the air would allow). */ - const float absorb_dist{std::log10(REVERB_DECAY_GAIN) / - std::log10(airAbsorption)}; + constexpr float log10_decaygain{-3.0f/*std::log10(REVERB_DECAY_GAIN)*/}; + const float absorb_dist{log10_decaygain / std::log10(airAbsorption)}; DecayDistance[i].HF = minf(absorb_dist, DecayDistance[i].HF); } } |