qbsp: fix ConvertNodeToLeaf, move MakeMarkFaces
This commit is contained in:
parent
cab51405d6
commit
eee96576dc
|
|
@ -570,12 +570,6 @@ static void ProcessEntity(mapentity_t *entity, const int hullnum)
|
|||
|
||||
MakeVisibleFaces(entity, nodes);
|
||||
|
||||
// fixme-brushbsp: only here for testing, was inside FillOutside if()
|
||||
MergeAll(nodes);
|
||||
|
||||
// needs to come after any face creation
|
||||
MakeMarkFaces(entity, nodes);
|
||||
|
||||
// build all the portals in the bsp tree
|
||||
// some portals are solid polygons, and some are paths to other leafs
|
||||
if (entity == pWorldEnt()) {
|
||||
|
|
@ -624,6 +618,9 @@ static void ProcessEntity(mapentity_t *entity, const int hullnum)
|
|||
// convert detail leafs to solid (in case we didn't make the call above)
|
||||
DetailToSolid(nodes);
|
||||
|
||||
// needs to come after any face creation
|
||||
MakeMarkFaces(entity, nodes);
|
||||
|
||||
if (options.fObjExport && entity == pWorldEnt()) {
|
||||
ExportObj_Nodes("pre_makefaceedges_plane_faces", nodes);
|
||||
ExportObj_Marksurfaces("pre_makefaceedges_marksurfaces", nodes);
|
||||
|
|
|
|||
|
|
@ -45,16 +45,17 @@ static int mapbrushes;
|
|||
|
||||
void ConvertNodeToLeaf(node_t *node, const contentflags_t &contents)
|
||||
{
|
||||
// backup the mins/maxs
|
||||
aabb3d bounds = node->bounds;
|
||||
|
||||
// zero it
|
||||
memset(node, 0, sizeof(*node));
|
||||
|
||||
// restore relevant fields
|
||||
node->bounds = bounds;
|
||||
|
||||
node->planenum = PLANENUM_LEAF;
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
delete node->children[i];
|
||||
node->children[i] = nullptr;
|
||||
}
|
||||
for (auto *face : node->facelist) {
|
||||
delete face;
|
||||
}
|
||||
node->facelist = {};
|
||||
|
||||
node->contents = contents;
|
||||
|
||||
Q_assert(node->markfaces.empty());
|
||||
|
|
|
|||
Loading…
Reference in New Issue