fixed loading of embedded files from directories.

This commit is contained in:
Christoph Oelckers 2024-01-04 17:56:15 +01:00
parent 4f8207a73f
commit e2048bd8bd
2 changed files with 5 additions and 3 deletions

View file

@ -391,10 +391,10 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, LumpFilterInf
int flags = resfile->GetEntryFlags(i);
if (flags & RESFF_EMBEDDED)
{
std::string path = filename;
path += ':';
path += resfile->getName(i);
auto embedded = resfile->GetEntryReader(i, READER_NEW, READERFLAG_SEEKABLE);
std::string path = filename;
if (embedded.GetBuffer()) path += ':';
path += resfile->getName(i);
AddFile(path.c_str(), &embedded, filter, Printf, hashfile);
}
}

View file

@ -428,10 +428,12 @@ void InitFileSystem(TArray<GrpEntry>& groups)
LumpFilterInfo lfi;
lfi.reservedFolders = { "textures/", "hires/", "sounds/", "music/", "maps/" };
for (auto p = iwad_reserved(); *p; p++) lfi.requiredPrefixes.push_back(*p);
#if 0
if (isBlood())
{
lfi.embeddings = { "blood.rff", "sounds.rff" };
}
#endif
if (isDukeEngine()) lfi.gameTypeFilter.push_back("DukeEngine");
if (isDukeLike()) lfi.gameTypeFilter.push_back("DukeLike");