Midimode safeties for song queueing/fading
This commit is contained in:
parent
6d8e3c2ac1
commit
9539c597dd
|
@ -1386,7 +1386,7 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U
|
||||||
|
|
||||||
char newmusic[7];
|
char newmusic[7];
|
||||||
boolean digiexists = S_DigExists(mmusic);
|
boolean digiexists = S_DigExists(mmusic);
|
||||||
boolean midiexists = S_MIDIExists(newmusic);
|
boolean midiexists = S_MIDIExists(mmusic);
|
||||||
|
|
||||||
#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))
|
||||||
|
@ -1405,7 +1405,7 @@ void S_ChangeMusicWithFade(const char *mmusic, UINT16 mflags, boolean looping, U
|
||||||
|
|
||||||
if (digiexists && !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 && I_MusicType() != MU_MID) //have to queue post-fade // allow even if the music is the same
|
||||||
{
|
{
|
||||||
I_FadeOutStopMusic(prefadems);
|
I_FadeOutStopMusic(prefadems);
|
||||||
I_QueueDigSongPostFade(newmusic, mflags & MUSIC_TRACKMASK, looping, position, fadeinms);
|
I_QueueDigSongPostFade(newmusic, mflags & MUSIC_TRACKMASK, looping, position, fadeinms);
|
||||||
|
|
|
@ -512,11 +512,17 @@ static void count_music_bytes(int chan, void *stream, int len, void *udata)
|
||||||
|
|
||||||
static void run_queue()
|
static void run_queue()
|
||||||
{
|
{
|
||||||
if (queue_stopafterfade)
|
if (queue_stopafterfade && midimode)
|
||||||
|
I_StopSong(1337);
|
||||||
|
else if (queue_stopafterfade && !midimode)
|
||||||
I_StopDigSong();
|
I_StopDigSong();
|
||||||
else if (queue_music_name[0])
|
else if (queue_music_name[0])
|
||||||
{
|
{
|
||||||
|
if (!midimode)
|
||||||
I_StopDigSong();
|
I_StopDigSong();
|
||||||
|
else
|
||||||
|
I_StopSong(1337);
|
||||||
|
|
||||||
if (I_StartDigSong(queue_music_name, queue_looping))
|
if (I_StartDigSong(queue_music_name, queue_looping))
|
||||||
{
|
{
|
||||||
I_SetSongTrack(queue_track);
|
I_SetSongTrack(queue_track);
|
||||||
|
@ -1252,14 +1258,12 @@ boolean I_FadeMusicFromLevel(UINT8 target_volume, UINT8 source_volume, UINT32 ms
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!volume_delta)
|
else if (!volume_delta || midimode)
|
||||||
{
|
|
||||||
if (stopafterfade)
|
|
||||||
{
|
{
|
||||||
|
if (stopafterfade && !midimode)
|
||||||
I_StopDigSong();
|
I_StopDigSong();
|
||||||
return true;
|
else if (stopafterfade && midimode)
|
||||||
}
|
I_StopSong(1337);
|
||||||
else
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1309,7 +1313,7 @@ boolean I_FadeInStartDigSong(const char *musicname, UINT16 track, boolean loopin
|
||||||
{
|
{
|
||||||
if (musicname[0] == 0)
|
if (musicname[0] == 0)
|
||||||
return true; // nothing to play
|
return true; // nothing to play
|
||||||
else if (queuepostfade && is_fading)
|
else if (queuepostfade && is_fading && !midimode)
|
||||||
{
|
{
|
||||||
strncpy(queue_music_name, musicname, 7);
|
strncpy(queue_music_name, musicname, 7);
|
||||||
queue_music_name[6] = 0;
|
queue_music_name[6] = 0;
|
||||||
|
|
Loading…
Reference in a new issue