Skip to content

Commit

Permalink
- allow specifying a .def file in GAMEINFO.
Browse files Browse the repository at this point in the history
This will be loaded on top of the regular .def files and not replace them.
  • Loading branch information
coelckers committed Apr 17, 2021
1 parent 3906d5c commit 27ca71a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/common/engine/startupinfo.h
Expand Up @@ -10,6 +10,7 @@ struct FStartupInfo
uint32_t BkColor; // Background color for title banner
FString Song;
FString con;
FString def;
int Type;
int LoadLights = -1;
int LoadBrightmaps = -1;
Expand Down
5 changes: 5 additions & 0 deletions source/core/gamecontrol.cpp
Expand Up @@ -1357,6 +1357,11 @@ void LoadDefinitions()
if (!loaddefinitionsfile(defsfile, true, false)) loaded = defsfile;
}
}

if (GameStartupInfo.def.IsNotEmpty())
{
loaddefinitionsfile(GameStartupInfo.def, false); // Stuff from gameinfo.
}

if (loaded)
{
Expand Down
5 changes: 5 additions & 0 deletions source/core/initfs.cpp
Expand Up @@ -127,6 +127,11 @@ static TArray<FString> ParseGameInfo(TArray<FString>& pwads, const char* fn, con
sc.MustGetString();
GameStartupInfo.con = sc.String;;
}
else if (!nextKey.CompareNoCase("DEF"))
{
sc.MustGetString();
GameStartupInfo.def = sc.String;;
}
else
{
// Silently ignore unknown properties
Expand Down

0 comments on commit 27ca71a

Please sign in to comment.