mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09: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:
parent
f6919981e5
commit
27d0b1a1d4
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue