- allow loading Zips where all content is in a subdirectory.

The same logic as in GZDoom applies: The root must not have any other content and the subdirectory must contain identifiable game content.
Some handling was also added to strip out macOS resource fork folders because they can contain data that can confuse file detection.
This commit is contained in:
Christoph Oelckers 2021-04-06 01:06:03 +02:00
parent bfcedc2177
commit fc314b6616
2 changed files with 26 additions and 4 deletions

View file

@ -274,6 +274,18 @@ static void DeleteStuff(FileSystem &fileSystem, const TArray<FString>& deletelum
//
//
//==========================================================================
const char* iwad_folders[13] = { "textures/", "hires/", "sounds/", "music/", "maps/" };
const char* iwad_reserved_duke[12] = { ".map", ".con", "menudef", "gldefs", "zscript", "maps/", nullptr };
const char* iwad_reserved_blood[12] = { ".map", ".ini", "menudef", "gldefs", "zscript", "maps/", nullptr };
const char* iwad_reserved_sw[12] = { ".map", "swcustom.txt", "menudef", "gldefs", "zscript", "maps/", nullptr };
const char* iwad_reserved_ex[12] = { ".map", "menudef", "gldefs", "zscript", "maps/", nullptr };
const char** iwad_reserved()
{
return (g_gameType & GAMEFLAG_PSEXHUMED) ? iwad_reserved_ex :
(g_gameType & GAMEFLAG_SW) ? iwad_reserved_sw :
(g_gameType & GAMEFLAG_BLOOD) ? iwad_reserved_blood : iwad_reserved_duke;
}
void InitFileSystem(TArray<GrpEntry>& groups)
{
@ -374,6 +386,8 @@ void InitFileSystem(TArray<GrpEntry>& groups)
}
todelete.Append(userConfig.toBeDeleted);
LumpFilterInfo lfi;
for (auto p : iwad_folders) lfi.reservedFolders.Push(p);
for (auto p = iwad_reserved(); *p; p++) lfi.requiredPrefixes.Push(*p);
lfi.dotFilter = LumpFilter;