31 static int oldmodels,
oldleafs,
oldleafbrushes,
oldplanes,
oldvertexes,
oldnormals,
oldnodes,
oldtexinfo,
oldfaces,
oldedges,
oldsurfedges;
71 for (
int i = 0;
i < 3;
i++) {
118 #define SPLIT_AT_POW2 6
119 #define SPLIT_COORDS 2
146 Verb_Printf(
VERB_DUMP,
"(%i): %i %i: (%i %i) (%i %i) -> (%i %i) (%i %i)\n", levelnum, tmaxs[0] - tmins[0], tmaxs[1] - tmins[1],
147 (
int)partBox.
mins[0], (
int)partBox.
mins[1], (
int)partBox.
maxs[0], (
int)partBox.
maxs[1],
148 (
int)bBox.
mins[0], (
int)bBox.
mins[1], (
int)bBox.
maxs[0], (
int)bBox.
maxs[1]);
151 if (tmaxs[1] - tmins[1] >= 2 || tmaxs[0] - tmins[0] >= 2) {
157 if (tmaxs[1] - tmins[1] > tmaxs[0] - tmins[0])
162 AABB newPartBox(bBox);
164 splitAt = (tmins[n] + ((tmaxs[n] - tmins[n]) >> 1)) <<
SPLIT_AT_POW2;
165 newPartBox.
maxs[n] = splitAt;
171 newPartBox.
mins[n] = splitAt;
245 mins[0] = (
config.block_xl) * 512.0 + 1.0;
246 mins[1] = (
config.block_yl) * 512.0 + 1.0;
249 maxs[0] = (
config.block_xh + 1.0) * 512.0 - 1.0;
250 maxs[1] = (
config.block_yh + 1.0) * 512.0 - 1.0f;
252 const AABB partBox(mins, maxs);
#define VectorCopy(src, dest)
void setNegativeVolume()
Sets mins and maxs to their starting points before using addPoint.
dBspModel_t models[MAX_MAP_MODELS]
dBspNode_t nodes[MAX_MAP_NODES]
void set(const AABB &other)
Copies the values from the given aabb.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
void MarkVisibleSides(tree_t *tree, int start, int end)
bspbrush_t * ChopBrushes(bspbrush_t *head)
Carves any intersecting solid brushes into the minimum number of non-intersecting brushes...
void FreeTree(tree_t *tree)
mapbrush_t mapbrushes[MAX_MAP_BRUSHES]
void expand(const float byVal)
expand the box in all directions, but clip them to the maximum boundaries
tree_t * BuildTree(bspbrush_t *brushlist, const vec3_t mins, const vec3_t maxs)
The incoming list will be freed before exiting.
void BeginModel(int entityNum)
Sets up a new brush model.
void add(const vec3_t point)
If the point is outside the box, expand the box to accommodate it.
static int32_t BuildNodeChildren(const int n[3])
void ProcessLevelEntityNumber(int entityNumber)
void ProcessLevel(unsigned int levelnum)
process brushes with that level mask
static int oldleafbrushes
void FixTjuncs(node_t *headnode)
int WriteBSP(node_t *headnode)
copies working data for a bsp tree into the structures used to create the bsp file.
void MakeFaces(node_t *headnode)
#define MAX_WORLD_WIDTH
-MAX_WORLD_WIDTH up tp +MAX_WORLD_WIDTH
void MakeTreePortals(tree_t *tree)
static int32_t ConstructLevelNodes_r(const int levelnum, const AABB &partBox, int entityNum)
void setMaxs(const vec3_t maxi)
bspbrush_t * MakeBspBrushList(int startbrush, int endbrush, int level, const AABB &clip)
int MapBrushesBounds(const int startbrush, const int endbrush, const int level, const AABB &clipBox, AABB &bBox)
sets mins and maxs to the smallest sizes that can contain all brushes from startbrush to endbrush tha...
void PruneNodes(node_t *node)