Refactor I_MusicType MusicPlaying and MusicPaused other targets

This commit is contained in:
mazmazz 2018-08-23 20:14:56 -04:00
parent 4b82de9e54
commit 9e6eebeb8d
6 changed files with 22 additions and 22 deletions

View File

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

View File

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

View File

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

View File

@ -63,7 +63,7 @@
UINT8 sound_started = false;
static Mix_Music *music;
static UINT8 music_volume, midi_volume, sfx_volume;
static UINT8 music_volume, sfx_volume;
static float loop_point;
static boolean songpaused;
@ -91,7 +91,7 @@ void I_StartupSound(void)
}
music = NULL;
music_volume = midi_volume = sfx_volume = 0;
music_volume = sfx_volume = 0;
#if SDL_MIXER_VERSION_ATLEAST(1,2,11)
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.
//
musictype_t I_MusicType(void)
musictype_t I_SongType(void)
{
#ifdef HAVE_MIXER
#ifdef HAVE_LIBGME
@ -1336,12 +1336,12 @@ musictype_t I_MusicType(void)
#endif
}
boolean I_MusicPlaying(void)
boolean I_SongPlaying(void)
{
return music_started;
}
boolean I_MusicPaused(void)
boolean I_SongPaused(void)
{
return Mix_PausedMusic();
}
@ -1591,17 +1591,17 @@ void I_ShutdownMusic(void)
// MUSIC PROPERTIES
/// ------------------------
musictype_t I_MusicType(void)
musictype_t I_SongType(void)
{
return MU_NONE;
}
boolean I_MusicPlaying(void)
boolean I_SongPlaying(void)
{
return false;
}
boolean I_MusicPaused(void)
boolean I_SongPaused(void)
{
return false;
}

View File

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