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

Unindent musicclass::play() from previous two commits

As always, the actual unindenting happens in a separate commit in order
to minimize diff noise.
This commit is contained in:
Misa 2021-01-03 23:26:05 -08:00 committed by Ethan Lee
parent f64cf4f831
commit 8e5714439a

View file

@ -195,51 +195,51 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
currentsong = t;
if (t == -1)
if (t == -1)
{
return;
}
if (!INBOUNDS_VEC(t, musicTracks))
{
puts("play() out-of-bounds!");
currentsong = -1;
return;
}
if (currentsong == 0 || currentsong == 7 || (!map.custommode && (currentsong == 0+num_mmmmmm_tracks || currentsong == 7+num_mmmmmm_tracks)))
{
// Level Complete theme, no fade in or repeat
if (Mix_FadeInMusicPos(musicTracks[t].m_music, 0, 0, position_sec) == -1)
{
return;
printf("Mix_FadeInMusicPos: %s\n", Mix_GetError());
}
}
else
{
if (Mix_FadingMusic() == MIX_FADING_OUT)
{
// We're already fading out
nicechange = t;
nicefade = true;
currentsong = -1;
if (!INBOUNDS_VEC(t, musicTracks))
if (quick_fade)
{
puts("play() out-of-bounds!");
currentsong = -1;
return;
}
if (currentsong == 0 || currentsong == 7 || (!map.custommode && (currentsong == 0+num_mmmmmm_tracks || currentsong == 7+num_mmmmmm_tracks)))
{
// Level Complete theme, no fade in or repeat
if (Mix_FadeInMusicPos(musicTracks[t].m_music, 0, 0, position_sec) == -1)
{
printf("Mix_FadeInMusicPos: %s\n", Mix_GetError());
}
Mix_FadeOutMusic(500); // fade out quicker
}
else
{
if (Mix_FadingMusic() == MIX_FADING_OUT)
{
// We're already fading out
nicechange = t;
nicefade = true;
currentsong = -1;
if (quick_fade)
{
Mix_FadeOutMusic(500); // fade out quicker
}
else
{
quick_fade = true;
}
}
else if (Mix_FadeInMusicPos(musicTracks[t].m_music, -1, fadein_ms, position_sec) == -1)
{
printf("Mix_FadeInMusicPos: %s\n", Mix_GetError());
}
quick_fade = true;
}
}
else if (Mix_FadeInMusicPos(musicTracks[t].m_music, -1, fadein_ms, position_sec) == -1)
{
printf("Mix_FadeInMusicPos: %s\n", Mix_GetError());
}
}
songStart = SDL_GetPerformanceCounter();
songStart = SDL_GetPerformanceCounter();
}
void musicclass::resume(const int fadein_ms /*= 0*/)