From 1c2480c764bfcf689600df96d8f23b07ede02121 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Mon, 4 Aug 2014 14:58:41 -0600 Subject: [PATCH] validate snd_filterquality --- Quake/snd_dma.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Quake/snd_dma.c b/Quake/snd_dma.c index 99dd0dc0..ff7f2865 100644 --- a/Quake/snd_dma.c +++ b/Quake/snd_dma.c @@ -118,6 +118,14 @@ static void SND_Callback_sfxvolume (cvar_t *var) SND_InitScaletable (); } +static void SND_Callback_snd_filterquality (cvar_t *var) +{ + if (snd_filterquality.value < 1 || snd_filterquality.value > 5) + { + Con_Printf ("snd_filterquality must be between 1 and 5\n"); + Cvar_SetQuick (&snd_filterquality, SND_FILTERQUALITY_DEFAULT); + } +} /* ================ @@ -204,6 +212,7 @@ void S_Init (void) } Cvar_SetCallback(&sfxvolume, SND_Callback_sfxvolume); + Cvar_SetCallback(&snd_filterquality, &SND_Callback_snd_filterquality); SND_InitScaletable ();