mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 09:28:15 +03: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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user