mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-24 02:11:14 +00:00
53 lines
No EOL
1,018 B
C++
53 lines
No EOL
1,018 B
C++
#ifndef __FILE_ZIP_H
|
|
#define __FILE_ZIP_H
|
|
|
|
#include "resourcefile.h"
|
|
|
|
enum
|
|
{
|
|
LUMPFZIP_NEEDFILESTART = 128
|
|
};
|
|
|
|
//==========================================================================
|
|
//
|
|
// Zip Lump
|
|
//
|
|
//==========================================================================
|
|
|
|
struct FZipLump : public FResourceLump
|
|
{
|
|
WORD GPFlags;
|
|
BYTE Method;
|
|
int CompressedSize;
|
|
int Position;
|
|
unsigned CRC32;
|
|
|
|
virtual FileReader *GetReader();
|
|
virtual int FillCache();
|
|
|
|
private:
|
|
void SetLumpAddress();
|
|
virtual int GetFileOffset();
|
|
FCompressedBuffer GetRawData();
|
|
};
|
|
|
|
|
|
//==========================================================================
|
|
//
|
|
// Zip file
|
|
//
|
|
//==========================================================================
|
|
|
|
class FZipFile : public FResourceFile
|
|
{
|
|
FZipLump *Lumps;
|
|
|
|
public:
|
|
FZipFile(const char * filename, FileReader *file);
|
|
virtual ~FZipFile();
|
|
bool Open(bool quiet);
|
|
virtual FResourceLump *GetLump(int no) { return ((unsigned)no < NumLumps)? &Lumps[no] : NULL; }
|
|
};
|
|
|
|
|
|
#endif |