shithub: choc

Download patch

ref: 5f96cc7fdc463b695419d0589b1d19fe38e6efe6
parent: 4a31b4fbbaaf716b45403698e8c0b5dd523d0f47
author: Simon Howard <[email protected]>
date: Tue Oct 24 15:58:39 EDT 2006

Pass through config variables into response file when launching Doom.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 731

--- 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
 {
@@ -57,6 +58,25 @@
     }
     
     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, ...)
--- a/setup/execute.h
+++ b/setup/execute.h
@@ -28,6 +28,7 @@
 
 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);
--- a/setup/mainmenu.c
+++ b/setup/mainmenu.c
@@ -88,6 +88,7 @@
     // Launch Doom
 
     exec = NewExecuteContext();
+    AddConfigParameters(exec);
     ExecuteDoom(exec);
 
     exit(0);
--- a/setup/multiplayer.c
+++ b/setup/multiplayer.c
@@ -165,6 +165,7 @@
     TXT_Shutdown();
     
     M_SaveDefaults();
+    AddConfigParameters(exec);
 
     ExecuteDoom(exec);
 
@@ -400,6 +401,8 @@
     TXT_Shutdown();
     
     M_SaveDefaults();
+
+    AddConfigParameters(exec);
 
     ExecuteDoom(exec);