From 34c57ab6be3e58bc973d087619689092c4cd8cfe Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 26 Oct 2020 10:08:34 -0400 Subject: [PATCH] - add 'loadwidescreen' to gameinfo, works exactly like 'loadbrightmaps' or 'loadlights' --- src/common/engine/startupinfo.h | 1 + src/d_main.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/engine/startupinfo.h b/src/common/engine/startupinfo.h index 5054a45075..f47fa351f4 100644 --- a/src/common/engine/startupinfo.h +++ b/src/common/engine/startupinfo.h @@ -12,6 +12,7 @@ struct FStartupInfo int Type; int LoadLights = -1; int LoadBrightmaps = -1; + int LoadWidescreen = -1; int modern = 0; enum { diff --git a/src/d_main.cpp b/src/d_main.cpp index 7b6cde6b27..cd84fc7463 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1937,6 +1937,11 @@ static FString ParseGameInfo(TArray &pwads, const char *fn, const char sc.MustGetNumber(); GameStartupInfo.LoadBrightmaps = !!sc.Number; } + else if (!nextKey.CompareNoCase("LOADWIDESCREEN")) + { + sc.MustGetNumber(); + GameStartupInfo.LoadWidescreen = !!sc.Number; + } else { // Silently ignore unknown properties @@ -2071,7 +2076,7 @@ static void AddAutoloadFiles(const char *autoname) if (bmwad) D_AddFile (allwads, bmwad, true, -1, GameConfig); } - if (autoloadwidescreen) + if (GameStartupInfo.LoadWidescreen == 1 || (GameStartupInfo.LoadWidescreen != 0 && autoloadwidescreen)) { const char *wswad = BaseFileSearch ("game_widescreen_gfx.pk3", NULL, false, GameConfig); if (wswad) @@ -3730,7 +3735,7 @@ void D_Cleanup() // delete GameStartupInfo data GameStartupInfo.Name = ""; GameStartupInfo.BkColor = GameStartupInfo.FgColor = GameStartupInfo.Type = 0; - GameStartupInfo.LoadLights = GameStartupInfo.LoadBrightmaps = -1; + GameStartupInfo.LoadWidescreen = GameStartupInfo.LoadLights = GameStartupInfo.LoadBrightmaps = -1; GC::FullGC(); // clean up before taking down the object list.