1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-17 01:58:29 +02: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:
Misa 2021-08-22 16:57:13 -07:00
parent ad88939dbb
commit 2af04ad0fa

View File

@ -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;
}