2 ===========================================================================
3 Copyright (C) 1997-2006 Id Software, Inc.
5 This file is part of Quake 2 Tools source code.
7 Quake 2 Tools source code is free software; you can redistribute it
8 and/or modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the License,
10 or (at your option) any later version.
12 Quake 2 Tools source code is distributed in the hope that it will be
13 useful, 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 Quake 2 Tools source code; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 ===========================================================================
27 extern dmodel_t dmodels[MAX_MAP_MODELS];
29 extern int visdatasize;
30 extern byte dvisdata[MAX_MAP_VISIBILITY];
33 extern int lightdatasize;
34 extern byte dlightdata[MAX_MAP_LIGHTING];
36 extern int entdatasize;
37 extern char dentdata[MAX_MAP_ENTSTRING];
40 extern dleaf_t dleafs[MAX_MAP_LEAFS];
43 extern dplane_t dplanes[MAX_MAP_PLANES];
45 extern int numvertexes;
46 extern dvertex_t dvertexes[MAX_MAP_VERTS];
49 extern dnode_t dnodes[MAX_MAP_NODES];
51 extern int numtexinfo;
52 extern texinfo_t texinfo[MAX_MAP_TEXINFO];
55 extern dface_t dfaces[MAX_MAP_FACES];
58 extern dedge_t dedges[MAX_MAP_EDGES];
60 extern int numleaffaces;
61 extern unsigned short dleaffaces[MAX_MAP_LEAFFACES];
63 extern int numleafbrushes;
64 extern unsigned short dleafbrushes[MAX_MAP_LEAFBRUSHES];
66 extern int numsurfedges;
67 extern int dsurfedges[MAX_MAP_SURFEDGES];
70 extern darea_t dareas[MAX_MAP_AREAS];
72 extern int numareaportals;
73 extern dareaportal_t dareaportals[MAX_MAP_AREAPORTALS];
75 extern int numbrushes;
76 extern dbrush_t dbrushes[MAX_MAP_BRUSHES];
78 extern int numbrushsides;
79 extern dbrushside_t dbrushsides[MAX_MAP_BRUSHSIDES];
81 extern byte dpop[256];
83 void DecompressVis (byte *in, byte *decompressed);
84 int CompressVis (byte *vis, byte *dest);
86 void LoadBSPFile (char *filename);
87 void LoadBSPFileTexinfo (char *filename); // just for qdata
88 void WriteBSPFile (char *filename);
89 void PrintBSPFileSizes (void);
94 typedef struct epair_s
108 // only valid for func_areaportals
113 extern int num_entities;
114 extern entity_t entities[MAX_MAP_ENTITIES];
116 void ParseEntities (void);
117 void UnparseEntities (void);
119 void SetKeyValue (entity_t *ent, char *key, char *value);
120 char *ValueForKey (entity_t *ent, char *key);
121 // will return "" if not present
123 vec_t FloatForKey (entity_t *ent, char *key);
124 void GetVectorForKey (entity_t *ent, char *key, vec3_t vec);
126 epair_t *ParseEpair (void);
128 void PrintEntity (entity_t *ent);