From de47ab63f21982cf4e7388e4c17183cf5fa4ba21 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 19 Sep 2018 19:18:35 -0400 Subject: [PATCH 1/4] MP Core Mixer fade: Use fixed instead of double calc (fixes buildbots) --- src/sdl/mixer_sound.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index b52d0fa9f..8dc1bb48e 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -565,11 +565,11 @@ static UINT32 music_fade(UINT32 interval, void *param) else { UINT8 delta = abs(fading_target - fading_source); - double factor = (double)(fading_duration - fading_timer) / (double)fading_duration; + fixed_t factor = FixedDiv(fading_duration - fading_timer, fading_duration); if (fading_target < fading_source) - internal_volume = max(min(internal_volume, fading_source - (UINT8)round(delta * factor)), fading_target); + internal_volume = max(min(internal_volume, fading_source - FixedMul(delta, factor)), fading_target); else if (fading_target > fading_source) - internal_volume = min(max(internal_volume, fading_source + (UINT8)round(delta * factor)), fading_target); + internal_volume = min(max(internal_volume, fading_source + FixedMul(delta, factor)), fading_target); Mix_VolumeMusic(get_real_volume(music_volume)); return interval; } From 49c678d2e9a0f8aff6d0fbb6bdbb7a9b11ed80c1 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 19 Sep 2018 19:19:18 -0400 Subject: [PATCH 2/4] MP Core s_sound: Mixed D+C fix (buildbots) --- src/s_sound.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/s_sound.c b/src/s_sound.c index 864af7165..b3625261e 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1557,10 +1557,11 @@ static void S_ChangeMusicToQueue(void) void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 position, UINT32 prefadems, UINT32 fadeinms) { + char newmusic[7]; + if (S_MusicDisabled()) return; - char newmusic[7]; strncpy(newmusic, mmusic, 7); #if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS) if(LUAh_MusicChange(music_name, newmusic, &mflags, &looping, &position, &prefadems, &fadeinms)) From 37addc02e663b37f784676de79ddaacbc9e9f669 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 19 Sep 2018 19:06:24 -0400 Subject: [PATCH 3/4] MP Core Mixer: Old-style function dec fixes (buildbots) --- src/sdl/mixer_sound.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 8dc1bb48e..6782d8ba6 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -506,7 +506,7 @@ static UINT32 get_adjusted_position(UINT32 position) return position; } -static void do_fading_callback() +static void do_fading_callback(void) { if (fading_callback) (*fading_callback)(); @@ -1170,7 +1170,7 @@ void I_StopSong(void) var_cleanup(); } -void I_PauseSong() +void I_PauseSong(void) { if(I_SongType() == MU_MID) // really, SDL Mixer? why can't you pause MIDI??? return; @@ -1182,7 +1182,7 @@ void I_PauseSong() songpaused = true; } -void I_ResumeSong() +void I_ResumeSong(void) { if (I_SongType() == MU_MID) return; From 7084fc89bda65e29447d866f1afb59367b52a2f4 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Wed, 19 Sep 2018 19:46:57 -0400 Subject: [PATCH 4/4] MP Core s_sound: I_FadeSongFromVolume call fix (buildbots) --- src/s_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_sound.c b/src/s_sound.c index b3625261e..2bf60b087 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1716,7 +1716,7 @@ boolean S_FadeMusicFromVolume(UINT8 target_volume, INT16 source_volume, UINT32 m if (source_volume < 0) return I_FadeSong(target_volume, ms, NULL); else - return I_FadeSongFromVolume(target_volume, source_volume, ms, false); + return I_FadeSongFromVolume(target_volume, source_volume, ms, NULL); } boolean S_FadeOutStopMusic(UINT32 ms)