From 17875bee39333e890dfc0aef30e95702f5a45c6f Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 10 Mar 2007 07:22:32 +0000 Subject: [PATCH] move the handling of -nosound out of the plugin so it can control loading of the plugin --- libs/audio/renderer/snd_dma.c | 6 ------ libs/audio/snd.c | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/audio/renderer/snd_dma.c b/libs/audio/renderer/snd_dma.c index 315a0f431..6d0ff502e 100644 --- a/libs/audio/renderer/snd_dma.c +++ b/libs/audio/renderer/snd_dma.c @@ -55,8 +55,6 @@ static __attribute__ ((used)) const char rcsid[] = #include "snd_render.h" -// Internal sound data & structures =========================================== - volatile dma_t *snd_shm = 0; unsigned int snd_paintedtime; // sample PAIRS @@ -942,9 +940,6 @@ s_init (void) snd_volumesep = Cvar_Get ("snd_volumesep", "1.0", CVAR_ARCHIVE, NULL, "max stereo volume separation. 1.0 is max"); - if (COM_CheckParm ("-nosound")) - return; - if (COM_CheckParm ("-simsound")) fakedma = true; @@ -993,7 +988,6 @@ s_init (void) QFS_GamedirCallback (s_gamedir); } -// Shutdown sound engine ====================================================== static void s_shutdown (void) { diff --git a/libs/audio/snd.c b/libs/audio/snd.c index 80d7bdc83..0966922c4 100644 --- a/libs/audio/snd.c +++ b/libs/audio/snd.c @@ -59,6 +59,9 @@ static plugin_list_t snd_render_list[] = { void S_Init (struct model_s **worldmodel, int *viewentity, double *host_frametime) { + if (COM_CheckParm ("-nosound")) + return; + if (!*snd_output->string || !*snd_render->string) { Sys_Printf ("Not loading sound due to no renderer/output\n"); return;