diff --git a/src/d_main.cpp b/src/d_main.cpp index b886d177e..4a28b40f6 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -227,6 +227,7 @@ CUSTOM_CVAR (String, vid_cursor, "None", CVAR_ARCHIVE | CVAR_NOINITCALL) CVAR (Bool, disableautoload, false, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG) CVAR (Bool, autoloadbrightmaps, false, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG) CVAR (Bool, autoloadlights, false, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG) +CVAR (Bool, autoloadwidescreen, true, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG) CVAR (Bool, r_debug_disable_vis_filter, false, 0) bool wantToRestart; @@ -2000,6 +2001,11 @@ static FString ParseGameInfo(TArray &pwads, const char *fn, const char sc.MustGetNumber(); DoomStartupInfo.LoadBrightmaps = !!sc.Number; } + else if (!nextKey.CompareNoCase("LOADWIDESCREEN")) + { + sc.MustGetNumber(); + DoomStartupInfo.LoadWidescreen = !!sc.Number; + } else { // Silently ignore unknown properties @@ -2161,6 +2167,12 @@ static void AddAutoloadFiles(const char *autoname) if (bmwad) D_AddFile (allwads, bmwad); } + if (DoomStartupInfo.LoadWidescreen == 1 || (DoomStartupInfo.LoadWidescreen != 0 && autoloadwidescreen)) + { + const char *wswad = BaseFileSearch ("game_widescreen_gfx.pk3", NULL); + if (wswad) + D_AddFile (allwads, wswad); + } } if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload") && !disableautoload) @@ -3008,7 +3020,7 @@ void D_Cleanup() // delete DoomStartupInfo data DoomStartupInfo.Name = ""; DoomStartupInfo.BkColor = DoomStartupInfo.FgColor = DoomStartupInfo.Type = 0; - DoomStartupInfo.LoadLights = DoomStartupInfo.LoadBrightmaps = -1; + DoomStartupInfo.LoadWidescreen = DoomStartupInfo.LoadLights = DoomStartupInfo.LoadBrightmaps = -1; GC::FullGC(); // clean up before taking down the object list. diff --git a/src/d_main.h b/src/d_main.h index e929a97d6..5f4fc1180 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -83,6 +83,7 @@ struct FStartupInfo int Type; int LoadLights = -1; int LoadBrightmaps = -1; + int LoadWidescreen = -1; enum { DefaultStartup,