Merge branch 'brushbsp' of https://github.com/ericwa/ericw-tools into brushbsp

# Conflicts:
#	include/common/bspfile.hh
This commit is contained in:
Jonathan 2022-06-16 20:22:36 -04:00
commit 0b67acd4ba
5 changed files with 12 additions and 11 deletions

View File

@ -351,8 +351,8 @@ struct fmt::formatter<bspversion_t>
return format_to(ctx.out(), "{}:{}", ident, v.version.value()); return format_to(ctx.out(), "{}:{}", ident, v.version.value());
} }
// Q1-esque BSPs are printed as, ex, 29 // Q1-esque BSPs are printed as, ex, bsp29
return format_to(ctx.out(), "{}", v.ident); return format_to(ctx.out(), "{}", v.short_name);
} }
}; };

View File

@ -42,5 +42,5 @@ struct tree_t
contentflags_t ClusterContents(const node_t *node); contentflags_t ClusterContents(const node_t *node);
void MakeTreePortals(tree_t *tree); void MakeTreePortals(tree_t *tree);
void FreeAllPortals(node_t *node); void FreeTreePortals_r(node_t *node);
void WritePortalFile(tree_t *tree); void WritePortalFile(tree_t *tree);

View File

@ -620,7 +620,7 @@ void MakeTreePortals(tree_t *tree)
state.iNodesDone = 0; state.iNodesDone = 0;
FreeAllPortals(tree->headnode); FreeTreePortals_r(tree->headnode);
AssertNoPortals(tree->headnode); AssertNoPortals(tree->headnode);
MakeHeadnodePortals(tree); MakeHeadnodePortals(tree);
@ -640,10 +640,11 @@ void WritePortalFile(tree_t *tree)
state.iNodesDone = 0; state.iNodesDone = 0;
FreeAllPortals(tree->headnode); FreeTreePortals_r(tree->headnode);
AssertNoPortals(tree->headnode); AssertNoPortals(tree->headnode);
MakeHeadnodePortals(tree); MakeHeadnodePortals(tree);
CutNodePortals_r(tree->headnode, &state); CutNodePortals_r(tree->headnode, &state);
/* save portal file for vis tracing */ /* save portal file for vis tracing */
@ -656,17 +657,17 @@ void WritePortalFile(tree_t *tree)
/* /*
================== ==================
FreeAllPortals FreeTreePortals_r
================== ==================
*/ */
void FreeAllPortals(node_t *node) void FreeTreePortals_r(node_t *node)
{ {
portal_t *p, *nextp; portal_t *p, *nextp;
if (node->planenum != PLANENUM_LEAF) { if (node->planenum != PLANENUM_LEAF) {
FreeAllPortals(node->children[0]); FreeTreePortals_r(node->children[0]);
FreeAllPortals(node->children[1]); FreeTreePortals_r(node->children[1]);
} }
for (p = node->portals; p; p = nextp) { for (p = node->portals; p; p = nextp) {

View File

@ -895,7 +895,7 @@ static void ProcessEntity(mapentity_t *entity, const int hullnum)
tree = BrushBSP(entity, false); tree = BrushBSP(entity, false);
} }
FreeAllPortals(tree->headnode); FreeTreePortals_r(tree->headnode);
PruneNodes(tree->headnode); PruneNodes(tree->headnode);

View File

@ -157,7 +157,7 @@ std::list<face_t *> SubdivideFace(face_t *f)
static void FreeNode(node_t *node) static void FreeNode(node_t *node)
{ {
FreeAllPortals(node); FreeTreePortals_r(node);
for (face_t *f : node->facelist) { for (face_t *f : node->facelist) {
delete f; delete f;
} }