Clean up music error messages

This commit is contained in:
mazmazz 2019-11-30 11:53:45 -05:00
parent e664e8b7f3
commit be44f0701e
1 changed files with 7 additions and 19 deletions

View File

@ -2095,21 +2095,8 @@ static lumpnum_t S_GetMusicLumpNum(const char *mname)
return W_GetNumForName(va("o_%s", mname));
else if (!S_MIDIMusicDisabled() && S_MIDIExists(mname))
return W_GetNumForName(va("d_%s", mname));
else if (S_DigMusicDisabled() && S_DigExists(mname))
{
//CONS_Alert(CONS_NOTICE, "Digital music is disabled!\n");
return LUMPERROR;
}
else if (S_MIDIMusicDisabled() && S_MIDIExists(mname))
{
//CONS_Alert(CONS_NOTICE, "MIDI music is disabled!\n");
return LUMPERROR;
}
else
{
CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), mname);
return LUMPERROR;
}
}
static boolean S_LoadMusic(const char *mname)
@ -2123,7 +2110,10 @@ static boolean S_LoadMusic(const char *mname)
mlumpnum = S_GetMusicLumpNum(mname);
if (mlumpnum == LUMPERROR)
{
CONS_Alert(CONS_ERROR, "Music %.6s could not be loaded: lump not found!\n", mname);
return false;
}
// load & register it
mdata = W_CacheLumpNum(mlumpnum, PU_MUSIC);
@ -2148,7 +2138,10 @@ static boolean S_LoadMusic(const char *mname)
return true;
}
else
{
CONS_Alert(CONS_ERROR, "Music %.6s could not be loaded: engine failure!\n", mname);
return false;
}
}
static void S_UnloadMusic(void)
@ -2173,6 +2166,7 @@ static boolean S_PlayMusic(boolean looping, UINT32 fadeinms)
if ((!fadeinms && !I_PlaySong(looping)) ||
(fadeinms && !I_FadeInPlaySong(fadeinms, looping)))
{
CONS_Alert(CONS_ERROR, "Music %.6s could not be played: engine failure!\n", music_name);
S_UnloadMusic();
return false;
}
@ -2249,19 +2243,13 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
S_StopMusic();
if (!S_LoadMusic(newmusic))
{
CONS_Alert(CONS_ERROR, "Music %.6s could not be loaded!\n", newmusic);
return;
}
music_flags = mflags;
music_looping = looping;
if (!S_PlayMusic(looping, fadeinms))
{
CONS_Alert(CONS_ERROR, "Music %.6s could not be played!\n", newmusic);
return;
}
if (position)
I_SetSongPosition(position);