- 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

@ -40,6 +40,7 @@
#include "doomerrors.h"
#include "gi.h"
#include "doomstat.h"
#include "w_zip.h"
//==========================================================================
@ -191,6 +192,23 @@ void FResourceLump::CheckEmbedded()
}
//==========================================================================
//
// this is just for completeness. For non-Zips only an uncompressed lump can
// be returned.
//
//==========================================================================
FCompressedBuffer FResourceLump::GetRawData()
{
FCompressedBuffer cbuf = { (unsigned)LumpSize, (unsigned)LumpSize, METHOD_STORED, 0, 0, new char[LumpSize] };
memcpy(cbuf.mBuffer, CacheLump(), LumpSize);
cbuf.mCRC32 = crc32(0, (BYTE*)cbuf.mBuffer, LumpSize);
ReleaseCache();
return cbuf;
}
//==========================================================================
//
// Returns the owner's FileReader if it can be used to access this lump