mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 13:40:45 +00:00
Fix SDL music counter pause issue
This commit is contained in:
parent
29904a21b2
commit
e4a6cb87d1
1 changed files with 10 additions and 0 deletions
|
@ -486,6 +486,8 @@ void I_ShutdownMusic(void)
|
|||
void I_PauseSong(INT32 handle)
|
||||
{
|
||||
(void)handle;
|
||||
if(!midimode)
|
||||
Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes);
|
||||
Mix_PauseMusic();
|
||||
songpaused = true;
|
||||
}
|
||||
|
@ -493,6 +495,14 @@ void I_PauseSong(INT32 handle)
|
|||
void I_ResumeSong(INT32 handle)
|
||||
{
|
||||
(void)handle;
|
||||
if(!midimode)
|
||||
{
|
||||
while(Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes) != 0) { }
|
||||
// HACK: fixes issue of multiple effect callbacks being registered
|
||||
if(music && !Mix_RegisterEffect(MIX_CHANNEL_POST, count_music_bytes, NULL, NULL))
|
||||
// midimode and music must be checked in case nothing is actually playing
|
||||
CONS_Alert(CONS_WARNING, "Error registering SDL music position counter: %s\n", Mix_GetError());
|
||||
}
|
||||
Mix_ResumeMusic();
|
||||
songpaused = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue