mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Music lump existence minor fixes
This commit is contained in:
parent
8ea82a98d7
commit
2fb7eb5679
2 changed files with 9 additions and 2 deletions
|
|
@ -1385,6 +1385,9 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char newmusic[7];
|
char newmusic[7];
|
||||||
|
boolean digiexists = S_DigExists(mmusic);
|
||||||
|
boolean midiexists = S_MIDIExists(newmusic);
|
||||||
|
|
||||||
#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS)
|
#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS)
|
||||||
if(LUAh_MusicChange(music_name, mmusic, newmusic, &mflags, &looping))
|
if(LUAh_MusicChange(music_name, mmusic, newmusic, &mflags, &looping))
|
||||||
return;
|
return;
|
||||||
|
|
@ -1400,7 +1403,7 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (S_MusicExists(newmusic, false, true) && !nodigimusic && !digital_disabled) // digmusic?
|
if (digiexists && !nodigimusic && !digital_disabled) // digmusic?
|
||||||
{
|
{
|
||||||
if (prefadems) //have to queue post-fade // allow even if the music is the same
|
if (prefadems) //have to queue post-fade // allow even if the music is the same
|
||||||
{
|
{
|
||||||
|
|
@ -1426,7 +1429,7 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U
|
||||||
I_SetSongTrack(mflags & MUSIC_TRACKMASK);
|
I_SetSongTrack(mflags & MUSIC_TRACKMASK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strncmp(music_name, newmusic, 6) && S_MusicExists(newmusic, true, false) && !nomidimusic && !music_disabled) // midimusic?
|
else if (strncmp(music_name, newmusic, 6) && midiexists && !nomidimusic && !music_disabled) // midimusic?
|
||||||
{
|
{
|
||||||
// HACK: We don't support fade for MIDI right now, so
|
// HACK: We don't support fade for MIDI right now, so
|
||||||
// just fall to old behavior verbatim. This technically should be implemented in
|
// just fall to old behavior verbatim. This technically should be implemented in
|
||||||
|
|
@ -1440,6 +1443,8 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!midiexists && !digiexists)
|
||||||
|
CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), newmusic);
|
||||||
}
|
}
|
||||||
|
|
||||||
musictype_t S_MusicType()
|
musictype_t S_MusicType()
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,8 @@ const char *S_MusicName(void);
|
||||||
|
|
||||||
// Checks if music name exists
|
// Checks if music name exists
|
||||||
boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi);
|
boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi);
|
||||||
|
#define S_DigExists(a) S_MusicExists(a, false, true)
|
||||||
|
#define S_MIDIExists(a) S_MusicExists(a, true, false)
|
||||||
|
|
||||||
void S_StopFadingMusic(void);
|
void S_StopFadingMusic(void);
|
||||||
boolean S_FadeMusicFromLevel(UINT8 target_volume, INT16 source_volume, UINT32 ms);
|
boolean S_FadeMusicFromLevel(UINT8 target_volume, INT16 source_volume, UINT32 ms);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue