summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/AudioManager.cpp')
-rw-r--r--src/audio/AudioManager.cpp10
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