This commit is contained in:
nashmuhandes 2024-03-10 03:34:37 +08:00
commit 74a27be3fd
114 changed files with 3366 additions and 1677 deletions

View file

@ -35,6 +35,7 @@
#include <time.h>
#include <stdexcept>
#include <cstdint>
#include "w_zip.h"
#include "ancientzip.h"
#include "resourcefile.h"

View file

@ -980,11 +980,12 @@ bool OpenDecompressor(FileReader& self, FileReader &parent, FileReader::Size len
}
dec->Length = length;
}
if ((flags & DCF_CACHED))
if ((flags & (DCF_CACHED| DCF_SEEKABLE))) // the buffering reader does not seem to be stable, so cache it instead until we find out what's wrong.
{
// read everything into a MemoryArrayReader.
FileData data(nullptr, length);
fr->Read(data.writable(), length);
delete fr;
fr = new MemoryArrayReader(data);
}
else if ((flags & DCF_SEEKABLE))

View file

@ -395,7 +395,7 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, LumpFilterInf
std::string path = filename;
path += ':';
path += resfile->getName(i);
auto embedded = resfile->GetEntryReader(i, READER_NEW, READERFLAG_SEEKABLE);
auto embedded = resfile->GetEntryReader(i, READER_CACHED);
AddFile(path.c_str(), &embedded, filter, Printf, hashfile);
}
}