diff options
author | Simon Howard | 2006-10-24 19:58:39 +0000 |
---|---|---|
committer | Simon Howard | 2006-10-24 19:58:39 +0000 |
commit | 5f96cc7fdc463b695419d0589b1d19fe38e6efe6 (patch) | |
tree | 98a0acbaa7022acd035b07ca3f4512c0c036958e | |
parent | 4a31b4fbbaaf716b45403698e8c0b5dd523d0f47 (diff) | |
download | chocolate-doom-5f96cc7fdc463b695419d0589b1d19fe38e6efe6.tar.gz chocolate-doom-5f96cc7fdc463b695419d0589b1d19fe38e6efe6.tar.bz2 chocolate-doom-5f96cc7fdc463b695419d0589b1d19fe38e6efe6.zip |
Pass through config variables into response file when launching Doom.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 731
-rw-r--r-- | setup/execute.c | 20 | ||||
-rw-r--r-- | setup/execute.h | 1 | ||||
-rw-r--r-- | setup/mainmenu.c | 1 | ||||
-rw-r--r-- | setup/multiplayer.c | 3 |
4 files changed, 25 insertions, 0 deletions
diff --git a/setup/execute.c b/setup/execute.c index 5e78970a..b2933c9a 100644 --- a/setup/execute.c +++ b/setup/execute.c @@ -29,6 +29,7 @@ #include "textscreen.h" #include "execute.h" +#include "m_argv.h" struct execute_context_s { @@ -59,6 +60,25 @@ execute_context_t *NewExecuteContext(void) return result; } +void AddConfigParameters(execute_context_t *context) +{ + int p; + + p = M_CheckParm("-config"); + + if (p > 0) + { + AddCmdLineParameter(context, "-config \"%s\"", myargv[p + 1]); + } + + p = M_CheckParm("-extraconfig"); + + if (p > 0) + { + AddCmdLineParameter(context, "-extraconfig \"%s\"", myargv[p + 1]); + } +} + void AddCmdLineParameter(execute_context_t *context, char *s, ...) { va_list args; diff --git a/setup/execute.h b/setup/execute.h index d7d7e6a8..8c373bf6 100644 --- a/setup/execute.h +++ b/setup/execute.h @@ -28,6 +28,7 @@ typedef struct execute_context_s execute_context_t; execute_context_t *NewExecuteContext(void); void AddCmdLineParameter(execute_context_t *context, char *s, ...); +void AddConfigParameters(execute_context_t *context); void ExecuteDoom(execute_context_t *context); txt_window_action_t *TestConfigAction(void); diff --git a/setup/mainmenu.c b/setup/mainmenu.c index 612c649d..7fcd3e4f 100644 --- a/setup/mainmenu.c +++ b/setup/mainmenu.c @@ -88,6 +88,7 @@ static void LaunchDoom(void *unused1, void *unused2) // Launch Doom exec = NewExecuteContext(); + AddConfigParameters(exec); ExecuteDoom(exec); exit(0); diff --git a/setup/multiplayer.c b/setup/multiplayer.c index 9980cd34..f22b07c2 100644 --- a/setup/multiplayer.c +++ b/setup/multiplayer.c @@ -165,6 +165,7 @@ static void StartGame(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(user_data)) TXT_Shutdown(); M_SaveDefaults(); + AddConfigParameters(exec); ExecuteDoom(exec); @@ -401,6 +402,8 @@ static void DoJoinGame(void *unused1, void *unused2) M_SaveDefaults(); + AddConfigParameters(exec); + ExecuteDoom(exec); exit(0); |