mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-01 06:00:45 +00:00
Allow queueing music at end of song, not just fading
This commit is contained in:
parent
e51f9ecf90
commit
9eeed6338f
1 changed files with 15 additions and 13 deletions
|
@ -510,19 +510,6 @@ static void count_music_bytes(int chan, void *stream, int len, void *udata)
|
||||||
music_bytes += len;
|
music_bytes += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Music hooks
|
|
||||||
static void music_loop(void)
|
|
||||||
{
|
|
||||||
if (is_looping)
|
|
||||||
{
|
|
||||||
Mix_PlayMusic(music, 0);
|
|
||||||
Mix_SetMusicPosition(loop_point);
|
|
||||||
music_bytes = loop_point*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetMusicPosition)
|
|
||||||
}
|
|
||||||
else
|
|
||||||
I_StopDigSong();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void run_queue()
|
static void run_queue()
|
||||||
{
|
{
|
||||||
if (queue_stopafterfade)
|
if (queue_stopafterfade)
|
||||||
|
@ -542,6 +529,21 @@ static void run_queue()
|
||||||
queuecleanup();
|
queuecleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Music hooks
|
||||||
|
static void music_loop(void)
|
||||||
|
{
|
||||||
|
if (queue_music_name[0] && !is_fading && !is_looping)
|
||||||
|
run_queue();
|
||||||
|
else if (is_looping)
|
||||||
|
{
|
||||||
|
Mix_PlayMusic(music, 0);
|
||||||
|
Mix_SetMusicPosition(loop_point);
|
||||||
|
music_bytes = loop_point*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetMusicPosition)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
I_StopDigSong();
|
||||||
|
}
|
||||||
|
|
||||||
static UINT32 music_fade(UINT32 interval, void *param)
|
static UINT32 music_fade(UINT32 interval, void *param)
|
||||||
{
|
{
|
||||||
if (!is_fading ||
|
if (!is_fading ||
|
||||||
|
|
Loading…
Reference in a new issue