From 1dd3ecd6e2ab9ea5db9b42acaa1ad4fa8e9c49d2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 28 Aug 2010 13:36:41 +0000 Subject: [PATCH] - fixed: -nosfx deactivated the entire sound system which also made music inoperable. Changed it so that all it does is block sound effects from being started. SVN r2621 (trunk) --- src/s_sound.cpp | 2 +- src/sound/i_sound.cpp | 4 +++- src/sound/i_sound.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 40be1b927c..8d64241690 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -827,7 +827,7 @@ static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyO FVector3 pos, vel; FRolloffInfo *rolloff; - if (sound_id <= 0 || volume <= 0) + if (sound_id <= 0 || volume <= 0 || nosfx) return NULL; int type; diff --git a/src/sound/i_sound.cpp b/src/sound/i_sound.cpp index b25bbd6fbf..0a946b3c18 100644 --- a/src/sound/i_sound.cpp +++ b/src/sound/i_sound.cpp @@ -81,6 +81,7 @@ CVAR (String, snd_output, "default", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, snd_pitched, false, CVAR_ARCHIVE) SoundRenderer *GSnd; +bool nosfx; void I_CloseSound (); @@ -234,7 +235,8 @@ public: void I_InitSound () { /* Get command line options: */ - bool nosound = !!Args->CheckParm ("-nosfx") || !!Args->CheckParm ("-nosound"); + bool nosound = !!Args->CheckParm ("-nosound"); + nosfx = !!Args->CheckParm ("-nosfx"); if (nosound) { diff --git a/src/sound/i_sound.h b/src/sound/i_sound.h index d8cf166fc5..e5edcbb400 100644 --- a/src/sound/i_sound.h +++ b/src/sound/i_sound.h @@ -143,6 +143,7 @@ public: }; extern SoundRenderer *GSnd; +extern bool nosfx; void I_InitSound (); void I_ShutdownSound ();