mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
Heuristic for fading environment sounds in
This commit is contained in:
parent
1cafef7bdb
commit
3ee4aadd88
@ -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…
x
Reference in New Issue
Block a user