| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#if !defined( INCLUDED_WAD_H ) |
| 23 |
#define INCLUDED_WAD_H |
| 24 |
|
| 25 |
#include "bytestreamutils.h" |
| 26 |
#include "idatastream.h" |
| 27 |
|
| 28 |
#define CMP_NONE 0 |
| 29 |
#define CMP_LZSS 1 |
| 30 |
|
| 31 |
#define TYP_NONE 0 |
| 32 |
#define TYP_LABEL 1 |
| 33 |
|
| 34 |
#define TYP_LUMPY 64 // 64 + grab command number |
| 35 |
#define TYP_PALETTE 64 |
| 36 |
#define TYP_QTEX 65 |
| 37 |
#define TYP_QPIC 66 |
| 38 |
#define TYP_SOUND 67 |
| 39 |
#define TYP_MIPTEX 68 |
| 40 |
|
| 41 |
typedef struct |
| 42 |
{ |
| 43 |
char identification[4]; |
| 44 |
int numlumps; |
| 45 |
int infotableofs; |
| 46 |
} wadinfo_t; |
| 47 |
|
| 48 |
typedef struct |
| 49 |
{ |
| 50 |
int filepos; |
| 51 |
int disksize; |
| 52 |
int size; |
| 53 |
char type; |
| 54 |
char compression; |
| 55 |
char pad1, pad2; |
| 56 |
char name[16]; |
| 57 |
} lumpinfo_t; |
| 58 |
|
| 59 |
inline void istream_read_wadinfo( InputStream& istream, wadinfo_t& wadinfo ){ |
| 60 |
istream.read( reinterpret_cast<InputStream::byte_type*>( wadinfo.identification ), 4 ); |
| 61 |
wadinfo.numlumps = istream_read_int32_le( istream ); |
| 62 |
wadinfo.infotableofs = istream_read_int32_le( istream ); |
| 63 |
} |
| 64 |
|
| 65 |
inline void istream_read_lumpinfo( InputStream& istream, lumpinfo_t& lumpinfo ){ |
| 66 |
lumpinfo.filepos = istream_read_int32_le( istream ); |
| 67 |
lumpinfo.disksize = istream_read_int32_le( istream ); |
| 68 |
lumpinfo.size = istream_read_int32_le( istream ); |
| 69 |
lumpinfo.type = istream_read_byte( istream ); |
| 70 |
lumpinfo.compression = istream_read_byte( istream ); |
| 71 |
lumpinfo.pad1 = istream_read_byte( istream ); |
| 72 |
lumpinfo.pad2 = istream_read_byte( istream ); |
| 73 |
istream.read( reinterpret_cast<InputStream::byte_type*>( lumpinfo.name ), 16 ); |
| 74 |
} |
| 75 |
|
| 76 |
#endif |