mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Merge branch 'gme-pause' into 'master'
Fix pausing on gme See merge request STJr/SRB2!251
This commit is contained in:
commit
16999b7080
1 changed files with 5 additions and 1 deletions
|
@ -66,6 +66,7 @@ static boolean midimode;
|
|||
static Mix_Music *music;
|
||||
static UINT8 music_volume, midi_volume, sfx_volume;
|
||||
static float loop_point;
|
||||
static boolean songpaused;
|
||||
|
||||
#ifdef HAVE_LIBGME
|
||||
static Music_Emu *gme;
|
||||
|
@ -102,6 +103,7 @@ void I_StartupSound(void)
|
|||
}
|
||||
|
||||
sound_started = true;
|
||||
songpaused = false;
|
||||
Mix_AllocateChannels(256);
|
||||
}
|
||||
|
||||
|
@ -450,7 +452,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
|
|||
(void)udata;
|
||||
|
||||
// no gme? no music.
|
||||
if (!gme || gme_track_ended(gme))
|
||||
if (!gme || gme_track_ended(gme) || songpaused)
|
||||
return;
|
||||
|
||||
// play gme into stream
|
||||
|
@ -476,12 +478,14 @@ void I_PauseSong(INT32 handle)
|
|||
{
|
||||
(void)handle;
|
||||
Mix_PauseMusic();
|
||||
songpaused = true;
|
||||
}
|
||||
|
||||
void I_ResumeSong(INT32 handle)
|
||||
{
|
||||
(void)handle;
|
||||
Mix_ResumeMusic();
|
||||
songpaused = false;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue