#include "bsp.h"
Go to the source code of this file.
Functions | |
void | EmitPlanes (void) |
Emits planes to the bsp file. | |
static void | EmitLeaf (const node_t *node) |
Emits a leafnode to the bsp file. | |
static void | EmitFace (const face_t *f) |
static int | EmitDrawNode_r (node_t *node) |
Writes the draw nodes. | |
int | WriteBSP (node_t *headnode) |
copies working data for a bsp tree into the structures used to create the bsp file. | |
void | SetModelNumbers (void) |
Set the model numbers for SOLID_BSP entities like func_door or func_breakable. | |
void | EmitBrushes (void) |
Writes the brush list to the bsp. | |
void | BeginBSPFile (void) |
Starts a new bsp file. | |
void | EndBSPFile (const char *filename) |
Finishes a new bsp and writes to disk. | |
void | BeginModel (int entityNum) |
Sets up a new brush model. | |
void | EndModel (void) |
Finish a model's processing. | |
Variables | |
static int | c_nofaces |
static int | c_facenodes |
int | firstmodeledge |
Definition in file writebsp.c.
void BeginBSPFile | ( | void | ) |
Starts a new bsp file.
Definition at line 309 of file writebsp.c.
References dBspLeaf_t::contentFlags, CONTENTS_SOLID, curTile, dMapTile_t::leafs, mapTiles_t::mapTiles, mapTiles, dMapTile_t::numbrushsides, dMapTile_t::numedges, dMapTile_t::numfaces, dMapTile_t::numleafbrushes, dMapTile_t::numleafs, dMapTile_t::nummodels, dMapTile_t::numnodes, dMapTile_t::numnormals, dMapTile_t::numsurfedges, mapTiles_t::numTiles, and dMapTile_t::numvertexes.
Referenced by ProcessModels().
void BeginModel | ( | int | entityNum | ) |
Sets up a new brush model.
Definition at line 359 of file writebsp.c.
References AddPointToBounds(), ClearBounds(), curTile, entities, entity_t::firstbrush, dBspModel_t::firstface, firstmodeledge, mapbrushes, MAX_MAP_MODELS, dBspModel_t::maxs, mapbrush_s::maxs, dBspModel_t::mins, mapbrush_s::mins, dMapTile_t::models, entity_t::numbrushes, dMapTile_t::numedges, dMapTile_t::numfaces, dMapTile_t::nummodels, mapbrush_s::numsides, Sys_Error(), and VectorCopy.
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
void EmitBrushes | ( | void | ) |
Writes the brush list to the bsp.
Definition at line 242 of file writebsp.c.
References dMapTile_t::brushes, dMapTile_t::brushsides, cBspBrush_s::checkcount, cBspBrush_s::contentFlags, mapbrush_s::contentFlags, dBspBrush_t::contentFlags, curTile, dMapTile_t::dbrushes, FindOrCreateFloatPlane(), cBspBrush_s::firstbrushside, dBspBrush_t::firstbrushside, i, mapbrushes, MAX_MAP_BRUSHES, MAX_MAP_BRUSHSIDES, mapbrush_s::maxs, mapbrush_s::mins, dMapTile_t::numbrushes, dMapTile_t::numbrushsides, nummapbrushes, cBspBrush_s::numsides, mapbrush_s::numsides, dBspBrush_t::numsides, mapbrush_s::original_sides, side_s::planenum, dBspBrushSide_t::planenum, Sys_Error(), side_s::texinfo, dBspBrushSide_t::texinfo, vec3_origin, and VectorCopy.
Referenced by DoRouting(), and EndBSPFile().
static int EmitDrawNode_r | ( | node_t * | node | ) | [static] |
Writes the draw nodes.
Definition at line 141 of file writebsp.c.
References c_facenodes, c_nofaces, dBspNode_t::children, node_s::children, curTile, EmitFace(), EmitLeaf(), f, node_s::faces, dBspNode_t::firstface, i, MAX_MAP_NODES, dBspNode_t::maxs, node_s::maxs, dBspNode_t::mins, node_s::mins, face_s::next, dMapTile_t::nodes, dBspNode_t::numfaces, dMapTile_t::numfaces, dMapTile_t::numleafs, dMapTile_t::numnodes, dBspNode_t::planenum, node_s::planenum, PLANENUM_LEAF, Sys_Error(), UFO_SIZE_T, VectorCopy, VERB_DUMP, and Verb_Printf().
Referenced by WriteBSP().
static void EmitFace | ( | const face_t * | f | ) | [static] |
Definition at line 102 of file writebsp.c.
References curTile, dMapTile_t::faces, dBspSurface_t::firstedge, GetEdge(), i, LIGHTMAP_MAX, dBspSurface_t::lightofs, MAX_MAP_FACES, MAX_MAP_SURFEDGES, face_s::merged, dBspSurface_t::numedges, dMapTile_t::numfaces, face_s::numpoints, dMapTile_t::numsurfedges, face_s::planenum, dBspSurface_t::planenum, dBspSurface_t::side, face_s::split, dMapTile_t::surfedges, Sys_Error(), face_s::texinfo, dBspSurface_t::texinfo, and face_s::vertexnums.
Referenced by EmitDrawNode_r().
static void EmitLeaf | ( | const node_t * | node | ) | [static] |
Emits a leafnode to the bsp file.
Definition at line 58 of file writebsp.c.
References node_s::area, dBspLeaf_t::area, node_s::brushlist, node_s::contentFlags, dBspLeaf_t::contentFlags, curTile, dBspLeaf_t::firstleafbrush, i, dMapTile_t::leafbrushes, dMapTile_t::leafs, mapbrushes, MAX_MAP_LEAFBRUSHES, MAX_MAP_LEAFS, dBspLeaf_t::maxs, node_s::maxs, dBspLeaf_t::mins, node_s::mins, bspbrush_s::next, dBspLeaf_t::numleafbrushes, dMapTile_t::numleafbrushes, dMapTile_t::numleafs, bspbrush_s::original, Sys_Error(), VectorCopy, VERB_DUMP, and Verb_Printf().
Referenced by EmitDrawNode_r().
void EmitPlanes | ( | void | ) |
Emits planes to the bsp file.
Definition at line 41 of file writebsp.c.
References curTile, plane_s::dist, dBspPlane_t::dist, i, mapplanes, dBspPlane_t::normal, plane_s::normal, nummapplanes, dMapTile_t::numplanes, dMapTile_t::planes, plane_s::type, dBspPlane_t::type, and VectorCopy.
Referenced by DoRouting(), and EndBSPFile().
void EndBSPFile | ( | const char * | filename | ) |
Finishes a new bsp and writes to disk.
Definition at line 342 of file writebsp.c.
References EmitBrushes(), EmitPlanes(), UnparseEntities(), VERB_LESS, Verb_Printf(), and WriteBSPFile().
Referenced by ProcessModels().
void EndModel | ( | void | ) |
Finish a model's processing.
Definition at line 400 of file writebsp.c.
References curTile, dBspModel_t::firstface, dMapTile_t::models, dMapTile_t::numfaces, dBspModel_t::numfaces, and dMapTile_t::nummodels.
Referenced by ProcessSubModel().
void SetModelNumbers | ( | void | ) |
Set the model numbers for SOLID_BSP entities like func_door or func_breakable.
Definition at line 223 of file writebsp.c.
References Com_sprintf(), entities, i, num_entities, and SetKeyValue().
Referenced by main().
int WriteBSP | ( | node_t * | headnode | ) |
copies working data for a bsp tree into the structures used to create the bsp file.
[in] | headnode | the top-most node in this bsp tree |
Definition at line 201 of file writebsp.c.
References c_facenodes, c_nofaces, curTile, EmitDrawNode_r(), dMapTile_t::numfaces, oldfaces, VERB_EXTRA, and Verb_Printf().
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
int c_facenodes [static] |
Definition at line 28 of file writebsp.c.
Referenced by EmitDrawNode_r(), and WriteBSP().
int c_nofaces [static] |
Definition at line 27 of file writebsp.c.
Referenced by EmitDrawNode_r(), and WriteBSP().
int firstmodeledge |
Definition at line 41 of file faces.c.
Referenced by BeginModel(), and GetEdge().