mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-20 00:11:19 +00:00
Lua S_MusicInfo fix and FMOD GME fix: play song in I_PlaySong, not I_LoadSong
This commit is contained in:
parent
bf61dbb6e2
commit
bf4e7d2dd6
2 changed files with 2 additions and 2 deletions
|
@ -2333,7 +2333,7 @@ static int lib_sMusicInfo(lua_State *L)
|
|||
}
|
||||
if (!player || P_IsLocalPlayer(player))
|
||||
{
|
||||
char *mname;
|
||||
char mname[7];
|
||||
UINT16 mflags;
|
||||
boolean looping;
|
||||
if (S_MusicInfo(mname, &mflags, &looping))
|
||||
|
|
|
@ -675,7 +675,6 @@ boolean I_LoadSong(char *data, size_t len)
|
|||
fmt.decodebuffersize = (44100 * 2) / 35;
|
||||
fmt.pcmreadcallback = GMEReadCallback;
|
||||
fmt.userdata = gme;
|
||||
FMR(FMOD_System_CreateStream(fsys, NULL, FMOD_OPENUSER | (looping ? FMOD_LOOP_NORMAL : 0), &fmt, &music_stream));
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
@ -772,6 +771,7 @@ boolean I_PlaySong(boolean looping)
|
|||
{
|
||||
gme_start_track(gme, 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_Channel_SetVolume(music_channel, music_volume / 31.0));
|
||||
FMR(FMOD_Channel_SetPriority(music_channel, 0));
|
||||
|
|
Loading…
Reference in a new issue