mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Make fade out duration proportional to volume
This is the same behavior as SDL_mixer. Else, a fadeout would last the same amount of time no matter the volume, which is a regression.
This commit is contained in:
parent
ad88939dbb
commit
2af04ad0fa
1 changed files with 2 additions and 1 deletions
|
@ -344,7 +344,8 @@ void musicclass::fadeMusicVolumeOut(const int fadeout_ms)
|
|||
m_doFadeOutVol = true;
|
||||
|
||||
fade.step_ms = 0;
|
||||
fade.duration_ms = fadeout_ms;
|
||||
/* Duration is proportional to current volume. */
|
||||
fade.duration_ms = fadeout_ms * musicVolume / MIX_MAX_VOLUME;
|
||||
fade.start_volume = musicVolume;
|
||||
fade.end_volume = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue