S_ChangeMusicWithFade fixes

* MusicSlot compatibility name fix
This commit is contained in:
mazmazz 2018-08-20 08:20:38 -04:00
parent dbd7cce52c
commit 7c3578896c

View file

@ -1294,21 +1294,21 @@ void S_StartSoundName(void *mo, const char *soundname)
#ifdef MUSICSLOT_COMPATIBILITY #ifdef MUSICSLOT_COMPATIBILITY
const char *compat_special_music_slots[16] = const char *compat_special_music_slots[16] =
{ {
"titles", // 1036 title screen "_title", // 1036 title screen
"read_m", // 1037 intro "_intro", // 1037 intro
"lclear", // 1038 level clear "_clear", // 1038 level clear
"invinc", // 1039 invincibility "_inv", // 1039 invincibility
"shoes", // 1040 super sneakers "_shoes", // 1040 super sneakers
"minvnc", // 1041 Mario invincibility "_minv", // 1041 Mario invincibility
"drown", // 1042 drowning "_drown", // 1042 drowning
"gmover", // 1043 game over "_gover", // 1043 game over
"xtlife", // 1044 extra life "_1up", // 1044 extra life
"contsc", // 1045 continue screen "_conti", // 1045 continue screen
"supers", // 1046 Super Sonic "_super", // 1046 Super Sonic
"chrsel", // 1047 character select "_chsel", // 1047 character select
"credit", // 1048 credits "_creds", // 1048 credits
"racent", // 1049 Race Results "_inter", // 1049 Race Results
"stjr", // 1050 Sonic Team Jr. Presents "_stjr", // 1050 Sonic Team Jr. Presents
"" ""
}; };
#endif #endif
@ -1423,11 +1423,29 @@ void S_ChangeMusicAdvanced(const char *mmusic, UINT16 mflags, boolean looping, U
else if (strncmp(music_name, newmusic, 6)) else if (strncmp(music_name, newmusic, 6))
{ {
S_StopMusic(); S_StopMusic();
if (!S_DigMusic(newmusic, looping)) if (position || fadeinms)
{
if(!I_FadeInStartDigSong(newmusic, mflags & MUSIC_TRACKMASK, looping, position, fadeinms, false))
{ {
CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), newmusic); CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), newmusic);
return; return;
} }
else
{
strncpy(music_name, newmusic, 7);
music_name[6] = 0;
music_lumpnum = LUMPERROR;
music_data = NULL;
music_handle = 0;
return;
}
}
else if (!S_DigMusic(newmusic, looping))
{
CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), newmusic);
return;
}
else
I_SetSongTrack(mflags & MUSIC_TRACKMASK); I_SetSongTrack(mflags & MUSIC_TRACKMASK);
} }
} }