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.

This commit is contained in:
kaetemi 2012-04-09 19:03:48 +02:00
parent 51ac3a0e38
commit 2e47ab7fe4

View file

@ -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<float>::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;