ref: 9981c42b4a8ab3000b22b9acf6ad4b0edd4b0ae7
parent: bc8517a05648054df17e556d4116e63a20fef75a
author: Simon Howard <[email protected]>
date: Tue Mar 25 18:39:51 EDT 2014
Set GUS patch path variable using D_SetVariable. commit 42faefce1fd03 added code to set the GUS patch path automatically when the BFG Edition is installed, but this caused problems because gusconf.c is not included as part of the build for the setup tool. Use D_SetVariable() instead which accomplishes the same thing without a hard dependency.
--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -32,7 +32,6 @@
#include "deh_str.h"
#include "doomkeys.h"
#include "d_iwad.h"
-#include "gusconf.h"
#include "i_system.h"
#include "m_argv.h"
#include "m_config.h"
@@ -336,12 +335,14 @@
static void CheckSteamGUSPatches(void)
{
+ const char *current_path;
char *install_path;
char *patch_path;
int len;
// Already configured? Don't stomp on the user's choices.
- if (gus_patch_path != NULL && strlen(gus_patch_path) > 0)
+ current_path = D_GetStrVariable("gus_patch_path");
+ if (current_path != NULL && strlen(current_path) > 0)
{
return;
}
@@ -363,13 +364,10 @@
{
snprintf(patch_path, len, "%s\\%s",
install_path, STEAM_BFG_GUS_PATCHES);
- gus_patch_path = patch_path;
+ D_SetVariable("gus_patch_path", patch_path);
}
- else
- {
- free(patch_path);
- }
+ free(patch_path);
free(install_path);
}
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -1156,18 +1156,6 @@
DEH_Init();
#endif
- iwadfile = D_FindIWAD(IWAD_MASK_DOOM, &gamemission);
-
- // None found?
-
- if (iwadfile == NULL)
- {
- I_Error("Game mode indeterminate. No IWAD file was found. Try\n"
- "specifying one with the '-iwad' command line parameter.\n");
- }
-
- modifiedgame = false;
-
//!
// @vanilla
//
@@ -1292,6 +1280,19 @@
// Save configuration at exit.
I_AtExit(M_SaveDefaults, false);
+
+ // Find main IWAD file and load it.
+ iwadfile = D_FindIWAD(IWAD_MASK_DOOM, &gamemission);
+
+ // None found?
+
+ if (iwadfile == NULL)
+ {
+ I_Error("Game mode indeterminate. No IWAD file was found. Try\n"
+ "specifying one with the '-iwad' command line parameter.\n");
+ }
+
+ modifiedgame = false;
DEH_printf("W_Init: Init WADfiles.\n");
D_AddFile(iwadfile);
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -1394,18 +1394,6 @@
DEH_Init();
#endif
- iwadfile = D_FindIWAD(IWAD_MASK_STRIFE, &gamemission);
-
- // None found?
-
- if (iwadfile == NULL)
- {
- I_Error("Game mode indeterminate. No IWAD file was found. Try\n"
- "specifying one with the '-iwad' command line parameter.\n");
- }
-
- modifiedgame = false;
-
//!
// @vanilla
//
@@ -1550,6 +1538,18 @@
// Save configuration at exit.
I_AtExit(M_SaveDefaults, false);
+
+ // Find the main IWAD file and load it.
+ iwadfile = D_FindIWAD(IWAD_MASK_STRIFE, &gamemission);
+
+ // None found?
+ if (iwadfile == NULL)
+ {
+ I_Error("Game mode indeterminate. No IWAD file was found. Try\n"
+ "specifying one with the '-iwad' command line parameter.\n");
+ }
+
+ modifiedgame = false;
if(devparm) // [STRIFE] Devparm only
DEH_printf("W_Init: Init WADfiles.\n");