mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- 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.
This commit is contained in:
parent
ebfa61514e
commit
c471be4409
2 changed files with 16 additions and 3 deletions
|
@ -1853,6 +1853,16 @@ static FString ParseGameInfo(TArray<FString> &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.
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue