2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #define MAX_MAP_HULLS 4
23 #define MAX_MAP_LEAFS 65536 // was 8192
25 // key / value pair sizes
28 #define MAX_VALUE 1024
30 //=============================================================================
41 #define LUMP_ENTITIES 0
43 #define LUMP_TEXTURES 2
44 #define LUMP_VERTEXES 3
45 #define LUMP_VISIBILITY 4
47 #define LUMP_TEXINFO 6
49 #define LUMP_LIGHTING 8
50 #define LUMP_CLIPNODES 9
52 #define LUMP_MARKSURFACES 11
54 #define LUMP_SURFEDGES 13
55 #define LUMP_MODELS 14
56 #define HEADER_LUMPS 15
60 float mins[3], maxs[3];
62 int headnode[MAX_MAP_HULLS];
63 int visleafs; // not including the solid leaf 0
64 int firstface, numfaces;
70 lump_t lumps[HEADER_LUMPS];
76 int dataofs[4]; // [nummiptex]
80 typedef struct miptex_s
83 unsigned width, height;
84 unsigned offsets[MIPLEVELS]; // four mip maps stored
94 // 0-2 are axial planes
99 // 3-5 are non-axial planes snapped to the nearest
108 int type; // PLANE_X - PLANE_ANYZ ?remove? trivial to regenerate
112 // contents values in Q1 maps
113 #define CONTENTS_EMPTY -1
114 #define CONTENTS_SOLID -2
115 #define CONTENTS_WATER -3
116 #define CONTENTS_SLIME -4
117 #define CONTENTS_LAVA -5
118 #define CONTENTS_SKY -6
119 // these were #ifdef QUAKE2 in the quake source
120 #define CONTENTS_ORIGIN -7 // removed at csg time
121 #define CONTENTS_CLIP -8 // changed to contents_solid
122 #define CONTENTS_CURRENT_0 -9
123 #define CONTENTS_CURRENT_90 -10
124 #define CONTENTS_CURRENT_180 -11
125 #define CONTENTS_CURRENT_270 -12
126 #define CONTENTS_CURRENT_UP -13
127 #define CONTENTS_CURRENT_DOWN -14
129 //contents flags in Q2 maps
130 #define CONTENTSQ2_SOLID 0x00000001 // an eye is never valid in a solid
131 #define CONTENTSQ2_WINDOW 0x00000002 // translucent, but not watery
132 #define CONTENTSQ2_AUX 0x00000004
133 #define CONTENTSQ2_LAVA 0x00000008
134 #define CONTENTSQ2_SLIME 0x00000010
135 #define CONTENTSQ2_WATER 0x00000020
136 #define CONTENTSQ2_MIST 0x00000040
137 #define CONTENTSQ2_AREAPORTAL 0x00008000
138 #define CONTENTSQ2_PLAYERCLIP 0x00010000
139 #define CONTENTSQ2_MONSTERCLIP 0x00020000
140 #define CONTENTSQ2_CURRENT_0 0x00040000
141 #define CONTENTSQ2_CURRENT_90 0x00080000
142 #define CONTENTSQ2_CURRENT_180 0x00100000
143 #define CONTENTSQ2_CURRENT_270 0x00200000
144 #define CONTENTSQ2_CURRENT_UP 0x00400000
145 #define CONTENTSQ2_CURRENT_DOWN 0x00800000
146 #define CONTENTSQ2_ORIGIN 0x01000000 // removed before bsping an entity
147 #define CONTENTSQ2_MONSTER 0x02000000 // should never be on a brush, only in game
148 #define CONTENTSQ2_DEADMONSTER 0x04000000
149 #define CONTENTSQ2_DETAIL 0x08000000 // brushes to be added after vis leafs
150 #define CONTENTSQ2_TRANSLUCENT 0x10000000 // auto set if any surface has trans
151 #define CONTENTSQ2_LADDER 0x20000000
153 //contents flags in Q3 maps
154 #define CONTENTSQ3_SOLID 0x00000001 // solid (opaque and transparent)
155 #define CONTENTSQ3_LAVA 0x00000008 // lava
156 #define CONTENTSQ3_SLIME 0x00000010 // slime
157 #define CONTENTSQ3_WATER 0x00000020 // water
158 #define CONTENTSQ3_FOG 0x00000040 // unused?
159 #define CONTENTSQ3_AREAPORTAL 0x00008000 // areaportal (separates areas)
160 #define CONTENTSQ3_PLAYERCLIP 0x00010000 // block players
161 #define CONTENTSQ3_MONSTERCLIP 0x00020000 // block monsters
162 #define CONTENTSQ3_TELEPORTER 0x00040000 // hint for Q3's bots
163 #define CONTENTSQ3_JUMPPAD 0x00080000 // hint for Q3's bots
164 #define CONTENTSQ3_CLUSTERPORTAL 0x00100000 // hint for Q3's bots
165 #define CONTENTSQ3_DONOTENTER 0x00200000 // hint for Q3's bots
166 #define CONTENTSQ3_ORIGIN 0x01000000 // used by origin brushes to indicate origin of bmodel (removed by map compiler)
167 #define CONTENTSQ3_BODY 0x02000000 // used by bbox entities (should never be on a brush)
168 #define CONTENTSQ3_CORPSE 0x04000000 // used by dead bodies (SOLID_CORPSE in darkplaces)
169 #define CONTENTSQ3_DETAIL 0x08000000 // brushes that do not split the bsp tree (decorations)
170 #define CONTENTSQ3_STRUCTURAL 0x10000000 // brushes that split the bsp tree
171 #define CONTENTSQ3_TRANSLUCENT 0x20000000 // leaves surfaces that are inside for rendering
172 #define CONTENTSQ3_TRIGGER 0x40000000 // used by trigger entities
173 #define CONTENTSQ3_NODROP 0x80000000 // remove items that fall into this brush
175 #define SUPERCONTENTS_SOLID 0x00000001
176 #define SUPERCONTENTS_WATER 0x00000002
177 #define SUPERCONTENTS_SLIME 0x00000004
178 #define SUPERCONTENTS_LAVA 0x00000008
179 #define SUPERCONTENTS_SKY 0x00000010
180 #define SUPERCONTENTS_BODY 0x00000020
181 #define SUPERCONTENTS_CORPSE 0x00000040
182 #define SUPERCONTENTS_NODROP 0x00000080
183 #define SUPERCONTENTS_LIQUIDSMASK (SUPERCONTENTS_LAVA | SUPERCONTENTS_SLIME | SUPERCONTENTS_WATER)
186 #define SUPERCONTENTS_DEADMONSTER 0x00000000
187 #define SUPERCONTENTS_CURRENT_0 0x00000000
188 #define SUPERCONTENTS_CURRENT_90 0x00000000
189 #define SUPERCONTENTS_CURRENT_180 0x00000000
190 #define SUPERCONTENTS_CURRENT_270 0x00000000
191 #define SUPERCONTENTS_CURRENT_DOWN 0x00000000
192 #define SUPERCONTENTS_CURRENT_UP 0x00000000
193 #define SUPERCONTENTS_AREAPORTAL 0x00000000
194 #define SUPERCONTENTS_AUX 0x00000000
195 #define SUPERCONTENTS_CLUSTERPORTAL 0x00000000
196 #define SUPERCONTENTS_DETAIL 0x00000000
197 #define SUPERCONTENTS_STRUCTURAL 0x00000000
198 #define SUPERCONTENTS_DONOTENTER 0x00000000
199 #define SUPERCONTENTS_JUMPPAD 0x00000000
200 #define SUPERCONTENTS_LADDER 0x00000000
201 #define SUPERCONTENTS_MONSTER 0x00000000
202 #define SUPERCONTENTS_MONSTERCLIP 0x00000000
203 #define SUPERCONTENTS_PLAYERCLIP 0x00000000
204 #define SUPERCONTENTS_TELEPORTER 0x00000000
205 #define SUPERCONTENTS_TRANSLUCENT 0x00000000
206 #define SUPERCONTENTS_TRIGGER 0x00000000
207 #define SUPERCONTENTS_WINDOW 0x00000000
214 short children[2]; // negative numbers are -(leafs+1), not nodes
215 short mins[3]; // for sphere culling
217 unsigned short firstface;
218 unsigned short numfaces; // counting both sides
224 short children[2]; // negative numbers are contents
230 float vecs[2][4]; // [s/t][xyz offset]
234 #define TEX_SPECIAL 1 // sky or slime, no lightmap or 256 subdivision
236 // note that edge 0 is never used, because negative edge nums are used for
237 // counterclockwise use of the edge in a face
240 unsigned short v[2]; // vertex numbers
243 #define MAXLIGHTMAPS 4
246 // LordHavoc: changed from short to unsigned short for q2 support
247 unsigned short planenum;
250 int firstedge; // we must support > 64k edges
255 qbyte styles[MAXLIGHTMAPS];
256 int lightofs; // start of [numstyles*surfsize] samples
261 #define AMBIENT_WATER 0
262 #define AMBIENT_SKY 1
263 #define AMBIENT_SLIME 2
264 #define AMBIENT_LAVA 3
266 #define NUM_AMBIENTS 4 // automatic ambient sounds
268 // leaf 0 is the generic CONTENTS_SOLID leaf, used for all solid areas
269 // all other leafs need visibility info
273 int visofs; // -1 = no visibility info
275 short mins[3]; // for frustum culling
278 unsigned short firstmarksurface;
279 unsigned short nummarksurfaces;
281 qbyte ambient_level[NUM_AMBIENTS];