From b71996106be2bbefc085d0f8e4277ecd4dbc6ddf Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 18 Sep 2018 13:23:08 -0400 Subject: [PATCH 1/4] MusicPlus core: NOMIXER=1 compile fix --- src/sdl/sdl_sound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index 25c21a07a..d3b51b15e 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -1480,7 +1480,7 @@ void I_StopFadingSong(void) { } -boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void)); +boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void)) { (void)target_volume; (void)source_volume; @@ -1488,7 +1488,7 @@ boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms return false; } -boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void)); +boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void)) { (void)target_volume; (void)ms; From e4f48cfb71bbc24c173346e5290689765db30e6d Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 18 Sep 2018 14:08:31 -0400 Subject: [PATCH 2/4] MusicPlus core: Win32 DD compile fixes --- src/win32/win_snd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/win32/win_snd.c b/src/win32/win_snd.c index 85cae2ed1..543de3231 100644 --- a/src/win32/win_snd.c +++ b/src/win32/win_snd.c @@ -812,10 +812,10 @@ void I_SetMusicVolume(UINT8 volume) UINT32 I_GetSongLength() { - if (midimode) + if (I_SongType() == MU_MID) return 0; UINT32 length; - e = FMOD_Sound_GetLength(music_stream, length, FMOD_TIMEUNIT_MS); + FMR_MUSIC(FMOD_Sound_GetLength(music_stream, &length, FMOD_TIMEUNIT_MS)); return length; } @@ -832,7 +832,7 @@ UINT32 I_GetSongLoopPoint(void) boolean I_SetSongPosition(UINT32 position) { - if(midimode) + if(I_SongType() == MU_MID) // Dummy out; this works for some MIDI, but not others. // SDL does not support this for any MIDI. return false; @@ -852,7 +852,7 @@ boolean I_SetSongPosition(UINT32 position) UINT32 I_GetSongPosition(void) { - if(midimode) + if(I_SongType() == MU_MID) // Dummy out because unsupported, even though FMOD does this correctly. return 0; FMOD_RESULT e; @@ -922,7 +922,7 @@ void I_StopFadingSong(void) { } -boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void)); +boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void)) { (void)target_volume; (void)source_volume; @@ -930,7 +930,7 @@ boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms return false; } -boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void)); +boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void)) { (void)target_volume; (void)ms; From 0cfe0824b6c003afce5bca0d4495a09312ea155f Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 18 Sep 2018 15:10:42 -0400 Subject: [PATCH 3/4] Lua P_RestoreMusic else if fix --- src/lua_baselib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 6a8784259..093683660 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -719,7 +719,7 @@ static int lib_pRestoreMusic(lua_State *L) NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); - else if (P_IsLocalPlayer(player)) + if (P_IsLocalPlayer(player)) P_RestoreMusic(player); return 0; } From 00bbb60e69a4df5892b339cbbc985c9a337b2d5f Mon Sep 17 00:00:00 2001 From: mazmazz Date: Tue, 18 Sep 2018 22:15:53 -0400 Subject: [PATCH 4/4] Mixer: Add back var_cleanup in I_LoadSong Because musicplus-libopenmpt deleted it, I added a cautionary note to ALWAYS clean up your vars! --- src/sdl/mixer_sound.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index fbd587322..f966f531a 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -885,6 +885,7 @@ boolean I_LoadSong(char *data, size_t len) ) I_UnloadSong(); + // always do this whether or not a music already exists var_cleanup(); #ifdef HAVE_LIBGME