ref: 2b5de0bafc1ebe347e08617de7595c1ea507c0b9
parent: 2f67325278637a349bb86fa6fc388e527a75a5c9
author: Simon Howard <[email protected]>
date: Wed Nov 26 16:09:12 EST 2008
Add bindings for remaining missing config file variables, to get chocolate-setup functional again. Subversion-branch: /branches/raven-branch Subversion-revision: 1388
--- a/src/setup/display.c
+++ b/src/setup/display.c
@@ -74,6 +74,7 @@
static int screen_height = 200;
static int startup_delay = 1000;
static int show_endoom = 1;
+static int usegamma = 0;
// These are the last screen width/height values that were chosen by the
// user. These are used when finding the "nearest" mode, so when
@@ -446,6 +447,7 @@
M_BindVariable("screen_height", &screen_height);
M_BindVariable("startup_delay", &startup_delay);
M_BindVariable("video_driver", &video_driver);
+ M_BindVariable("usegamma", &usegamma);
// doom, heretic only:
M_BindVariable("show_endoom", &show_endoom);
--- a/src/setup/mainmenu.c
+++ b/src/setup/mainmenu.c
@@ -28,6 +28,7 @@
#include "m_argv.h"
#include "m_config.h"
+#include "m_controls.h"
#include "setup_icon.c"
@@ -39,12 +40,24 @@
#include "multiplayer.h"
#include "sound.h"
+// Miscellaneous variables that aren't used in setup.
+
+static int showMessages = 1;
+static int screenblocks = 9;
+static int detailLevel = 0;
+
+static void BindMiscVariables(void)
+{
+ M_BindVariable("show_messages", &showMessages);
+ M_BindVariable("screenblocks", &screenblocks);
+ M_BindVariable("detaillevel", &detailLevel);
+}
+
static void DoQuit(void *widget, void *dosave)
{
if (dosave != NULL)
{
- // DANGER: this is broken. Do not save.
-// M_SaveDefaults();
+ M_SaveDefaults();
}
exit(0);
@@ -141,6 +154,21 @@
{
SetChatMacroDefaults();
SetPlayerNameDefault();
+
+ // Keyboard, mouse, joystick controls
+
+ M_BindBaseControls();
+
+ // All other variables
+
+ BindCompatibilityVariables();
+ BindDisplayVariables();
+ BindJoystickVariables();
+ BindKeyboardVariables();
+ BindMouseVariables();
+ BindSoundVariables();
+ BindMiscVariables();
+ BindMultiplayerVariables();
M_SetConfigFilenames("default.cfg", "chocolate-doom.cfg");
M_SetConfigDir();
--- a/src/setup/multiplayer.c
+++ b/src/setup/multiplayer.c
@@ -18,6 +18,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -94,8 +95,8 @@
"Deathmatch 2.0",
};
-char *net_player_name;
-char *chat_macros[10];
+static char *net_player_name;
+static char *chat_macros[10];
static char *wads[NUM_WADS];
static char *extra_params[NUM_EXTRA_PARAMS];
@@ -745,5 +746,21 @@
}
TXT_AddWidget(window, table);
+}
+
+void BindMultiplayerVariables(void)
+{
+ char buf[15];
+ int i;
+
+#ifdef FEATURE_MULTIPLAYER
+ M_BindVariable("player_name", &net_player_name);
+#endif
+
+ for (i=0; i<10; ++i)
+ {
+ sprintf(buf, "chatmacro%i", i);
+ M_BindVariable(buf, &chat_macros[i]);
+ }
}
--- a/src/setup/multiplayer.h
+++ b/src/setup/multiplayer.h
@@ -22,9 +22,6 @@
#ifndef SETUP_MULTIPLAYER_H
#define SETUP_MULTIPLAYER_H
-extern char *net_player_name;
-extern char *chat_macros[10];
-
void StartMultiGame(void);
void JoinMultiGame(void);
void MultiplayerConfig(void);
@@ -31,6 +28,8 @@
void SetChatMacroDefaults(void);
void SetPlayerNameDefault(void);
+
+void BindMultiplayerVariables(void);
#endif /* #ifndef SETUP_MULTIPLAYER_H */
--- a/src/setup/sound.c
+++ b/src/setup/sound.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include "textscreen.h"
+#include "m_config.h"
#include "sound.h"
@@ -65,20 +66,29 @@
#define DEFAULT_MUSIC_DEVICE SNDDEVICE_SB
#endif
-int snd_sfxdevice = SNDDEVICE_SB;
-int numChannels = 8;
-int sfxVolume = 15;
+static int snd_sfxdevice = SNDDEVICE_SB;
+static int numChannels = 8;
+static int sfxVolume = 15;
-int snd_musicdevice = DEFAULT_MUSIC_DEVICE;
-int musicVolume = 15;
+static int snd_musicdevice = DEFAULT_MUSIC_DEVICE;
+static int musicVolume = 15;
-int snd_samplerate = 22050;
+static int snd_samplerate = 22050;
-int use_libsamplerate = 0;
+static int use_libsamplerate = 0;
static int snd_sfxmode;
static int snd_musicenabled;
+// DOS specific options: these are unused but should be maintained
+// so that the config file can be shared between chocolate
+// doom and doom.exe
+
+static int snd_sbport = 0;
+static int snd_sbirq = 0;
+static int snd_sbdma = 0;
+static int snd_mport = 0;
+
static void UpdateSndDevices(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(data))
{
switch (snd_sfxmode)
@@ -163,5 +173,21 @@
TXT_SignalConnect(music_enabled_control, "changed",
UpdateSndDevices, NULL);
+}
+
+void BindSoundVariables(void)
+{
+ M_BindVariable("snd_sfxdevice", &snd_sfxdevice);
+ M_BindVariable("snd_musicdevice", &snd_musicdevice);
+ M_BindVariable("snd_channels", &numChannels);
+ M_BindVariable("sfx_volume", &sfxVolume);
+ M_BindVariable("music_volume", &musicVolume);
+ M_BindVariable("snd_samplerate", &snd_samplerate);
+ 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);
}
--- a/src/setup/sound.h
+++ b/src/setup/sound.h
@@ -22,18 +22,8 @@
#ifndef SETUP_SOUND_H
#define SETUP_SOUND_H
-extern int snd_sfxdevice;
-extern int numChannels;
-extern int sfxVolume;
-
-extern int snd_musicdevice;
-extern int musicVolume;
-
-extern int snd_samplerate;
-
-extern int use_libsamplerate;
-
void ConfigSound(void);
+void BindSoundVariables(void);
#endif /* #ifndef SETUP_SOUND_H */