From 87ba382ef525911ba44b166161b34313181a223c Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 9 Apr 2012 19:03:48 +0200 Subject: [PATCH] Reverted: dc87ef1a34b6 Parameter distMax depends on fixed values in sheets and other code. Using this to switch between rolloff and minimum sound is likely causing the glitchy sound volumes of background sounds. Must be fixed in whatever code is using too large value of distMax instead, and not here. --HG-- branch : sound_dev --- code/nel/src/sound/driver/source.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/nel/src/sound/driver/source.cpp b/code/nel/src/sound/driver/source.cpp index ace98ff81..2f96d74d8 100644 --- a/code/nel/src/sound/driver/source.cpp +++ b/code/nel/src/sound/driver/source.cpp @@ -26,15 +26,12 @@ namespace NLSOUND // common method used only with OptionManualRolloff. return the volume in 1/100th DB ( = mB) modified sint32 ISource::computeManualRollOff(sint32 volumeMB, sint32 mbMin, sint32 mbMax, double alpha, float sqrdist, float distMin, float distMax) { - // root square of max float value - static float maxSqrt = sqrt(std::numeric_limits::max()); - if (sqrdist < distMin * distMin) { // no attenuation return volumeMB; } - else if ((distMax < maxSqrt) && (sqrdist > distMax * distMax)) + else if (sqrdist > distMax * distMax) { // full attenuation return mbMin;