mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 16:39:42 +00:00
Heuristic for fading environment sounds in
This commit is contained in:
parent
1cafef7bdb
commit
3ee4aadd88
1 changed files with 7 additions and 0 deletions
|
@ -58,6 +58,13 @@ namespace MWSound
|
|||
if (squaredDist > (maxDist * maxDist))
|
||||
return 0.0f;
|
||||
|
||||
// This is a *heuristic* that causes environment sounds to fade in. The idea is the following:
|
||||
// - Only looped sounds playing through the effects channel are environment sounds
|
||||
// - Do not fade in sounds if the player is already so close that the sound plays at maximum volume
|
||||
const float minDist = sfx->getMinDist();
|
||||
if ((squaredDist > (minDist * minDist)) && (type == Type::Sfx) && (mode & PlayMode::Loop))
|
||||
return 0.0f;
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue