mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 20:50:58 +00:00
Merge branch 'music-error-cleanup' into 'master'
Clean up music error messages Closes #407 See merge request STJr/SRB2Internal!585
This commit is contained in:
commit
231d387aa3
1 changed files with 7 additions and 19 deletions
|
@ -2095,21 +2095,8 @@ static lumpnum_t S_GetMusicLumpNum(const char *mname)
|
||||||
return W_GetNumForName(va("o_%s", mname));
|
return W_GetNumForName(va("o_%s", mname));
|
||||||
else if (!S_MIDIMusicDisabled() && S_MIDIExists(mname))
|
else if (!S_MIDIMusicDisabled() && S_MIDIExists(mname))
|
||||||
return W_GetNumForName(va("d_%s", 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
|
else
|
||||||
{
|
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), mname);
|
|
||||||
return LUMPERROR;
|
return LUMPERROR;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean S_LoadMusic(const char *mname)
|
static boolean S_LoadMusic(const char *mname)
|
||||||
|
@ -2123,7 +2110,10 @@ static boolean S_LoadMusic(const char *mname)
|
||||||
mlumpnum = S_GetMusicLumpNum(mname);
|
mlumpnum = S_GetMusicLumpNum(mname);
|
||||||
|
|
||||||
if (mlumpnum == LUMPERROR)
|
if (mlumpnum == LUMPERROR)
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_ERROR, "Music %.6s could not be loaded: lump not found!\n", mname);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// load & register it
|
// load & register it
|
||||||
mdata = W_CacheLumpNum(mlumpnum, PU_MUSIC);
|
mdata = W_CacheLumpNum(mlumpnum, PU_MUSIC);
|
||||||
|
@ -2148,7 +2138,10 @@ static boolean S_LoadMusic(const char *mname)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_ERROR, "Music %.6s could not be loaded: engine failure!\n", mname);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void S_UnloadMusic(void)
|
static void S_UnloadMusic(void)
|
||||||
|
@ -2173,6 +2166,7 @@ static boolean S_PlayMusic(boolean looping, UINT32 fadeinms)
|
||||||
if ((!fadeinms && !I_PlaySong(looping)) ||
|
if ((!fadeinms && !I_PlaySong(looping)) ||
|
||||||
(fadeinms && !I_FadeInPlaySong(fadeinms, looping)))
|
(fadeinms && !I_FadeInPlaySong(fadeinms, looping)))
|
||||||
{
|
{
|
||||||
|
CONS_Alert(CONS_ERROR, "Music %.6s could not be played: engine failure!\n", music_name);
|
||||||
S_UnloadMusic();
|
S_UnloadMusic();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2249,19 +2243,13 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
||||||
S_StopMusic();
|
S_StopMusic();
|
||||||
|
|
||||||
if (!S_LoadMusic(newmusic))
|
if (!S_LoadMusic(newmusic))
|
||||||
{
|
|
||||||
CONS_Alert(CONS_ERROR, "Music %.6s could not be loaded!\n", newmusic);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
music_flags = mflags;
|
music_flags = mflags;
|
||||||
music_looping = looping;
|
music_looping = looping;
|
||||||
|
|
||||||
if (!S_PlayMusic(looping, fadeinms))
|
if (!S_PlayMusic(looping, fadeinms))
|
||||||
{
|
|
||||||
CONS_Alert(CONS_ERROR, "Music %.6s could not be played!\n", newmusic);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (position)
|
if (position)
|
||||||
I_SetSongPosition(position);
|
I_SetSongPosition(position);
|
||||||
|
|
Loading…
Reference in a new issue