shithub: choc

Download patch

ref: 07c997d600f3242503b3ae3e7505ed3318aa41ea
parent: 5ac790ac6430c6b353909caf43194888f2d4adb3
author: Simon Howard <[email protected]>
date: Tue Sep 7 14:15:06 EDT 2010

Bind appropriate configuration values for Strife in setup tool, and add
corresponding options to menus.

Subversion-branch: /branches/strife-branch
Subversion-revision: 2036

--- a/src/setup/keyboard.c
+++ b/src/setup/keyboard.c
@@ -39,11 +39,13 @@
 
 static int *controls[] = { &key_left, &key_right, &key_up, &key_down,
                            &key_strafeleft, &key_straferight, &key_fire,
-                           &key_use, &key_strafe, &key_speed, &key_jump, 
+                           &key_use, &key_strafe, &key_speed, &key_jump,
                            &key_flyup, &key_flydown, &key_flycenter,
                            &key_lookup, &key_lookdown, &key_lookcenter,
-                           &key_invleft, &key_invright, &key_useartifact,
-                           &key_pause,
+                           &key_invleft, &key_invright, &key_invquery,
+                           &key_invuse, &key_invpop, &key_invkey,
+                           &key_invhome, &key_invend, &key_invdrop,
+                           &key_useartifact, &key_pause, &key_usehealth,
                            &key_weapon1, &key_weapon2, &key_weapon3,
                            &key_weapon4, &key_weapon5, &key_weapon6,
                            &key_weapon7, &key_weapon8,
@@ -172,7 +174,9 @@
     txt_window_t *window;
     txt_scrollpane_t *scrollpane;
     txt_table_t *table;
-    boolean extra_keys = gamemission == heretic || gamemission == hexen;
+    boolean extra_keys = gamemission == heretic
+                      || gamemission == hexen
+                      || gamemission == strife;
 
     window = TXT_NewWindow("Extra keyboard controls");
 
@@ -203,7 +207,23 @@
 
         AddKeyControl(table, "Inventory left", &key_invleft);
         AddKeyControl(table, "Inventory right", &key_invright);
-        AddKeyControl(table, "Use artifact", &key_useartifact);
+
+        if (gamemission == strife)
+        {
+            AddKeyControl(table, "Home", &key_invhome);
+            AddKeyControl(table, "End", &key_invend);
+            AddKeyControl(table, "Query", &key_invquery);
+            AddKeyControl(table, "Drop", &key_invdrop);
+            AddKeyControl(table, "PopWeap", &key_invpop);
+            AddKeyControl(table, "PopMiss", &key_mission);
+            AddKeyControl(table, "PopKey", &key_invkey);
+            AddKeyControl(table, "Use", &key_invuse);
+            AddKeyControl(table, "Use health", &key_usehealth);
+        }
+        else
+        {
+            AddKeyControl(table, "Use artifact", &key_useartifact);
+        }
     }
     else
     {
--- a/src/setup/mode.c
+++ b/src/setup/mode.c
@@ -112,6 +112,7 @@
 static int detailLevel = 0;
 static char *savedir = NULL;
 static char *executable = NULL;
+static char *back_flat = "F_PAVE01";
 
 static void BindMiscVariables(void)
 {
@@ -128,6 +129,11 @@
         M_BindVariable("savedir",           &savedir);
         M_BindVariable("messageson",        &showMessages);
     }
+
+    if (gamemission == strife)
+    {
+        M_BindVariable("back_flat",         &back_flat);
+    }
 }
 
 //
@@ -153,6 +159,11 @@
     if (gamemission == hexen)
     {
         M_BindHexenControls();
+    }
+
+    if (gamemission == strife)
+    {
+        M_BindStrifeControls();
     }
 
     // All other variables
--- a/src/setup/sound.c
+++ b/src/setup/sound.c
@@ -71,6 +71,7 @@
 static int numChannels = 8;
 static int sfxVolume = 15;
 static int musicVolume = 15;
+static int voiceVolume = 15;
 static int use_libsamplerate = 0;
 
 // DOS specific variables: these are unused but should be maintained
@@ -200,6 +201,14 @@
                    TXT_NewSpinControl(&sfxVolume, 0, 15),
                    NULL);
 
+    if (gamemission == strife)
+    {
+        TXT_AddWidgets(sfx_table,
+                       TXT_NewLabel("Voice volume"),
+                       TXT_NewSpinControl(&voiceVolume, 0, 15),
+                       NULL);
+    }
+
     TXT_SetColumnWidths(music_table, 20, 5);
 
     TXT_AddWidgets(music_table,
@@ -227,9 +236,14 @@
     M_BindVariable("use_libsamplerate",   &use_libsamplerate);
 
     M_BindVariable("snd_sbport",          &snd_sbport);
-    M_BindVariable("snd_sbirq",          &snd_sbirq);
-    M_BindVariable("snd_sbdma",          &snd_sbdma);
-    M_BindVariable("snd_mport",          &snd_mport);
+    M_BindVariable("snd_sbirq",           &snd_sbirq);
+    M_BindVariable("snd_sbdma",           &snd_sbdma);
+    M_BindVariable("snd_mport",           &snd_mport);
+
+    if (gamemission == strife)
+    {
+        M_BindVariable("voice_volume",   &voiceVolume);
+    }
 
     // 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,