From 6dfc416b515f51bd12481f90e7474b862ec4855b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 13:04:29 +0200 Subject: [PATCH] - fixed setup of IPK3's where all content is in a subdirectory. These never received the file name list that was needed to eliminate this directory from internal paths. --- src/d_iwad.cpp | 10 +++++++++- src/d_main.cpp | 16 ++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index b9a8ae5d0..9b9cb7f7d 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -263,6 +263,8 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize, // Look for IWAD definition lump // //========================================================================== +extern const char* iwad_folders[13]; +extern const char* iwad_reserved[12]; FIWadManager::FIWadManager(const char *firstfn, const char *optfn) { @@ -352,7 +354,13 @@ int FIWadManager::CheckIWADInfo(const char* fn) { FileSystem check; - check.InitSingleFile(fn, true); + LumpFilterInfo lfi; + for (auto p : iwad_folders) lfi.reservedFolders.Push(p); + for (auto p : iwad_reserved) lfi.requiredPrefixes.Push(p); + + TArray filenames; + filenames.Push(fn); + check.InitMultipleFiles(filenames, true, &lfi); if (check.GetNumEntries() > 0) { int num = check.CheckNumForName("IWADINFO"); diff --git a/src/d_main.cpp b/src/d_main.cpp index 70a95aa05..163c9824f 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -184,6 +184,9 @@ extern bool M_DemoNoPlay; // [RH] if true, then skip any demos in the loop extern bool insave; extern TDeletingArray LightDefaults; +const char* iwad_folders[13] = { "flats/", "textures/", "hires/", "sprites/", "voxels/", "colormaps/", "acs/", "maps/", "voices/", "patches/", "graphics/", "sounds/", "music/" }; +const char* iwad_reserved[12] = { "mapinfo", "zmapinfo", "gameinfo", "sndinfo", "sbarinfo", "menudef", "gldefs", "animdefs", "decorate", "zscript", "iwadinfo" "maps/" }; + CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL) { @@ -1850,8 +1853,12 @@ static FString CheckGameInfo(TArray & pwads) { FileSystem check; + LumpFilterInfo lfi; + for (auto p : iwad_folders) lfi.reservedFolders.Push(p); + for (auto p : iwad_reserved) lfi.requiredPrefixes.Push(p); + // Open the entire list as a temporary file system and look for a GAMEINFO lump. The last one will automatically win. - check.InitMultipleFiles(pwads, true); + check.InitMultipleFiles(pwads, true, &lfi); if (check.GetNumEntries() > 0) { int num = check.CheckNumForName("GAMEINFO"); @@ -2989,11 +2996,8 @@ static int D_DoomMain_Internal (void) } lfi.gameTypeFilter.Push(FStringf("game-%s", GameTypeName())); - static const char* folders[] = { "flats/", "textures/", "hires/", "sprites/", "voxels/", "colormaps/", "acs/", "maps/", "voices/", "patches/", "graphics/", "sounds/", "music/" }; - for (auto p : folders) lfi.reservedFolders.Push(p); - - static const char* reserved[] = { "mapinfo", "zmapinfo", "gameinfo", "sndinfo", "sbarinfo", "menudef", "gldefs", "animdefs", "decorate", "zscript", "maps/" }; - for (auto p : reserved) lfi.requiredPrefixes.Push(p); + for (auto p : iwad_folders) lfi.reservedFolders.Push(p); + for (auto p : iwad_reserved) lfi.requiredPrefixes.Push(p); lfi.postprocessFunc = [&]() {