#include <assert.h>
#include "map.h"
#include "common/shared.h"
#include "common/scriplib.h"
#include "common/polylib.h"
#include "common/bspfile.h"
#include "../../common/tracing.h"
Go to the source code of this file.
Data Structures | |
struct | bspbrush_s |
struct | node_s |
struct | tree_t |
struct | textureref_t |
Typedefs | |
typedef struct bspbrush_s | bspbrush_t |
typedef struct node_s | node_t |
Functions | |
byte | GetLevelFlagsFromBrush (const mapbrush_t *brush) |
Extract the level flags (1-8) from the content flags of the given brush. | |
void | LoadMapFile (const char *filename) |
void | WriteMapFile (const char *filename) |
int | FindOrCreateFloatPlane (vec3_t normal, vec_t dist) |
int | FindMiptex (const char *name) |
int | TexinfoForBrushTexture (plane_t *plane, brush_texture_t *bt, const vec3_t origin, qboolean isTerrain) |
int | MapBrushesBounds (const int startbrush, const int endbrush, const int level, const vec3_t clipmins, const vec3_t clipmaxs, vec3_t mins, vec3_t maxs) |
sets mins and maxs to the smallest sizes that can contain all brushes from startbrush to endbrush that are in a given level. | |
bspbrush_t * | MakeBspBrushList (int startbrush, int endbrush, int level, vec3_t clipmins, vec3_t clipmaxs) |
bspbrush_t * | ChopBrushes (bspbrush_t *head) |
Carves any intersecting solid brushes into the minimum number of non-intersecting brushes. | |
bspbrush_t * | CopyBrush (const bspbrush_t *brush) |
Duplicates the brush, the sides, and the windings. | |
void | SplitBrush (const bspbrush_t *brush, int planenum, bspbrush_t **front, bspbrush_t **back) |
Generates two new brushes, leaving the original unchanged. | |
bspbrush_t * | AllocBrush (int numsides) |
int | CountBrushList (bspbrush_t *brushes) |
Returns the amount of brushes in the given brushlist. | |
void | FreeBrush (bspbrush_t *brushes) |
void | FreeBrushList (bspbrush_t *brushes) |
qboolean | WindingIsTiny (winding_t *w) |
Returns true if the winding would be crunched out of existance by the vertex snapping. | |
tree_t * | BrushBSP (bspbrush_t *brushlist, vec3_t mins, vec3_t maxs) |
The incoming list will be freed before exiting. | |
void | WriteBSPBrushMap (const char *name, const bspbrush_t *list) |
writes a map with the split bsp brushes | |
int | VisibleContents (int contents) |
Returns the single content bit of the strongest visible content present. | |
void | MarkVisibleSides (tree_t *tree, int start, int end) |
void | FreePortal (portal_t *p) |
void | MakeTreePortals (tree_t *tree) |
void | RemovePortalFromNode (portal_t *portal, node_t *l) |
Removes references to the given portal from the given node. | |
void | SetModelNumbers (void) |
Set the model numbers for SOLID_BSP entities like func_door or func_breakable. | |
void | BeginBSPFile (void) |
Starts a new bsp file. | |
int | WriteBSP (node_t *headnode) |
copies working data for a bsp tree into the structures used to create the 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. | |
void | EmitBrushes (void) |
Writes the brush list to the bsp. | |
void | EmitPlanes (void) |
Emits planes to the bsp file. | |
void | MakeFaces (node_t *headnode) |
void | FixTjuncs (node_t *headnode) |
int | GetEdge (int v1, int v2, const face_t *f) |
void | FreeFace (face_t *f) |
void | FreeTree (tree_t *tree) |
void | MakeTracingNodes (int levels) |
Use the bsp node structure to reconstruct efficient tracing structures that are used for fast visibility and pathfinding checks. | |
void | CloseTracingNodes (void) |
void | PushInfo (void) |
void | PopInfo (void) |
void | ProcessLevel (unsigned int levelnum) |
process brushes with that level mask | |
void | PruneNodes (node_t *node) |
void | DoRouting (void) |
Calculates the routing of a map. | |
void | ProcessModels (const char *filename) |
Variables | |
dMapTile_t * | curTile |
mapTiles_t | mapTiles |
int | entity_num |
plane_t | mapplanes [MAX_MAP_PLANES] |
int | nummapplanes |
int | nummapbrushes |
mapbrush_t | mapbrushes [MAX_MAP_BRUSHES] |
int | nummapbrushsides |
side_t | brushsides [MAX_MAP_SIDES] |
brush_texture_t | side_brushtextures [MAX_MAP_SIDES] |
int | brush_start |
int | brush_end |
textureref_t | textureref [MAX_MAP_TEXTURES] |
const vec3_t | v_epsilon |
vec3_t | worldMins |
vec3_t | worldMaxs |
Definition in file bsp.h.
typedef struct bspbrush_s bspbrush_t |
bspbrush_t* AllocBrush | ( | int | numsides | ) |
Definition at line 287 of file brushbsp.c.
References c_active_brushes, Mem_Alloc, and threadstate.
Referenced by BrushFromBounds(), CopyBrush(), MakeBspBrushList(), and SplitBrush().
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().
tree_t* BrushBSP | ( | bspbrush_t * | brushlist, | |
vec3_t | mins, | |||
vec3_t | maxs | |||
) |
The incoming list will be freed before exiting.
Definition at line 945 of file brushbsp.c.
References AddPointToBounds(), AllocNode(), AllocTree(), side_s::bevel, BrushFromBounds(), mapbrush_s::brushnum, BrushVolume(), BuildTree_r(), c_faces, c_nodes, c_nonvis, Com_Printf(), config, mapbrush_s::entitynum, tree_t::headnode, i, bspbrush_s::maxs, tree_t::maxs, tree_t::mins, bspbrush_s::mins, bspbrush_s::next, bspbrush_s::numsides, bspbrush_s::original, bspbrush_s::sides, side_s::texinfo, TEXINFO_NODE, VERB_EXTRA, Verb_Printf(), side_s::visible, node_s::volume, and side_s::winding.
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
bspbrush_t* ChopBrushes | ( | bspbrush_t * | head | ) |
Carves any intersecting solid brushes into the minimum number of non-intersecting brushes.
Definition at line 391 of file csg.c.
References AddBrushListToTail(), BrushesDisjoint(), BrushGE(), CountBrushList(), CullList(), FreeBrushList(), bspbrush_s::next, next, SubtractBrush(), VERB_EXTRA, and Verb_Printf().
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
void CloseTracingNodes | ( | void | ) |
Definition at line 73 of file trace.c.
References curTile, Mem_Free, and dMapTile_t::tnodes.
Referenced by LightWorld(), and MakeTracingNodes().
bspbrush_t* CopyBrush | ( | const bspbrush_t * | brush | ) |
Duplicates the brush, the sides, and the windings.
Definition at line 328 of file brushbsp.c.
References AllocBrush(), CopyWinding(), i, bspbrush_s::numsides, bspbrush_s::sides, and side_s::winding.
Referenced by SplitBrush(), and SplitBrushList().
int CountBrushList | ( | bspbrush_t * | brushes | ) |
Returns the amount of brushes in the given brushlist.
Definition at line 251 of file brushbsp.c.
References bspbrush_s::next.
Referenced by ChopBrushes().
void DoRouting | ( | void | ) |
Calculates the routing of a map.
This is needed for tracing to work!!!
Definition at line 124 of file routing.c.
References ACTOR_MAX_SIZE, baseFilename, byte, CELL_HEIGHT, CheckConnectionsThread(), CheckUnitThread(), CompressRouting(), config, CORE_DIRECTIONS, curTile, data, debugTrace, EmitBrushes(), EmitPlanes(), i, LEVEL_ACTORCLIP, LittleLong(), MakeTracingNodes(), mapTiles, MAX_MAP_ROUTING, PATHFINDING_WIDTH, PopInfo(), pos, PushInfo(), qtrue, dMapTile_t::routedata, dMapTile_t::routedatasize, RT_FLOOR, RT_GetMapSize(), RT_IS_BIDIRECTIONAL, RT_WriteCSVFiles(), RunSingleThreadOn(), VecToPos, VectorCopy, VectorSet, VERB_NORMAL, wpMaxs, and wpMins.
Referenced by ProcessWorldModel().
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().
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().
int FindMiptex | ( | const char * | name | ) |
Definition at line 37 of file textures.c.
References i, MAX_MAP_TEXTURES, nummiptex, Q_strncpyz(), and Sys_Error().
Referenced by ParseBrush().
Definition at line 195 of file map.c.
References CreateNewFloatPlane(), GetPlaneHashValueForDistance(), hash(), plane_s::hash_chain, i, PLANE_HASHES, PlaneEqual(), and SnapPlane().
Referenced by AddBrushBevels(), AdjustBrushesForOrigin(), BrushFromBounds(), EmitBrushes(), MakeBspBrushList(), and PlaneFromPoints().
void FixTjuncs | ( | node_t * | headnode | ) |
Definition at line 383 of file faces.c.
References c_badstartverts, c_degenerate, c_facecollapse, c_faceoverflows, c_tjunctions, c_totalverts, c_uniqueverts, config, EmitVertexes_r(), FixEdges_r(), hashverts, VERB_EXTRA, and Verb_Printf().
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
void FreeBrush | ( | bspbrush_t * | brushes | ) |
Definition at line 298 of file brushbsp.c.
References c_active_brushes, FreeWinding(), i, Mem_Free, bspbrush_s::numsides, bspbrush_s::sides, threadstate, and side_s::winding.
Referenced by CheckPlaneAgainstVolume(), ClipBrushToBox(), CullList(), FreeBrushList(), FreeTree_r(), SplitBrush(), and SubtractBrush().
void FreeBrushList | ( | bspbrush_t * | brushes | ) |
Definition at line 314 of file brushbsp.c.
References FreeBrush(), bspbrush_s::next, and next.
Referenced by BuildTree_r(), ChopBrushes(), FreeTree_r(), and SubtractBrush().
void FreeFace | ( | face_t * | f | ) |
Definition at line 134 of file faces.c.
References c_faces, FreeWinding(), Mem_Free, and face_s::w.
Referenced by FreeTree_r().
void FreePortal | ( | portal_t * | p | ) |
Definition at line 52 of file portals.c.
References c_active_portals, FreeWinding(), Mem_Free, threadstate, and portal_s::winding.
Referenced by FreeTreePortals_r().
void FreeTree | ( | tree_t * | tree | ) |
Definition at line 79 of file tree.c.
References FreeTree_r(), FreeTreePortals_r(), tree_t::headnode, and Mem_Free.
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
int GetEdge | ( | int | v1, | |
int | v2, | |||
const face_t * | f | |||
) |
Definition at line 412 of file faces.c.
References config, face_s::contentFlags, curTile, dMapTile_t::edges, firstmodeledge, i, MAX_MAP_EDGES, dMapTile_t::numedges, Sys_Error(), and dBspEdge_t::v.
Referenced by EmitFace().
byte GetLevelFlagsFromBrush | ( | const mapbrush_t * | brush | ) |
Extract the level flags (1-8) from the content flags of the given brush.
brush | The brush to extract the level flags from |
Definition at line 276 of file map.c.
References byte, and mapbrush_s::contentFlags.
void LoadMapFile | ( | const char * | filename | ) |
Definition at line 1117 of file map.c.
References AddPointToBounds(), c_boxbevels, c_edgebevels, ClearBounds(), Com_Printf(), config, curTile, entities, footstepsCnt, i, LoadScriptFile(), map_maxs, map_mins, mapTiles_t::mapTiles, mapTiles, materialsCnt, MAX_MAP_BRUSHES, MAX_MAP_PLANES, MAX_MAP_SIDES, MAX_WORLD_WIDTH, num_entities, entity_t::numbrushes, nummapbrushes, nummapbrushsides, nummapplanes, mapTiles_t::numTiles, ParseMapEntity(), ValueForKey(), VERB_EXTRA, and Verb_Printf().
Referenced by main().
bspbrush_t* MakeBspBrushList | ( | int | startbrush, | |
int | endbrush, | |||
int | level, | |||
vec3_t | clipmins, | |||
vec3_t | clipmaxs | |||
) |
Definition at line 299 of file csg.c.
References AllocBrush(), c_faces, ClipBrushToBox(), mapbrush_s::contentFlags, CopyWinding(), FindOrCreateFloatPlane(), mapbrush_s::finished, i, IsInLevel(), mapbrushes, maxplanenums, bspbrush_s::maxs, mapbrush_s::maxs, minplanenums, bspbrush_s::mins, mapbrush_s::mins, bspbrush_s::next, bspbrush_s::numsides, mapbrush_s::numsides, bspbrush_s::original, mapbrush_s::original_sides, qtrue, bspbrush_s::sides, SURF_HINT, side_s::surfaceFlags, VectorCopy, VERB_DUMP, Verb_Printf(), side_s::visible, and side_s::winding.
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
void MakeFaces | ( | node_t * | headnode | ) |
Definition at line 777 of file faces.c.
References c_merge, c_nodefaces, c_subdivide, MakeFaces_r(), VERB_EXTRA, and Verb_Printf().
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
void MakeTracingNodes | ( | int | levels | ) |
Use the bsp node structure to reconstruct efficient tracing structures that are used for fast visibility and pathfinding checks.
Definition at line 38 of file trace.c.
References CloseTracingNodes(), curTile, dBspModel_t::headnode, i, LEVEL_ACTORCLIP, LEVEL_LIGHTCLIP, LEVEL_MAX, Mem_Alloc, dMapTile_t::models, dBspModel_t::numfaces, dMapTile_t::numnodes, dMapTile_t::numtheads, dMapTile_t::thead, dMapTile_t::theadlevel, dMapTile_t::tnodes, and TR_BuildTracingNode_r().
Referenced by DoRouting(), and LightWorld().
void MakeTreePortals | ( | tree_t * | tree | ) |
Definition at line 396 of file portals.c.
References tree_t::headnode, MakeHeadnodePortals(), and MakeTreePortals_r().
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
int MapBrushesBounds | ( | const int | startbrush, | |
const int | endbrush, | |||
const int | level, | |||
const vec3_t | clipmins, | |||
const vec3_t | clipmaxs, | |||
vec3_t | mins, | |||
vec3_t | maxs | |||
) |
sets mins and maxs to the smallest sizes that can contain all brushes from startbrush to endbrush that are in a given level.
[in] | startbrush | the index of the first brush to check. |
[in] | endbrush | the index after the last brush to check. |
[in] | level | the level that we are searching for brushes in. -1 for skipping the levelflag check. |
[in] | clipmins | the absolute lowest boundary to allow for brushes. |
[in] | clipmaxs | the absolute highest boundary to allow for brushes. |
[out] | mins | the lowest boundary for all accepted brushes within the clipped bounds. |
[out] | maxs | the highest boundary for all accepted brushes within the clipped bounds. |
Definition at line 266 of file csg.c.
References AddPointToBounds(), ClearBounds(), mapbrush_s::contentFlags, mapbrush_s::finished, i, IsInLevel(), mapbrushes, mapbrush_s::maxs, and mapbrush_s::mins.
Referenced by ConstructLevelNodes_r().
void MarkVisibleSides | ( | tree_t * | tree, | |
int | start, | |||
int | end | |||
) |
Definition at line 491 of file portals.c.
References tree_t::headnode, i, mapbrushes, MarkVisibleSides_r(), mapbrush_s::numsides, mapbrush_s::original_sides, qfalse, VERB_EXTRA, Verb_Printf(), and side_s::visible.
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
void PopInfo | ( | void | ) |
Definition at line 50 of file levels.c.
References curTile, dMapTile_t::numedges, dMapTile_t::numfaces, dMapTile_t::numleafbrushes, dMapTile_t::numleafs, dMapTile_t::nummodels, dMapTile_t::numnodes, dMapTile_t::numnormals, dMapTile_t::numplanes, dMapTile_t::numsurfedges, dMapTile_t::numtexinfo, dMapTile_t::numvertexes, oldedges, oldfaces, oldleafbrushes, oldleafs, oldmodels, oldnodes, oldnormals, oldplanes, oldsurfedges, oldtexinfo, and oldvertexes.
Referenced by DoRouting().
void ProcessLevel | ( | unsigned int | levelnum | ) |
process brushes with that level mask
[in] | levelnum | is the level mask |
Definition at line 233 of file levels.c.
References config, ConstructLevelNodes_r(), curTile, dBspModel_t::firstface, dBspModel_t::headnode, mapbrushes, MAX_WORLD_WIDTH, dMapTile_t::models, dBspModel_t::numfaces, dMapTile_t::numfaces, nummapbrushes, dMapTile_t::nummodels, VERB_EXTRA, and Verb_Printf().
Referenced by ProcessWorldModel().
void ProcessModels | ( | const char * | filename | ) |
Definition at line 107 of file bsp.c.
References BeginBSPFile(), config, EndBSPFile(), entities, entity_num, num_entities, dMapTile_t::nummodels, ProcessSubModel(), ProcessWorldModel(), qfalse, VERB_EXTRA, and Verb_Printf().
Referenced by main().
void PruneNodes | ( | node_t * | node | ) |
Definition at line 135 of file tree.c.
References c_pruned, PruneNodes_r(), VERB_EXTRA, and Verb_Printf().
Referenced by ConstructLevelNodes_r().
void PushInfo | ( | void | ) |
Definition at line 35 of file levels.c.
References curTile, dMapTile_t::numedges, dMapTile_t::numfaces, dMapTile_t::numleafbrushes, dMapTile_t::numleafs, dMapTile_t::nummodels, dMapTile_t::numnodes, dMapTile_t::numnormals, dMapTile_t::numplanes, dMapTile_t::numsurfedges, dMapTile_t::numtexinfo, dMapTile_t::numvertexes, oldedges, oldfaces, oldleafbrushes, oldleafs, oldmodels, oldnodes, oldnormals, oldplanes, oldsurfedges, oldtexinfo, and oldvertexes.
Referenced by DoRouting().
Removes references to the given portal from the given node.
[in,out] | portal | The portal to remove from the node |
[in,out] | l | The node to remove the portal from |
Definition at line 102 of file portals.c.
References portal_s::next, portal_s::nodes, node_s::portals, and Sys_Error().
Referenced by FreeTreePortals_r(), and SplitNodePortals().
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().
void SplitBrush | ( | const bspbrush_t * | brush, | |
int | planenum, | |||
bspbrush_t ** | front, | |||
bspbrush_t ** | back | |||
) |
Generates two new brushes, leaving the original unchanged.
Definition at line 682 of file brushbsp.c.
References AllocBrush(), BaseWindingForPlane(), BoundBrush(), BrushMostlyOnSide(), BrushVolume(), ChopWindingInPlace(), ClipWindingEpsilon(), Com_Printf(), CopyBrush(), CopyWinding(), plane_s::dist, DotProduct, FreeBrush(), i, mapplanes, MAX_WORLD_WIDTH, plane_s::normal, winding_s::numpoints, bspbrush_s::numsides, bspbrush_s::original, winding_s::p, side_s::planenum, PSIDE_BACK, PSIDE_FRONT, qfalse, bspbrush_s::sides, side_s::tested, side_s::texinfo, TEXINFO_NODE, VERB_EXTRA, Verb_Printf(), side_s::visible, side_s::winding, WindingIsHuge(), and WindingIsTiny().
Referenced by BuildTree_r(), CheckPlaneAgainstVolume(), ClipBrushToBox(), SplitBrushList(), and SubtractBrush().
int TexinfoForBrushTexture | ( | plane_t * | plane, | |
brush_texture_t * | bt, | |||
const vec3_t | origin, | |||
qboolean | isTerrain | |||
) |
Definition at line 91 of file textures.c.
References curTile, DotProduct, i, MAX_MAP_TEXINFO, brush_texture_s::name, dMapTile_t::numtexinfo, Q_strncpyz(), brush_texture_s::rotate, brush_texture_s::scale, brush_texture_s::shift, shift, brush_texture_s::surfaceFlags, texinfo_s::surfaceFlags, sv, Sys_Error(), dMapTile_t::texinfo, texinfo_s::texture, TextureAxisFromPlane(), torad, brush_texture_s::value, texinfo_s::value, texinfo_s::vecs, and VectorScale.
Referenced by AdjustBrushesForOrigin(), and ParseBrush().
int VisibleContents | ( | int | contents | ) |
Returns the single content bit of the strongest visible content present.
Definition at line 64 of file portals.c.
References i, and LAST_VISIBLE_CONTENTS.
Referenced by FaceFromPortal(), and FindPortalSide().
Returns true if the winding would be crunched out of existance by the vertex snapping.
Definition at line 426 of file brushbsp.c.
References EDGE_LENGTH, i, len, winding_s::numpoints, winding_s::p, qfalse, qtrue, VectorLength(), and VectorSubtract.
Referenced by MakeNodePortal(), SplitBrush(), and SplitNodePortals().
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().
void WriteBSPBrushMap | ( | const char * | name, | |
const bspbrush_t * | list | |||
) |
writes a map with the split bsp brushes
Definition at line 1010 of file brushbsp.c.
References BaseWindingForPlane(), curTile, plane_s::dist, qFILE_s::f, f, FILE_WRITE, FreeWinding(), FS_CloseFile(), FS_OpenFile(), FS_Printf(), i, mapplanes, bspbrush_s::next, plane_s::normal, winding_s::p, side_s::planenum, bspbrush_s::sides, texinfo_s::surfaceFlags, Sys_Error(), side_s::texinfo, dMapTile_t::texinfo, texinfo_s::texture, texinfo_s::value, VERB_LESS, and Verb_Printf().
void WriteMapFile | ( | const char * | filename | ) |
Definition at line 1055 of file map.c.
References Check_ExtraBrushesForWorldspawn(), entities, entity_t::epairs, qFILE_s::f, f, FILE_WRITE, entity_t::firstbrush, FS_CloseFile(), FS_OpenFile(), FS_Printf(), i, Mem_Free, num_entities, entity_t::numbrushes, entity_t::skip, mapbrush_s::skipWriteBack, Sys_Error(), VERB_NORMAL, Verb_Printf(), WriteMapBrush(), and WriteMapEntities().
Referenced by main().
int brush_end |
Definition at line 29 of file levels.c.
Referenced by ConstructLevelNodes_r(), and ProcessWorldModel().
int brush_start |
Definition at line 29 of file levels.c.
Referenced by ConstructLevelNodes_r(), and ProcessWorldModel().
side_t brushsides[MAX_MAP_SIDES] |
Definition at line 35 of file map.c.
Referenced by Check_SetNodraw(), Check_SurfProp(), Check_SurfProps(), CheckFlagsBasedOnTextures(), CheckMixedFaceContents(), and CheckTexturesBasedOnFlags().
Definition at line 33 of file bsp.c.
Referenced by BeginBSPFile(), BeginModel(), BuildFaceExtents(), BuildFacelights(), BuildNodeChildren(), BuildPatch(), BuildPatches(), BuildVertexNormals(), CalcLightinfoExtents(), CalcLightinfoVectors(), CalcTextureReflectivity(), CalcTextureSize(), CloseTracingNodes(), DoRouting(), EmissiveLight(), EmitBrushes(), EmitDrawNode_r(), EmitFace(), EmitFaceVertexes(), EmitLeaf(), EmitPlanes(), EndModel(), ExportLightmap(), FaceFromPortal(), FacesWithVert(), FinalLightFace(), FixFaceEdges(), GetEdge(), GetVertexnum(), HasLight(), LightWorld(), LoadBSPFile(), LoadMapFile(), MakeTracingNodes(), ParseEntities(), PopInfo(), PrintBSPFileSizes(), ProcessLevel(), PushInfo(), SampleNormal(), SubdivideFace(), SwapBSPFile(), TestEdge(), TexinfoForBrushTexture(), TR_TestLineSingleTile(), UnparseEntities(), WindingFromFace(), WriteBSP(), WriteBSPBrushMap(), and WriteBSPFile().
int entity_num |
Definition at line 28 of file bsp.c.
Referenced by ConstructLevelNodes_r(), and ProcessModels().
mapbrush_t mapbrushes[MAX_MAP_BRUSHES] |
Definition at line 32 of file map.c.
Referenced by BeginModel(), Check_BrushIntersection(), Check_ContainedBrushes(), Check_ExtraBrushesForWorldspawn(), Check_FindCompositeSides(), Check_Free(), Check_MapSize(), Check_NearList(), CheckBrushes(), CheckFillLevelFlags(), CheckFlagsBasedOnTextures(), CheckLevelFlags(), CheckMapMicro(), CheckMixedFaceContents(), CheckNodraws(), CheckTexturesBasedOnFlags(), CheckZFighting(), EmitBrushes(), EmitLeaf(), MakeBspBrushList(), MapBrushesBounds(), MarkVisibleSides(), and ProcessLevel().
an index of the planes containing the faces of the brushes
Definition at line 41 of file map.c.
Referenced by BaseWindingForNode(), BrushVolume(), Check_IsPointInsideBrush(), Check_MapBrushVolume(), Check_SidePointsDown(), Check_WindingIntersects(), CreateBrushWindings(), EmitPlanes(), FaceFromPortal(), FacingAndCoincidentTo(), FindPortalSide(), MakeNodePortal(), MergeNodeFaces(), ParallelAndCoincidentTo(), SelectSplitSide(), SplitBrush(), SplitNodePortals(), TestBrushToPlanenum(), and WriteBSPBrushMap().
int nummapbrushes |
Definition at line 33 of file map.c.
Referenced by Check_BrushIntersection(), Check_ContainedBrushes(), Check_FindCompositeSides(), Check_Free(), Check_MapSize(), Check_NearList(), Check_Stats(), CheckBrushes(), CheckFillLevelFlags(), CheckFlagsBasedOnTextures(), CheckLevelFlags(), CheckMapMicro(), CheckMixedFaceContents(), CheckNodraws(), CheckTexturesBasedOnFlags(), CheckZFighting(), EmitBrushes(), LoadMapFile(), MoveBrushesToWorld(), ParseBrush(), ParseMapEntity(), and ProcessLevel().
int nummapbrushsides |
Definition at line 36 of file map.c.
Referenced by AddBrushBevels(), Check_Stats(), LoadMapFile(), and ParseBrush().
int nummapplanes |
Definition at line 42 of file map.c.
Referenced by Check_Stats(), CreateNewFloatPlane(), EmitPlanes(), and LoadMapFile().
brush_texture_t side_brushtextures[MAX_MAP_SIDES] |
Definition at line 38 of file map.c.
Referenced by Check_SetNodraw(), Check_SurfProp(), Check_SurfProps(), CheckFlagsBasedOnTextures(), CheckMixedFaceContents(), and CheckTexturesBasedOnFlags().
textureref_t textureref[MAX_MAP_TEXTURES] |
Definition at line 29 of file textures.c.
Referenced by GenerateFootstepList(), and GenerateMaterialFile().
Definition at line 28 of file levels.c.
Referenced by ConstructLevelNodes_r().
Definition at line 31 of file levels.c.
Referenced by BuildNodeChildren(), and ProcessWorldModel().
Definition at line 31 of file levels.c.
Referenced by BuildNodeChildren(), and ProcessWorldModel().