mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 09:28:15 +03: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:
@@ -293,6 +293,9 @@ void musicclass::fadeMusicVolumeIn(int ms)
|
||||
/* Ensure it starts at 0 */
|
||||
musicVolume = 0;
|
||||
|
||||
/* Fix 1-frame glitch */
|
||||
Mix_VolumeMusic(0);
|
||||
|
||||
setfadeamount(ms);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user