Detect GME more simply

This commit is contained in:
mazmazz 2018-08-24 17:58:56 -04:00
parent bd01c75a4e
commit 4d91b44c63

View file

@ -509,11 +509,7 @@ static void do_fading_callback()
static void count_music_bytes(int chan, void *stream, int len, void *udata) static void count_music_bytes(int chan, void *stream, int len, void *udata)
{ {
if ( if (!music || I_SongType() == MU_GME || I_SongType() == MU_MOD || I_SongType() == MU_MID)
#ifdef HAVE_LIBGME
gme ||
#endif
!music || I_SongType() == MU_MOD || I_SongType() == MU_MID)
return; return;
music_bytes += len; music_bytes += len;
} }
@ -720,11 +716,7 @@ UINT32 I_GetSongLength(void)
boolean I_SetSongLoopPoint(UINT32 looppoint) boolean I_SetSongLoopPoint(UINT32 looppoint)
{ {
if ( if (!music || I_SongType() == MU_GME || I_SongType() == MU_MOD || I_SongType() == MU_MID || !is_looping)
#ifdef HAVE_LIBGME
gme ||
#endif
!music || I_SongType() == MU_MOD || I_SongType() == MU_MID || !is_looping)
return false; return false;
else else
{ {
@ -1162,11 +1154,7 @@ void I_PauseSong()
if(I_SongType() == MU_MID) // really, SDL Mixer? why can't you pause MIDI??? if(I_SongType() == MU_MID) // really, SDL Mixer? why can't you pause MIDI???
return; return;
if( if(I_SongType() != MU_GME && I_SongType() != MU_MOD && I_SongType() != MU_MID)
#ifdef HAVE_LIBGME
!gme &&
#endif
I_SongType() != MU_MOD && I_SongType() != MU_MID)
Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes); Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes);
Mix_PauseMusic(); Mix_PauseMusic();
@ -1178,11 +1166,7 @@ void I_ResumeSong()
if (I_SongType() == MU_MID) if (I_SongType() == MU_MID)
return; return;
if ( if (I_SongType() != MU_GME && I_SongType() != MU_MOD && I_SongType() != MU_MID)
#ifdef HAVE_LIBGME
!gme &&
#endif
I_SongType() != MU_MOD && I_SongType() != MU_MID)
{ {
while(Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes) != 0) { } while(Mix_UnregisterEffect(MIX_CHANNEL_POST, count_music_bytes) != 0) { }
// HACK: fixes issue of multiple effect callbacks being registered // HACK: fixes issue of multiple effect callbacks being registered