UFO: Alien Invasion
Loading...
Searching...
No Matches
writebsp.cpp File Reference
#include "bsp.h"
Include dependency graph for writebsp.cpp:

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 or SOLID_TRIGGER 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

Function Documentation

◆ BeginBSPFile()

void BeginBSPFile ( void )

Starts a new bsp file.

See also
EndBSPFile

Definition at line 303 of file writebsp.cpp.

References CONTENTS_SOLID, curTile, and mapTiles.

Referenced by ProcessModels().

◆ BeginModel()

◆ EmitBrushes()

◆ EmitDrawNode_r()

◆ EmitFace()

◆ EmitLeaf()

◆ EmitPlanes()

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.cpp.

References curTile, dBspPlane_t::dist, plane_t::dist, i, mapplanes, dBspPlane_t::normal, plane_t::normal, nummapplanes, dBspPlane_t::type, plane_t::type, and VectorCopy.

Referenced by DoRouting(), and EndBSPFile().

◆ EndBSPFile()

void EndBSPFile ( const char * filename)

Finishes a new bsp and writes to disk.

See also
BeginBSPFile

Definition at line 336 of file writebsp.cpp.

References EmitBrushes(), EmitPlanes(), UnparseEntities(), VERB_LESS, Verb_Printf(), and WriteBSPFile().

Referenced by ProcessModels().

◆ EndModel()

void EndModel ( void )

Finish a model's processing.

See also
BeginModel

Definition at line 387 of file writebsp.cpp.

References curTile, dBspModel_t::firstface, and dBspModel_t::numfaces.

Referenced by ProcessSubModel().

◆ SetModelNumbers()

void SetModelNumbers ( void )

Set the model numbers for SOLID_BSP or SOLID_TRIGGER entities like func_door or func_breakable.

Definition at line 217 of file writebsp.cpp.

References Com_sprintf(), entities, i, num_entities, and SetKeyValue().

Referenced by main().

◆ WriteBSP()

int WriteBSP ( node_t * headnode)

copies working data for a bsp tree into the structures used to create the bsp file.

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

Definition at line 195 of file writebsp.cpp.

References c_facenodes, c_nofaces, curTile, EmitDrawNode_r(), oldfaces, VERB_EXTRA, and Verb_Printf().

Referenced by ConstructLevelNodes_r(), and ProcessSubModel().

Variable Documentation

◆ c_facenodes

int c_facenodes
static

Definition at line 28 of file writebsp.cpp.

Referenced by EmitDrawNode_r(), and WriteBSP().

◆ c_nofaces

int c_nofaces
static

Definition at line 27 of file writebsp.cpp.

Referenced by EmitDrawNode_r(), and WriteBSP().

◆ firstmodeledge

int firstmodeledge
extern

Definition at line 41 of file faces.cpp.

Referenced by BeginModel(), and GetEdge().