mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 23:32:04 +00:00
- redid autoload handler and resource file filtering to use the newly defined method with multi-part names.
As a result the old 'Group' property could be removed and all other means to get a section name were disabled. As an example, if the code gets 'doom.doom2.commercial' it will use the following sections in this order: global.autoload doom.autoload doom.doom2.autoload doom.doom2.commercial.autoload.
This commit is contained in:
parent
3241b1d3db
commit
258822ef3b
7 changed files with 22 additions and 35 deletions
|
@ -138,12 +138,6 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize)
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
iwad->Autoname = sc.String;
|
iwad->Autoname = sc.String;
|
||||||
}
|
}
|
||||||
else if (sc.Compare("Group"))
|
|
||||||
{
|
|
||||||
sc.MustGetStringName("=");
|
|
||||||
sc.MustGetString();
|
|
||||||
iwad->Group = sc.String;
|
|
||||||
}
|
|
||||||
else if (sc.Compare("Config"))
|
else if (sc.Compare("Config"))
|
||||||
{
|
{
|
||||||
sc.MustGetStringName("=");
|
sc.MustGetStringName("=");
|
||||||
|
|
|
@ -1990,10 +1990,9 @@ static void D_DoomInit()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
static void AddAutoloadFiles(const char *group, const char *autoname)
|
static void AddAutoloadFiles(const char *autoname)
|
||||||
{
|
{
|
||||||
LumpFilterGroup = group;
|
LumpFilterIWAD.Format("%s.", autoname); // The '.' is appened to simplify parsing the string
|
||||||
LumpFilterIWAD = autoname;
|
|
||||||
|
|
||||||
if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload"))
|
if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload"))
|
||||||
{
|
{
|
||||||
|
@ -2025,25 +2024,14 @@ static void AddAutoloadFiles(const char *group, const char *autoname)
|
||||||
// Add common (global) wads
|
// Add common (global) wads
|
||||||
D_AddConfigWads (allwads, "Global.Autoload");
|
D_AddConfigWads (allwads, "Global.Autoload");
|
||||||
|
|
||||||
// Add game-specific wads
|
long len;
|
||||||
file = gameinfo.ConfigName;
|
int lastpos = -1;
|
||||||
file += ".Autoload";
|
|
||||||
D_AddConfigWads (allwads, file);
|
|
||||||
|
|
||||||
// Add group-specific wads
|
while ((len = LumpFilterIWAD.IndexOf('.', lastpos+1)) > 0)
|
||||||
if (group != NULL && group[0] != 0)
|
|
||||||
{
|
{
|
||||||
file = group;
|
file = LumpFilterIWAD.Left(len) + ".Autoload";
|
||||||
file += ".Autoload";
|
|
||||||
D_AddConfigWads(allwads, file);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add IWAD-specific wads
|
|
||||||
if (autoname != NULL && autoname[0] != 0)
|
|
||||||
{
|
|
||||||
file = autoname;
|
|
||||||
file += ".Autoload";
|
|
||||||
D_AddConfigWads(allwads, file);
|
D_AddConfigWads(allwads, file);
|
||||||
|
lastpos = len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2294,7 +2282,7 @@ void D_DoomMain (void)
|
||||||
FBaseCVar::DisableCallbacks();
|
FBaseCVar::DisableCallbacks();
|
||||||
GameConfig->DoGameSetup (gameinfo.ConfigName);
|
GameConfig->DoGameSetup (gameinfo.ConfigName);
|
||||||
|
|
||||||
AddAutoloadFiles(iwad_info->Group, iwad_info->Autoname);
|
AddAutoloadFiles(iwad_info->Autoname);
|
||||||
|
|
||||||
// Run automatically executed files
|
// Run automatically executed files
|
||||||
execFiles = new DArgs;
|
execFiles = new DArgs;
|
||||||
|
|
|
@ -75,7 +75,6 @@ struct FIWADInfo
|
||||||
{
|
{
|
||||||
FString Name; // Title banner text for this IWAD
|
FString Name; // Title banner text for this IWAD
|
||||||
FString Autoname; // Name of autoload ini section for this IWAD
|
FString Autoname; // Name of autoload ini section for this IWAD
|
||||||
FString Group; // Groupname for this IWAD
|
|
||||||
FString Configname; // Name of config section for this IWAD
|
FString Configname; // Name of config section for this IWAD
|
||||||
FString Required; // Requires another IWAD
|
FString Required; // Requires another IWAD
|
||||||
DWORD FgColor; // Foreground color for title banner
|
DWORD FgColor; // Foreground color for title banner
|
||||||
|
|
|
@ -69,4 +69,4 @@ int SinglePlayerClass[MAXPLAYERS];
|
||||||
bool ToggleFullscreen;
|
bool ToggleFullscreen;
|
||||||
int BorderTopRefresh;
|
int BorderTopRefresh;
|
||||||
|
|
||||||
FString LumpFilterGroup, LumpFilterIWAD;
|
FString LumpFilterIWAD;
|
||||||
|
|
|
@ -251,6 +251,6 @@ EXTERN_CVAR (Int, compatflags2);
|
||||||
extern int i_compatflags, i_compatflags2, ii_compatflags, ii_compatflags2, ib_compatflags;
|
extern int i_compatflags, i_compatflags2, ii_compatflags, ii_compatflags2, ib_compatflags;
|
||||||
|
|
||||||
// Filters from AddAutoloadFiles(). Used to filter files from archives.
|
// Filters from AddAutoloadFiles(). Used to filter files from archives.
|
||||||
extern FString LumpFilterGroup, LumpFilterIWAD;
|
extern FString LumpFilterIWAD;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -163,6 +163,7 @@ FGameConfigFile::FGameConfigFile ()
|
||||||
// Create auto-load sections, so users know what's available.
|
// Create auto-load sections, so users know what's available.
|
||||||
// Note that this totem pole is the reverse of the order that
|
// Note that this totem pole is the reverse of the order that
|
||||||
// they will appear in the file.
|
// they will appear in the file.
|
||||||
|
#if 0
|
||||||
CreateSectionAtStart("Harmony.Autoload");
|
CreateSectionAtStart("Harmony.Autoload");
|
||||||
CreateSectionAtStart("UrbanBrawl.Autoload");
|
CreateSectionAtStart("UrbanBrawl.Autoload");
|
||||||
CreateSectionAtStart("Chex3.Autoload");
|
CreateSectionAtStart("Chex3.Autoload");
|
||||||
|
@ -185,6 +186,7 @@ FGameConfigFile::FGameConfigFile ()
|
||||||
CreateSectionAtStart("DoomU.Autoload");
|
CreateSectionAtStart("DoomU.Autoload");
|
||||||
CreateSectionAtStart("Doom1.Autoload");
|
CreateSectionAtStart("Doom1.Autoload");
|
||||||
CreateSectionAtStart("Doom.Autoload");
|
CreateSectionAtStart("Doom.Autoload");
|
||||||
|
#endif
|
||||||
CreateSectionAtStart("Global.Autoload");
|
CreateSectionAtStart("Global.Autoload");
|
||||||
|
|
||||||
// The same goes for auto-exec files.
|
// The same goes for auto-exec files.
|
||||||
|
@ -336,9 +338,6 @@ void FGameConfigFile::DoGlobalSetup ()
|
||||||
}
|
}
|
||||||
if (last < 211)
|
if (last < 211)
|
||||||
{
|
{
|
||||||
//RenameSection("Hacx2.Autoload", "hacx.2_0.Autoload");
|
|
||||||
//RenameSection("Hacx12.Autoload", "hacx.1_2.Autoload");
|
|
||||||
//RenameSection("Hexen1.Autoload", "hexen.hexen.Autoload");
|
|
||||||
RenameSection("Chex3.Autoload", "chex.3.Autoload");
|
RenameSection("Chex3.Autoload", "chex.3.Autoload");
|
||||||
RenameSection("Chex1.Autoload", "chex.1.Autoload");
|
RenameSection("Chex1.Autoload", "chex.1.Autoload");
|
||||||
RenameSection("HexenDK.Autoload", "hexen.deathkings.Autoload");
|
RenameSection("HexenDK.Autoload", "hexen.deathkings.Autoload");
|
||||||
|
|
|
@ -345,9 +345,16 @@ void FResourceFile::PostProcessArchive(void *lumps, size_t lumpsize)
|
||||||
// each one so that we don't risk refiltering already filtered lumps.
|
// each one so that we don't risk refiltering already filtered lumps.
|
||||||
DWORD max = NumLumps;
|
DWORD max = NumLumps;
|
||||||
max -= FilterLumpsByGameType(gameinfo.gametype, lumps, lumpsize, max);
|
max -= FilterLumpsByGameType(gameinfo.gametype, lumps, lumpsize, max);
|
||||||
max -= FilterLumps(gameinfo.ConfigName, lumps, lumpsize, max);
|
|
||||||
max -= FilterLumps(LumpFilterGroup, lumps, lumpsize, max);
|
long len;
|
||||||
max -= FilterLumps(LumpFilterIWAD, lumps, lumpsize, max);
|
int lastpos = -1;
|
||||||
|
FString file;
|
||||||
|
|
||||||
|
while ((len = LumpFilterIWAD.IndexOf('.', lastpos+1)) > 0)
|
||||||
|
{
|
||||||
|
max -= FilterLumps(LumpFilterIWAD.Left(len), lumps, lumpsize, max);
|
||||||
|
lastpos = len;
|
||||||
|
}
|
||||||
JunkLeftoverFilters(lumps, lumpsize, max);
|
JunkLeftoverFilters(lumps, lumpsize, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue