mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-30 21:20:54 +00:00
GME fix: play song in I_PlaySong, not I_LoadSong
This commit is contained in:
parent
cf065e106f
commit
5f21bf230d
2 changed files with 5 additions and 5 deletions
|
@ -656,7 +656,6 @@ boolean I_LoadSong(char *data, size_t len)
|
||||||
{
|
{
|
||||||
gme_equalizer_t eq = {GME_TREBLE, GME_BASS, 0,0,0,0,0,0,0,0};
|
gme_equalizer_t eq = {GME_TREBLE, GME_BASS, 0,0,0,0,0,0,0,0};
|
||||||
gme_set_equalizer(gme, &eq);
|
gme_set_equalizer(gme, &eq);
|
||||||
Mix_HookMusic(mix_gme, gme);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -712,16 +711,17 @@ void I_UnloadSong(void)
|
||||||
|
|
||||||
boolean I_PlaySong(boolean looping)
|
boolean I_PlaySong(boolean looping)
|
||||||
{
|
{
|
||||||
if (!music)
|
#ifdef HAVE_LIBGME
|
||||||
return false;
|
|
||||||
#ifdef HAVE_GME
|
|
||||||
if (gme)
|
if (gme)
|
||||||
{
|
{
|
||||||
gme_start_track(gme, 0);
|
gme_start_track(gme, 0);
|
||||||
current_track = 0;
|
current_track = 0;
|
||||||
|
Mix_HookMusic(mix_gme, gme);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
else if (!music)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (Mix_PlayMusic(music, looping && loop_point == 0.0f ? -1 : 0) == -1)
|
if (Mix_PlayMusic(music, looping && loop_point == 0.0f ? -1 : 0) == -1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -675,7 +675,6 @@ boolean I_LoadSong(char *data, size_t len)
|
||||||
fmt.decodebuffersize = (44100 * 2) / 35;
|
fmt.decodebuffersize = (44100 * 2) / 35;
|
||||||
fmt.pcmreadcallback = GMEReadCallback;
|
fmt.pcmreadcallback = GMEReadCallback;
|
||||||
fmt.userdata = gme;
|
fmt.userdata = gme;
|
||||||
FMR(FMOD_System_CreateStream(fsys, NULL, FMOD_OPENUSER | (looping ? FMOD_LOOP_NORMAL : 0), &fmt, &music_stream));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -772,6 +771,7 @@ boolean I_PlaySong(boolean looping)
|
||||||
{
|
{
|
||||||
gme_start_track(gme, 0);
|
gme_start_track(gme, 0);
|
||||||
current_track = 0;
|
current_track = 0;
|
||||||
|
FMR(FMOD_System_CreateStream(fsys, NULL, FMOD_OPENUSER | (looping ? FMOD_LOOP_NORMAL : 0), &fmt, &music_stream));
|
||||||
FMR(FMOD_System_PlaySound(fsys, FMOD_CHANNEL_FREE, music_stream, false, &music_channel));
|
FMR(FMOD_System_PlaySound(fsys, FMOD_CHANNEL_FREE, music_stream, false, &music_channel));
|
||||||
FMR(FMOD_Channel_SetVolume(music_channel, music_volume / 31.0));
|
FMR(FMOD_Channel_SetVolume(music_channel, music_volume / 31.0));
|
||||||
FMR(FMOD_Channel_SetPriority(music_channel, 0));
|
FMR(FMOD_Channel_SetPriority(music_channel, 0));
|
||||||
|
|
Loading…
Reference in a new issue