mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix SDL music counter pause issue
This commit is contained in:
parent
01eeefded7
commit
0f5a7e43a1
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…
Add table
Reference in a new issue