From 8a82c6047065d4a2ac64703b790014977d2c2fc5 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 1 Aug 2025 04:46:29 +0200 Subject: [PATCH] we dont need cv_samplerate with sdl mixer --- src/i_sound.h | 3 ++- src/s_sound.c | 4 ++++ src/sdl/sdl_sound.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/i_sound.h b/src/i_sound.h index dbfa86b30..aaac492c6 100644 --- a/src/i_sound.h +++ b/src/i_sound.h @@ -43,8 +43,9 @@ extern UINT8 sound_started; /** \brief info of samplerate */ +#if defined(HAVE_SDL) && SOUND==SOUND_SDL extern consvar_t cv_samplerate; -//extern consvar_t cv_rndsoundpitch; +#endif /** \brief The I_GetSfx function diff --git a/src/s_sound.c b/src/s_sound.c index 96aacbf49..f104572ea 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -59,7 +59,9 @@ static void AmigaType_OnChange(void); #endif #endif +#if defined(HAVE_SDL) && SOUND==SOUND_SDL consvar_t cv_samplerate = {"samplerate", "44100", 0, CV_Unsigned, NULL, 22050, NULL, NULL, 0, 0, NULL}; //Alam: For easy hacking? +#endif static CV_PossibleValue_t audbuffersize_cons_t[] = {{128, "128"}, {256, "256"}, {512, "512"}, {1024, "1024"}, {2048, "2048"}, {4096, "4096"}, {0, NULL}}; consvar_t cv_audbuffersize = {"audiobuffersize", "2048", CV_SAVE, audbuffersize_cons_t, BufferSize_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -277,7 +279,9 @@ void S_RegisterSoundStuff(void) CV_RegisterVar(&stereoreverse); CV_RegisterVar(&precachesound); +#if defined(HAVE_SDL) && SOUND==SOUND_SDL CV_RegisterVar(&cv_samplerate); +#endif //CV_RegisterVar(&cv_resetmusic); CV_RegisterVar(&cv_gamesounds); CV_RegisterVar(&cv_gamedigimusic); diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index 58aa5ee91..07f81d7b7 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -1079,7 +1079,7 @@ void I_StartupSound(void) { #ifndef HAVE_MIXER #ifndef NO_MIDI - midi_disabled = + midi_disabled = #endif digital_disabled = true; #endif