Skip to content
Snippets Groups Projects
Commit e51f9ecf authored by Marco Z's avatar Marco Z
Browse files

* Allow S_ChangeMusic to queue the same track for fading

* StopDigSong upon running queue so that GME works for queueing
parent fb0d1b45
Branches
Tags
No related merge requests found
......@@ -1400,11 +1400,9 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U
return;
}
if (strncmp(music_name, newmusic, 6))
{
if (S_MusicExists(newmusic, false, true) && !nodigimusic && !digital_disabled) // digmusic?
{
if (prefadems) //have to queue post-fade
if (prefadems) //have to queue post-fade // allow even if the music is the same
{
I_FadeOutStopMusic(prefadems);
I_QueueDigSongPostFade(newmusic, mflags & MUSIC_TRACKMASK, looping, position, fadeinms);
......@@ -1417,7 +1415,7 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U
music_handle = 0;
return;
}
else
else if (strncmp(music_name, newmusic, 6))
{
S_StopMusic();
if (!S_DigMusic(newmusic, looping))
......@@ -1425,9 +1423,10 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U
CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), newmusic);
return;
}
I_SetSongTrack(mflags & MUSIC_TRACKMASK);
}
}
else if (S_MusicExists(newmusic, true, false) && !nomidimusic && !music_disabled) // midimusic?
else if (strncmp(music_name, newmusic, 6) && S_MusicExists(newmusic, true, false) && !nomidimusic && !music_disabled) // midimusic?
{
// HACK: We don't support fade for MIDI right now, so
// just fall to old behavior verbatim. This technically should be implemented in
......@@ -1443,9 +1442,6 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U
}
}
I_SetSongTrack(mflags & MUSIC_TRACKMASK);
}
musictype_t S_MusicType()
{
return I_MusicType();
......
......@@ -527,7 +527,10 @@ static void run_queue()
{
if (queue_stopafterfade)
I_StopDigSong();
else if (queue_music_name[0] && I_StartDigSong(queue_music_name, queue_looping))
else if (queue_music_name[0])
{
I_StopDigSong();
if (I_StartDigSong(queue_music_name, queue_looping))
{
I_SetSongTrack(queue_track);
if (queue_fadeinms)
......@@ -535,6 +538,7 @@ static void run_queue()
if (queue_position)
I_SetMusicPosition(queue_position);
}
}
queuecleanup();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment