mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Invert t comparison with -1 and un-nest rest of function
This is also another conditional where the rest of the function is nested. Furthermore, in order to not repeat ourselves, I've also decided to unconditionally assign currentsong to t, because if t is -1 currentsong gets assigned to -1 anyway - so it's the same thing, but it's much easier to see and think about.
This commit is contained in:
parent
fe5bacfdc2
commit
f64cf4f831
1 changed files with 5 additions and 7 deletions
|
@ -193,9 +193,12 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
|
|||
return;
|
||||
}
|
||||
|
||||
if (t != -1)
|
||||
currentsong = t;
|
||||
|
||||
if (t == -1)
|
||||
{
|
||||
currentsong = t;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!INBOUNDS_VEC(t, musicTracks))
|
||||
{
|
||||
|
@ -237,11 +240,6 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
|
|||
}
|
||||
|
||||
songStart = SDL_GetPerformanceCounter();
|
||||
}
|
||||
else
|
||||
{
|
||||
currentsong = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void musicclass::resume(const int fadein_ms /*= 0*/)
|
||||
|
|
Loading…
Reference in a new issue