- read snapshots from zip.

This commit is contained in:
Christoph Oelckers 2016-09-22 01:28:05 +02:00
commit 5dfc396bb9
12 changed files with 90 additions and 76 deletions

View file

@ -306,17 +306,12 @@ FZipFile::~FZipFile()
//
//==========================================================================
FCompressedBuffer FZipFile::GetRawLump(int lumpnum)
FCompressedBuffer FZipLump::GetRawData()
{
if ((unsigned)lumpnum >= NumLumps)
{
return{ 0,0,0,0,0,nullptr };
}
FZipLump *lmp = &Lumps[lumpnum];
FCompressedBuffer cbuf = { (unsigned)lmp->LumpSize, (unsigned)lmp->CompressedSize, lmp->Method, lmp->GPFlags, lmp->CRC32, new char[lmp->CompressedSize] };
Reader->Seek(lmp->Position, SEEK_SET);
Reader->Read(cbuf.mBuffer, lmp->CompressedSize);
FCompressedBuffer cbuf = { (unsigned)LumpSize, (unsigned)CompressedSize, Method, GPFlags, CRC32, new char[CompressedSize] };
if (Flags & LUMPFZIP_NEEDFILESTART) SetLumpAddress();
Owner->Reader->Seek(Position, SEEK_SET);
Owner->Reader->Read(cbuf.mBuffer, CompressedSize);
return cbuf;
}