mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-28 23:02:07 +00:00
add missing check for embedded WADs.
This commit is contained in:
parent
cffa49d05f
commit
7ce63abe6c
2 changed files with 30 additions and 13 deletions
|
@ -396,6 +396,12 @@ void FResourceFile::PostProcessArchive(LumpFilterInfo *filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
JunkLeftoverFilters(max);
|
JunkLeftoverFilters(max);
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < NumLumps; i++)
|
||||||
|
{
|
||||||
|
CheckEmbedded(i, filter);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -663,7 +669,15 @@ FileReader FResourceFile::GetEntryReader(uint32_t entry, int readertype, int rea
|
||||||
}
|
}
|
||||||
if (!(Entries[entry].Flags & RESFF_COMPRESSED))
|
if (!(Entries[entry].Flags & RESFF_COMPRESSED))
|
||||||
{
|
{
|
||||||
if (readertype == READER_SHARED && mainThread)
|
auto buf = Reader.GetBuffer();
|
||||||
|
// if this is backed by a memory buffer, create a new reader directly referencing it.
|
||||||
|
if (buf != nullptr)
|
||||||
|
{
|
||||||
|
fr.OpenMemory(buf + Entries[entry].Position, Entries[entry].Length);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (readertype == READER_SHARED && !mainThread)
|
||||||
readertype = READER_NEW;
|
readertype = READER_NEW;
|
||||||
if (readertype == READER_SHARED)
|
if (readertype == READER_SHARED)
|
||||||
{
|
{
|
||||||
|
@ -680,6 +694,7 @@ FileReader FResourceFile::GetEntryReader(uint32_t entry, int readertype, int rea
|
||||||
fr.OpenMemoryArray(data);
|
fr.OpenMemoryArray(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FileReader fri;
|
FileReader fri;
|
||||||
|
|
|
@ -308,8 +308,10 @@ FIWadManager::FIWadManager(const char *firstfn, const char *optfn)
|
||||||
std::vector<std::string> fns;
|
std::vector<std::string> fns;
|
||||||
fns.push_back(firstfn);
|
fns.push_back(firstfn);
|
||||||
if (optfn) fns.push_back(optfn);
|
if (optfn) fns.push_back(optfn);
|
||||||
|
FileSys::LumpFilterInfo lfi;
|
||||||
|
GetReserved(lfi);
|
||||||
|
|
||||||
if (check.InitMultipleFiles(fns, nullptr, nullptr))
|
if (check.InitMultipleFiles(fns, &lfi, nullptr))
|
||||||
{
|
{
|
||||||
int num = check.CheckNumForName("IWADINFO");
|
int num = check.CheckNumForName("IWADINFO");
|
||||||
if (num >= 0)
|
if (num >= 0)
|
||||||
|
|
Loading…
Reference in a new issue