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

Fix whitespace inconsistency in musicclass::play()

Spaces are used around operators and keywords accordingly, and blank
lines are used to visually separate lines of code from each other.
This commit is contained in:
Misa 2021-01-03 23:20:35 -08:00 committed by Ethan Lee
parent ff3e390352
commit 96c479a11f

View file

@ -180,27 +180,31 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
t %= num_pppppp_tracks; t %= num_pppppp_tracks;
} }
if(mmmmmm && !usingmmmmmm) if (mmmmmm && !usingmmmmmm)
{ {
t += num_mmmmmm_tracks; t += num_mmmmmm_tracks;
} }
safeToProcessMusic = true; safeToProcessMusic = true;
musicVolume = MIX_MAX_VOLUME; musicVolume = MIX_MAX_VOLUME;
if (currentsong !=t)
if (currentsong != t)
{ {
if (t != -1) if (t != -1)
{ {
currentsong = t; currentsong = t;
if (!INBOUNDS_VEC(t, musicTracks)) if (!INBOUNDS_VEC(t, musicTracks))
{ {
puts("play() out-of-bounds!"); puts("play() out-of-bounds!");
currentsong = -1; currentsong = -1;
return; return;
} }
if (currentsong == 0 || currentsong == 7 || (!map.custommode && (currentsong == 0+num_mmmmmm_tracks || currentsong == 7+num_mmmmmm_tracks))) 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 // Level Complete theme, no fade in or repeat
if(Mix_FadeInMusicPos(musicTracks[t].m_music, 0, 0, position_sec)==-1) if (Mix_FadeInMusicPos(musicTracks[t].m_music, 0, 0, position_sec) == -1)
{ {
printf("Mix_FadeInMusicPos: %s\n", Mix_GetError()); printf("Mix_FadeInMusicPos: %s\n", Mix_GetError());
} }
@ -213,6 +217,7 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
nicechange = t; nicechange = t;
nicefade = true; nicefade = true;
currentsong = -1; currentsong = -1;
if (quick_fade) if (quick_fade)
{ {
Mix_FadeOutMusic(500); // fade out quicker Mix_FadeOutMusic(500); // fade out quicker
@ -222,7 +227,7 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
quick_fade = true; quick_fade = true;
} }
} }
else if(Mix_FadeInMusicPos(musicTracks[t].m_music, -1, fadein_ms, position_sec)==-1) else if (Mix_FadeInMusicPos(musicTracks[t].m_music, -1, fadein_ms, position_sec) == -1)
{ {
printf("Mix_FadeInMusicPos: %s\n", Mix_GetError()); printf("Mix_FadeInMusicPos: %s\n", Mix_GetError());
} }