writebsp.c File Reference

#include "bsp.h"
Include dependency graph for writebsp.c:

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

Detailed Description

Definition in file writebsp.c.


Function Documentation

void BeginBSPFile ( void   ) 
void BeginModel ( int  entityNum  ) 
void EmitBrushes ( void   ) 
static int EmitDrawNode_r ( node_t node  )  [static]
static void EmitFace ( const face_t f  )  [static]
static void EmitLeaf ( const node_t node  )  [static]
void EmitPlanes ( void   ) 

Emits planes to the bsp file.

Note:
There is no oportunity to discard planes, because all of the original brushes will be saved in the map.

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.

See also:
BeginBSPFile

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.

See also:
BeginModel

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.

Parameters:
[in] headnode the top-most node in this bsp tree
Returns:
the index to the head node created.

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().


Variable Documentation

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().

Definition at line 41 of file faces.c.

Referenced by BeginModel(), and GetEdge().


Generated by  doxygen 1.6.2