2 Copyright (C) 2001-2006, William Joseph.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #if !defined( INCLUDED_WAD_H )
23 #define INCLUDED_WAD_H
25 #include "bytestreamutils.h"
26 #include "idatastream.h"
34 #define TYP_LUMPY 64 // 64 + grab command number
35 #define TYP_PALETTE 64
42 char identification[4]; // should be WAD2 or 2DAW
50 int size; // uncompressed
54 char name[16]; // must be null terminated
57 inline void istream_read_wadinfo(InputStream &istream, wadinfo_t &wadinfo)
59 istream.read(reinterpret_cast<InputStream::byte_type *>( wadinfo.identification ), 4);
60 wadinfo.numlumps = istream_read_int32_le(istream);
61 wadinfo.infotableofs = istream_read_int32_le(istream);
64 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);