Commit d2ee87ae authored by Jonathon Fowler's avatar Jonathon Fowler Committed by Evan Ramos

SW: Fix Lo Wang's Rap from being skipped at endgame

The song should play once before returning to the menu, so the 'loop'
parameter needs to be honoured within PlaySong() too.

Fixes #35
parent 421b54a8
......@@ -1890,7 +1890,8 @@ CreditsLevel(void)
handle = PlaySound(DIGI_JG95012,&zero,&zero,&zero,v3df_none);
if (handle > 0)
while (FX_SoundActive(handle)) ;
while (FX_SoundActive(handle))
handleevents();
// try 14 then 2 then quit
if (!PlaySong(NULL, 14, FALSE, TRUE))
......
......@@ -513,7 +513,7 @@ PlaySong(char *song_file_name, int cdaudio_track, SWBOOL loop, SWBOOL restart)
if (LoadSong(waveformtrack))
{
SongVoice = FX_Play(SongPtr, SongLength, 0, 0, 0,
SongVoice = FX_Play(SongPtr, SongLength, loop ? FX_LOOP : FX_ONESHOT, 0, 0,
255, 255, 255, FX_MUSIC_PRIORITY, fix16_one, MUSIC_ID);
if (SongVoice > FX_Ok)
{
......@@ -551,7 +551,7 @@ PlaySong(char *song_file_name, int cdaudio_track, SWBOOL loop, SWBOOL restart)
}
else
{
SongVoice = FX_Play(SongPtr, SongLength, 0, 0, 0,
SongVoice = FX_Play(SongPtr, SongLength, loop ? FX_LOOP : FX_ONESHOT, 0, 0,
255, 255, 255, FX_MUSIC_PRIORITY, fix16_one, MUSIC_ID);
if (SongVoice > FX_Ok)
{
......@@ -619,6 +619,12 @@ SetSongVolume(int volume)
SWBOOL
SongIsPlaying(void)
{
if (!gs.MusicOn)
return FALSE;
if (SongType == SongTypeWave && SongVoice >= 0)
return FX_SoundActive(SongVoice);
return FALSE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment