mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Move Mix_PausedMusic() call into wrapper function
This wrapper function is for (a) future-proofing (b) proactive prevention of future copy-pasting (c) to clarify that we never actually halt music in the SDL_mixer sense, we only pause it, so to check if the music is halted we actually check if the music is paused instead. This is important because Mix_PlayingMusic() does not check if the music is paused and Mix_PausedMusic() does not check if the music is halted.
This commit is contained in:
@@ -428,7 +428,7 @@ void musicclass::processmusic(void)
|
||||
}
|
||||
|
||||
/* This needs to come after processing fades */
|
||||
if (nicefade && Mix_PausedMusic() == 1)
|
||||
if (nicefade && halted())
|
||||
{
|
||||
play(nicechange);
|
||||
nicechange = -1;
|
||||
@@ -554,3 +554,8 @@ void musicclass::resumeef(void)
|
||||
{
|
||||
Mix_Resume(-1);
|
||||
}
|
||||
|
||||
bool musicclass::halted(void)
|
||||
{
|
||||
return Mix_PausedMusic() == 1;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,8 @@ public:
|
||||
void pauseef(void);
|
||||
void resumeef(void);
|
||||
|
||||
bool halted(void);
|
||||
|
||||
std::vector<SoundTrack> soundTracks;
|
||||
std::vector<MusicTrack> musicTracks;
|
||||
SoundSystem soundSystem;
|
||||
|
||||
Reference in New Issue
Block a user