1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-04 18:29:41 +01:00

Fix 1-frame glitch when fading in from zero

The problem here is that even though we start playing the music when the
volume is set to zero, mixer's state doesn't have volume zero, so
whatever it plays next will be the very first quanta of the track but at
the previous volume (in this case, the maximum volume). To fix this,
just update mixer when we update the volume here - it's okay to not
account for user volume because it ends up being zero anyway.

Fixes #710.
This commit is contained in:
Misa 2021-04-12 10:41:44 -07:00 committed by Ethan Lee
parent 27d0b1a1d4
commit af2e6a2331

View file

@ -293,6 +293,9 @@ void musicclass::fadeMusicVolumeIn(int ms)
/* Ensure it starts at 0 */ /* Ensure it starts at 0 */
musicVolume = 0; musicVolume = 0;
/* Fix 1-frame glitch */
Mix_VolumeMusic(0);
setfadeamount(ms); setfadeamount(ms);
} }