mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-19 21:56:13 +00:00
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:
parent
9c55bc1cdd
commit
2c3ec9880f
1 changed files with 1 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue