- 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.
This commit is contained in:
Christoph Oelckers 2020-04-19 13:04:29 +02:00
parent 14ce0f4605
commit 6dfc416b51
2 changed files with 19 additions and 7 deletions

View File

@ -263,6 +263,8 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize,
// Look for IWAD definition lump // 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) FIWadManager::FIWadManager(const char *firstfn, const char *optfn)
{ {
@ -352,7 +354,13 @@ int FIWadManager::CheckIWADInfo(const char* fn)
{ {
FileSystem check; 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<FString> filenames;
filenames.Push(fn);
check.InitMultipleFiles(filenames, true, &lfi);
if (check.GetNumEntries() > 0) if (check.GetNumEntries() > 0)
{ {
int num = check.CheckNumForName("IWADINFO"); int num = check.CheckNumForName("IWADINFO");

View File

@ -184,6 +184,9 @@ extern bool M_DemoNoPlay; // [RH] if true, then skip any demos in the loop
extern bool insave; extern bool insave;
extern TDeletingArray<FLightDefaults *> LightDefaults; extern TDeletingArray<FLightDefaults *> 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) CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL)
{ {
@ -1850,8 +1853,12 @@ static FString CheckGameInfo(TArray<FString> & pwads)
{ {
FileSystem check; 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. // 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) if (check.GetNumEntries() > 0)
{ {
int num = check.CheckNumForName("GAMEINFO"); int num = check.CheckNumForName("GAMEINFO");
@ -2989,11 +2996,8 @@ static int D_DoomMain_Internal (void)
} }
lfi.gameTypeFilter.Push(FStringf("game-%s", GameTypeName())); 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 : iwad_folders) lfi.reservedFolders.Push(p);
for (auto p : folders) lfi.reservedFolders.Push(p); for (auto p : iwad_reserved) lfi.requiredPrefixes.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);
lfi.postprocessFunc = [&]() lfi.postprocessFunc = [&]()
{ {