Refactor I_MusicType MusicPlaying and MusicPaused other targets

(cherry picked from commit 9e6eebeb8d)
This commit is contained in:
mazmazz 2018-08-23 20:14:56 -04:00
parent eacf0ba00b
commit 4d61f00b86
6 changed files with 22 additions and 22 deletions

View File

@ -70,17 +70,17 @@ void I_ShutdownMusic(void){}
// MUSIC PROPERTIES // MUSIC PROPERTIES
/// ------------------------ /// ------------------------
musictype_t I_MusicType(void) musictype_t I_SongType(void)
{ {
return MU_NONE; return MU_NONE;
} }
boolean I_MusicPlaying(void) boolean I_SongPlaying(void)
{ {
return false; return false;
} }
boolean I_MusicPaused(void) boolean I_SongPaused(void)
{ {
return false; return false;
} }

View File

@ -408,7 +408,7 @@ void I_ShutdownMusic(void)
// MUSIC PROPERTIES // MUSIC PROPERTIES
/// ------------------------ /// ------------------------
musictype_t I_MusicType(void) musictype_t I_SongType(void)
{ {
if (currsong) if (currsong)
return MU_MID; return MU_MID;
@ -416,12 +416,12 @@ musictype_t I_MusicType(void)
return MU_NONE; return MU_NONE;
} }
boolean I_MusicPlaying() boolean I_SongPlaying()
{ {
return (boolean)currsong; return (boolean)currsong;
} }
boolean I_MusicPaused() boolean I_SongPaused()
{ {
return songpaused; return songpaused;
} }

View File

@ -69,17 +69,17 @@ void I_ShutdownMusic(void){}
// MUSIC PROPERTIES // MUSIC PROPERTIES
/// ------------------------ /// ------------------------
musictype_t I_MusicType(void) musictype_t I_SongType(void)
{ {
return MU_NONE; return MU_NONE;
} }
boolean I_MusicPlaying(void) boolean I_SongPlaying(void)
{ {
return false; return false;
} }
boolean I_MusicPaused(void) boolean I_SongPaused(void)
{ {
return false; return false;
} }

View File

@ -63,7 +63,7 @@
UINT8 sound_started = false; UINT8 sound_started = false;
static Mix_Music *music; static Mix_Music *music;
static UINT8 music_volume, midi_volume, sfx_volume; static UINT8 music_volume, sfx_volume;
static float loop_point; static float loop_point;
static boolean songpaused; static boolean songpaused;
@ -91,7 +91,7 @@ void I_StartupSound(void)
} }
music = NULL; music = NULL;
music_volume = midi_volume = sfx_volume = 0; music_volume = sfx_volume = 0;
#if SDL_MIXER_VERSION_ATLEAST(1,2,11) #if SDL_MIXER_VERSION_ATLEAST(1,2,11)
Mix_Init(MIX_INIT_FLAC|MIX_INIT_MOD|MIX_INIT_MP3|MIX_INIT_OGG); Mix_Init(MIX_INIT_FLAC|MIX_INIT_MOD|MIX_INIT_MP3|MIX_INIT_OGG);

View File

@ -1313,7 +1313,7 @@ void I_StartupSound(void)
// MUSIC API. // MUSIC API.
// //
musictype_t I_MusicType(void) musictype_t I_SongType(void)
{ {
#ifdef HAVE_MIXER #ifdef HAVE_MIXER
#ifdef HAVE_LIBGME #ifdef HAVE_LIBGME
@ -1336,12 +1336,12 @@ musictype_t I_MusicType(void)
#endif #endif
} }
boolean I_MusicPlaying(void) boolean I_SongPlaying(void)
{ {
return music_started; return music_started;
} }
boolean I_MusicPaused(void) boolean I_SongPaused(void)
{ {
return Mix_PausedMusic(); return Mix_PausedMusic();
} }
@ -1591,17 +1591,17 @@ void I_ShutdownMusic(void)
// MUSIC PROPERTIES // MUSIC PROPERTIES
/// ------------------------ /// ------------------------
musictype_t I_MusicType(void) musictype_t I_SongType(void)
{ {
return MU_NONE; return MU_NONE;
} }
boolean I_MusicPlaying(void) boolean I_SongPlaying(void)
{ {
return false; return false;
} }
boolean I_MusicPaused(void) boolean I_SongPaused(void)
{ {
return false; return false;
} }

View File

@ -456,7 +456,7 @@ void I_ShutdownMusic(void)
// MUSIC PROPERTIES // MUSIC PROPERTIES
/// ------------------------ /// ------------------------
musictype_t I_MusicType(void) musictype_t I_SongType(void)
{ {
#ifdef HAVE_LIBGME #ifdef HAVE_LIBGME
if (gme) if (gme)
@ -491,12 +491,12 @@ musictype_t I_MusicType(void)
return MU_NONE; return MU_NONE;
} }
boolean I_MusicPlaying(void) boolean I_SongPlaying(void)
{ {
return (boolean)music_stream; return (boolean)music_stream;
} }
boolean I_MusicPaused(void) boolean I_SongPaused(void)
{ {
boolean fmpaused = false; boolean fmpaused = false;
if (music_stream) if (music_stream)
@ -780,7 +780,7 @@ boolean I_PlaySong(boolean looping)
#endif #endif
FMR(FMOD_System_PlaySound(fsys, FMOD_CHANNEL_FREE, music_stream, false, &music_channel)); FMR(FMOD_System_PlaySound(fsys, FMOD_CHANNEL_FREE, music_stream, false, &music_channel));
if (I_MusicType() != MU_MID) if (I_SongType() != MU_MID)
FMR(FMOD_Channel_SetVolume(music_channel, midi_volume / 31.0)); FMR(FMOD_Channel_SetVolume(music_channel, midi_volume / 31.0));
else else
FMR(FMOD_Channel_SetVolume(music_channel, music_volume / 31.0)); FMR(FMOD_Channel_SetVolume(music_channel, music_volume / 31.0));
@ -822,7 +822,7 @@ void I_SetMusicVolume(UINT8 volume)
return; return;
// volume is 0 to 31. // volume is 0 to 31.
if (I_MusicType() == MU_MID) if (I_SongType() == MU_MID)
music_volume = 31; // windows bug hack music_volume = 31; // windows bug hack
else else
music_volume = volume; music_volume = volume;