diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-08-20 14:28:18 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-08-20 14:28:18 +0300 |
commit | ef0b5f857db7b58a9bea62c68e89e17f45c0a0de (patch) | |
tree | f6dc301c9943146cd1d5c97cd06d73e1767cc147 /src/audio/AudioManager.cpp | |
parent | c168786b421a18f66202faa481a2570ef33f9708 (diff) |
A few small audio changes
Diffstat (limited to 'src/audio/AudioManager.cpp')
-rw-r--r-- | src/audio/AudioManager.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 1df4681c..425a897d 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -1113,12 +1113,12 @@ cAudioManager::AdjustSamplesVolume() } uint8 -cAudioManager::ComputeEmittingVolume(uint8 emittingVolume, float intensity, float dist) +cAudioManager::ComputeEmittingVolume(uint8 emittingVolume, float maxDistance, float distance) { - float quatIntensity = intensity / 4.0f; - float diffIntensity = intensity - quatIntensity; - if (dist > diffIntensity) - return (quatIntensity - (dist - diffIntensity)) * (float)emittingVolume / quatIntensity; + float minDistance = maxDistance / 4.0f; + float diffDistance = maxDistance - minDistance; + if (distance > diffDistance) + return (minDistance - (distance - diffDistance)) * (float)emittingVolume / minDistance; return emittingVolume; } #endif |