Re-did this fix.

This commit is contained in:
Steel Titanium 2018-07-28 01:58:25 -04:00
parent 8aee862ff8
commit c02ee9a502
1 changed files with 5 additions and 13 deletions

View File

@ -66,6 +66,7 @@ static boolean midimode;
static Mix_Music *music; static Mix_Music *music;
static UINT8 music_volume, midi_volume, sfx_volume; static UINT8 music_volume, midi_volume, sfx_volume;
static float loop_point; static float loop_point;
static boolean songpaused;
#ifdef HAVE_LIBGME #ifdef HAVE_LIBGME
static Music_Emu *gme; static Music_Emu *gme;
@ -102,6 +103,7 @@ void I_StartupSound(void)
} }
sound_started = true; sound_started = true;
songpaused = false;
Mix_AllocateChannels(256); Mix_AllocateChannels(256);
} }
@ -450,7 +452,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
(void)udata; (void)udata;
// no gme? no music. // no gme? no music.
if (!gme || gme_track_ended(gme)) if (!gme || gme_track_ended(gme) || songpaused)
return; return;
// play gme into stream // play gme into stream
@ -475,25 +477,15 @@ void I_ShutdownMusic(void)
void I_PauseSong(INT32 handle) void I_PauseSong(INT32 handle)
{ {
(void)handle; (void)handle;
#ifdef HAVE_LIBGME
if (gme)
{
Mix_HookMusic(NULL, NULL);
}
#endif
Mix_PauseMusic(); Mix_PauseMusic();
songpaused = true;
} }
void I_ResumeSong(INT32 handle) void I_ResumeSong(INT32 handle)
{ {
(void)handle; (void)handle;
#ifdef HAVE_LIBGME
if (gme)
{
Mix_HookMusic(mix_gme, gme);
}
#endif
Mix_ResumeMusic(); Mix_ResumeMusic();
songpaused = false;
} }
// //