2 Copyright (C) 1999-2006 Id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
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
23 #include "surfaceflags.h"
25 extern int bsp_version;
28 extern dmodel_t dmodels[MAX_MAP_MODELS];
30 extern int numShaders;
31 extern dshader_t dshaders[MAX_MAP_MODELS];
33 extern int entdatasize;
34 extern char dentdata[MAX_MAP_ENTSTRING];
37 extern dleaf_t dleafs[MAX_MAP_LEAFS];
40 extern dplane_t dplanes[MAX_MAP_PLANES];
43 extern dnode_t dnodes[MAX_MAP_NODES];
45 extern int numleafsurfaces;
46 extern int dleafsurfaces[MAX_MAP_LEAFFACES];
48 extern int numleafbrushes;
49 extern int dleafbrushes[MAX_MAP_LEAFBRUSHES];
51 extern int numbrushes;
52 extern dbrush_t dbrushes[MAX_MAP_BRUSHES];
54 extern int numbrushsides;
55 extern dbrushside_t dbrushsides[MAX_MAP_BRUSHSIDES];
57 void SetLightBytes(int n);
58 extern int numLightBytes;
59 extern byte *lightBytes;
61 void SetGridPoints(int n);
62 extern int numGridPoints;
63 extern byte *gridData;
65 extern int numVisBytes;
66 extern byte visBytes[MAX_MAP_VISIBILITY];
68 void SetDrawVerts(int n);
70 extern int numDrawVerts;
71 extern drawVert_t *drawVerts;
73 extern int numDrawIndexes;
74 extern int drawIndexes[MAX_MAP_DRAW_INDEXES];
76 void SetDrawSurfaces(int n);
77 void SetDrawSurfacesBuffer();
78 extern int numDrawSurfaces;
79 extern dsurface_t *drawSurfaces;
82 extern dfog_t dfogs[MAX_MAP_FOGS];
84 void LoadBSPFile( const char *filename );
85 void WriteBSPFile( const char *filename );
86 void PrintBSPFileSizes( void );
91 typedef struct epair_s {
99 struct bspbrush_s *brushes;
100 struct parseMesh_s *patches;
105 extern int num_entities;
106 extern entity_t entities[MAX_MAP_ENTITIES];
108 void ParseEntities( void );
109 void UnparseEntities( void );
111 void SetKeyValue( entity_t *ent, const char *key, const char *value );
112 const char *ValueForKey( const entity_t *ent, const char *key );
113 // will return "" if not present
115 vec_t FloatForKey( const entity_t *ent, const char *key );
116 void GetVectorForKey( const entity_t *ent, const char *key, vec3_t vec );
118 epair_t *ParseEpair( void );
120 void PrintEntity( const entity_t *ent );