From 0511e3bcbff821a1d8945e82307af4bc46710892 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Fri, 12 Aug 2005 17:57:22 +0000 Subject: [PATCH] don't crash using -soundspeed git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1226 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/snd_dma.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/engine/client/snd_dma.c b/engine/client/snd_dma.c index dcbe94167..301e062fd 100644 --- a/engine/client/snd_dma.c +++ b/engine/client/snd_dma.c @@ -505,27 +505,9 @@ void S_Init (void) } Con_DPrintf("\nSound Initialization\n"); - if (COM_CheckParm("-nosound")) - { - Cvar_Register(&nosound, "Sound controls"); - Cvar_ForceSet(&nosound, "1"); - nosound.flags |= CVAR_NOSET; - return; - } - // if (COM_CheckParm("-simsound")) // fakedma = true; - p = COM_CheckParm ("-soundspeed"); - if (p) - { - if (p < com_argc-1) - Cvar_SetValue(&snd_khz, atof(com_argv[p+1])/1000); - else - Sys_Error ("S_Init: you must specify a speed in KB after -soundspeed"); - } - - Cmd_AddCommand("play", S_Play); Cmd_AddCommand("play2", S_Play); Cmd_AddCommand("playvol", S_PlayVol); @@ -560,6 +542,21 @@ void S_Init (void) Cvar_Register(&snd_playersoundvolume, "Sound controls"); Cvar_Register(&snd_usemultipledevices, "Sound controls"); + if (COM_CheckParm("-nosound")) + { + Cvar_ForceSet(&nosound, "1"); + nosound.flags |= CVAR_NOSET; + return; + } + + p = COM_CheckParm ("-soundspeed"); + if (p) + { + if (p < com_argc-1) + Cvar_SetValue(&snd_khz, atof(com_argv[p+1])/1000); + else + Sys_Error ("S_Init: you must specify a speed in KB after -soundspeed"); + } if (COM_CheckParm ("-nomultipledevices") || COM_CheckParm ("-singlesound")) Cvar_SetValue(&snd_usemultipledevices, 0); @@ -574,8 +571,6 @@ void S_Init (void) Con_Printf ("loading all sounds as 8bit\n"); } - - snd_initialized = true; SND_InitScaletable ();