From c471be44095a18ba9d872d5692c2cecff4bf63f1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 19 Dec 2018 01:37:48 +0100 Subject: [PATCH] - added an option to GAMEINFO to either force or disable loading of the default lights and brightmaps. The mod which prompted me to add this is "The Chosen" which is a Dehacked-based TC and repurposes many original actors for something entirely different. The stock lights are not usable for this and would make it impossible to add a GAMEINFO lump to it because then there is no way to disable loading of lights in the startup screen. --- src/d_main.cpp | 17 ++++++++++++++--- src/d_main.h | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index a7a0ef46a..e6c0f6ca8 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1853,6 +1853,16 @@ static FString ParseGameInfo(TArray &pwads, const char *fn, const char sc.MustGetString(); DoomStartupInfo.Song = sc.String; } + else if (!nextKey.CompareNoCase("LOADLIGHTS")) + { + sc.MustGetNumber(); + DoomStartupInfo.LoadLights = !!sc.Number; + } + else if (!nextKey.CompareNoCase("LOADBRIGHTMAPS")) + { + sc.MustGetNumber(); + DoomStartupInfo.LoadBrightmaps = !!sc.Number; + } else { // Silently ignore unknown properties @@ -2022,13 +2032,13 @@ static void AddAutoloadFiles(const char *autoname) // [SP] Dialog reaction - load lights.pk3 and brightmaps.pk3 based on user choices if (!(gameinfo.flags & GI_SHAREWARE)) { - if (autoloadlights) + if (DoomStartupInfo.LoadLights == 1 || (DoomStartupInfo.LoadLights != 0 && autoloadlights)) { const char *lightswad = BaseFileSearch ("lights.pk3", NULL); if (lightswad) D_AddFile (allwads, lightswad); } - if (autoloadbrightmaps) + if (DoomStartupInfo.LoadBrightmaps == 1 || (DoomStartupInfo.LoadBrightmaps != 0 && autoloadbrightmaps)) { const char *bmwad = BaseFileSearch ("brightmaps.pk3", NULL); if (bmwad) @@ -2712,8 +2722,9 @@ void D_DoomMain (void) LightDefaults.DeleteAndClear(); // this can leak heap memory if it isn't cleared. // delete DoomStartupInfo data - DoomStartupInfo.Name = (const char*)0; + DoomStartupInfo.Name = ""; DoomStartupInfo.BkColor = DoomStartupInfo.FgColor = DoomStartupInfo.Type = 0; + 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 f48521f8c..05d818f14 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -81,6 +81,8 @@ struct FStartupInfo uint32_t BkColor; // Background color for title banner FString Song; int Type; + int LoadLights = -1; + int LoadBrightmaps = -1; enum { DefaultStartup,