From c927d333bdbff26302744d599a5fb0b6a787a35d Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 12 Oct 2024 19:39:52 +0200 Subject: [PATCH] readd music_resync_powerups_only --- src/m_menu.c | 1 + src/p_spec.c | 4 +--- src/s_sound.c | 2 ++ src/s_sound.h | 1 + src/sdl/mixer_sound.c | 4 +++- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 7d860fb8d..2c102d815 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2584,6 +2584,7 @@ static menuitem_t OP_AdvancedBirdMenu[] = {IT_STRING | IT_CVAR, NULL, "Fade Back In While Respawning", &cv_respawnfademusicback, 40}, {IT_STRING | IT_CVAR, NULL, "Resync Threshold", &cv_music_resync_threshold, 60}, + {IT_STRING | IT_CVAR, NULL, "Resync Special Music Only", &cv_music_resync_powerups_only, 70}, }; static const char* OP_AdvancedBirdTooltips[] = diff --git a/src/p_spec.c b/src/p_spec.c index 132d50efe..4fa2b0fb2 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2192,9 +2192,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) mapmusflags |= MUSIC_FORCERESET; mapmusposition = position; - - if (cv_birdmusic.value) - mapmusresume = 0; + mapmusresume = 0; S_ChangeMusicEx(mapmusname, mapmusflags, !(line->flags & ML_EFFECT4), position, !(line->flags & ML_EFFECT2) ? prefadems : 0, diff --git a/src/s_sound.c b/src/s_sound.c index ce0c41518..c635830bd 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -108,6 +108,7 @@ static CV_PossibleValue_t music_resync_threshold_cons_t[] = { {0} }; consvar_t cv_music_resync_threshold = {"music_resync_threshold", "0", CV_SAVE|CV_CALL, music_resync_threshold_cons_t, I_UpdateSongLagThreshold, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_music_resync_powerups_only = {"music_resync_powerups_only", "No", CV_SAVE|CV_CALL, CV_YesNo, I_UpdateSongLagThreshold, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_invincmusicfade = {"invincmusicfade", "300", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_growmusicfade = {"growmusicfade", "500", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -290,6 +291,7 @@ void S_RegisterSoundStuff(void) CV_RegisterVar(&cv_pausemusic); CV_RegisterVar(&cv_music_resync_threshold); + CV_RegisterVar(&cv_music_resync_powerups_only); CV_RegisterVar(&cv_invincmusicfade); CV_RegisterVar(&cv_growmusicfade); diff --git a/src/s_sound.h b/src/s_sound.h index 4231d9634..56f545486 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -54,6 +54,7 @@ extern consvar_t cv_amigatype; //bird music stuff extern consvar_t cv_music_resync_threshold; +extern consvar_t cv_music_resync_powerups_only; extern consvar_t cv_invincmusicfade; extern consvar_t cv_growmusicfade; diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 21f5fb553..5c4e947b7 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -93,6 +93,8 @@ static UINT16 SAMPLERATE = 44100; /// ------------------------ UINT8 sound_started = false; + +static UINT32 stutter_threshold_user; static UINT32 stutter_threshold; static Mix_Music *music; @@ -1046,7 +1048,7 @@ void I_UpdateSongLagThreshold (void) if (!cv_birdmusic.value) return; - stutter_threshold = cv_music_resync_threshold.value/1000.0*(4*44100); + stutter_threshold = cv_music_resync_powerups_only.value ? 0 : (cv_music_resync_threshold.value/1000.0*(4*44100)); } /// ------------------------