1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Ensure all fade-ins start from zero

This fixes a bug where fading music in but not going through the
music.play() path wouldn't start the fade volume from zero. If this
happened, then the previous volume would persist, and if the previous
volume was the max volume, then that essentially canceled out the
fade-in and prevented it from happening at all. But now all paths to
fadeMusicVolumeIn() set the volume to zero first, instead of only the
caller of music.play().
This commit is contained in:
Misa 2021-04-12 10:38:44 -07:00 committed by Ethan Lee
parent f6919981e5
commit 27d0b1a1d4

View file

@ -238,7 +238,6 @@ void musicclass::play(int t)
else else
{ {
fadeMusicVolumeIn(3000); fadeMusicVolumeIn(3000);
musicVolume = 0;
} }
} }
} }
@ -290,6 +289,10 @@ void musicclass::fadeMusicVolumeIn(int ms)
{ {
m_doFadeInVol = true; m_doFadeInVol = true;
m_doFadeOutVol = false; m_doFadeOutVol = false;
/* Ensure it starts at 0 */
musicVolume = 0;
setfadeamount(ms); setfadeamount(ms);
} }