foxygit / doom Log in
commit 5412004bfa32864c1034e81ee7b093d8887850f5
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Thu Mar 27 21:39:34 2014 -0400
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Thu Mar 27 21:39:34 2014 -0400

    setup: Make default sound volumes match Vanilla.

    Doom, Heretic, Hexen and Strife have different default SFX and music
    volumes. Make sure the setup tool sets the appropriate default when
    creating a new configuration file.

    Thanks to Alexandre-Xavier for reporting this and providing the
    correct defaults. This fixes #347.
---
 src/setup/sound.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/setup/sound.c b/src/setup/sound.c
index f1603e84..9ce6757c 100644
--- a/src/setup/sound.c
+++ b/src/setup/sound.c
@@ -78,8 +78,8 @@ int snd_maxslicetime_ms = 28;
 char *snd_musiccmd = "";

 static int numChannels = 8;
-static int sfxVolume = 15;
-static int musicVolume = 15;
+static int sfxVolume = 8;
+static int musicVolume = 8;
 static int voiceVolume = 15;
 static int show_talk = 0;
 static int use_libsamplerate = 0;
@@ -334,6 +334,23 @@ void BindSoundVariables(void)
     timidity_cfg_path = strdup("");
     gus_patch_path = strdup("");

+    // Default sound volumes - different games use different values.
+
+    switch (gamemission)
+    {
+        case doom:
+        default:
+            sfxVolume = 8;  musicVolume = 8;
+            break;
+        case heretic:
+        case hexen:
+            sfxVolume = 10; musicVolume = 10;
+            break;
+        case strife:
+            sfxVolume = 8;  musicVolume = 13;
+            break;
+    }
+
     // Before SDL_mixer version 1.2.11, MIDI music caused the game
     // to crash when it looped.  If this is an old SDL_mixer version,
     // disable MIDI.