- add 'loadwidescreen' to gameinfo, works exactly like 'loadbrightmaps' or 'loadlights'

This commit is contained in:
Rachael Alexanderson 2020-10-26 10:08:34 -04:00
parent 7479648083
commit 34c57ab6be
2 changed files with 8 additions and 2 deletions

View file

@ -12,6 +12,7 @@ struct FStartupInfo
int Type;
int LoadLights = -1;
int LoadBrightmaps = -1;
int LoadWidescreen = -1;
int modern = 0;
enum
{

View file

@ -1937,6 +1937,11 @@ static FString ParseGameInfo(TArray<FString> &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.