From d4d0f9945cefdb86241b5bd095e82ddbfca0e134 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 8 Oct 2008 18:47:13 +0000 Subject: Switch configuration file code to common configuration file code, and remove old code. Subversion-branch: /branches/raven-branch Subversion-revision: 1338 --- src/hexen/h2_main.c | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) (limited to 'src/hexen/h2_main.c') diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index e82f26e3..9d83a7da 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -32,16 +32,21 @@ #include #include #include + +#include "config.h" + #include "h2def.h" +#include "ct_chat.h" #include "s_sound.h" #include "i_system.h" #include "m_argv.h" +#include "m_config.h" +#include "m_controls.h" #include "p_local.h" #include "v_video.h" // MACROS ------------------------------------------------------------------ -#define CONFIG_FILE_NAME "hexen.cfg" #define MAXWADFILES 20 // TYPES ------------------------------------------------------------------- @@ -141,6 +146,34 @@ static execOpt_t ExecOptions[] = { // CODE -------------------------------------------------------------------- +void D_BindVariables(void) +{ + int i; + + I_BindVariables(); + M_BindBaseControls(); + M_BindHereticControls(); + M_BindHexenControls(); + + M_BindVariable("mouse_sensitivity", &mouseSensitivity); + M_BindVariable("sfx_volume", &snd_MaxVolume); + M_BindVariable("music_volume", &snd_MusicVolume); + M_BindVariable("messageson", &messageson); + M_BindVariable("screenblocks", &screenblocks); + M_BindVariable("snd_channels", &snd_Channels); + M_BindVariable("savedir", &SavePath); + + // Multiplayer chat macros + + for (i=0; i<10; ++i) + { + char buf[12]; + + sprintf(buf, "chatmacro%i", i); + M_BindVariable(buf, &chat_macros[i]); + } +} + //========================================================================== // // H2_Main @@ -169,7 +202,9 @@ void D_DoomMain(void) // Load defaults before initing other systems ST_Message("M_LoadDefaults: Load system defaults.\n"); - M_LoadDefaults(CONFIG_FILE_NAME); + D_BindVariables(); + M_SetConfigFilenames("hexen.cfg", PROGRAM_PREFIX "hexen.cfg"); + M_LoadDefaults(); // Now that the savedir is loaded from .CFG, make sure it exists CreateSavePath(); @@ -217,8 +252,6 @@ void D_DoomMain(void) S_StartSongName("orb", true); // Show version message now, so it's visible during R_Init() - ST_Message("Executable: " VERSIONTEXT ".\n"); - ST_Message("R_Init: Init Hexen refresh daemon"); R_Init(); ST_Message("\n"); -- cgit v1.2.3