diff options
author | Simon Howard | 2008-10-08 18:47:13 +0000 |
---|---|---|
committer | Simon Howard | 2008-10-08 18:47:13 +0000 |
commit | d4d0f9945cefdb86241b5bd095e82ddbfca0e134 (patch) | |
tree | 177a0c2415b26b3b16077993399760de417190c7 /src/hexen/h2_main.c | |
parent | dc7d72797f1d6810b8ba2f8472f6828f1f714df6 (diff) | |
download | chocolate-doom-d4d0f9945cefdb86241b5bd095e82ddbfca0e134.tar.gz chocolate-doom-d4d0f9945cefdb86241b5bd095e82ddbfca0e134.tar.bz2 chocolate-doom-d4d0f9945cefdb86241b5bd095e82ddbfca0e134.zip |
Switch configuration file code to common configuration file code, and
remove old code.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1338
Diffstat (limited to 'src/hexen/h2_main.c')
-rw-r--r-- | src/hexen/h2_main.c | 41 |
1 files changed, 37 insertions, 4 deletions
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 <stdio.h> #include <stdlib.h> #include <time.h> + +#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"); |