ref: d8c7c055604b45a5d883f7d32e49e11487dca7ae
parent: a18bb0e972ae3454cfff73eea88bb868292761d6
author: Andrew Apted <ajapted@gmail.com>
date: Fri Dec 8 19:24:27 EST 2023
added stub functions for those missing pieces, to do shortly....
--- a/nano_bsp.c
+++ b/nano_bsp.c
@@ -121,7 +121,6 @@
(*list_var) = seg;
}
-
seg_t * BSP_CreateSegs (void)
{seg_t * list = NULL;
@@ -136,7 +135,6 @@
return list;
}
-
nnode_t * BSP_CreateLeaf (seg_t * soup)
{nsubsec_t * sub = BSP_NewSubsector ();
@@ -149,13 +147,58 @@
return N;
}
+//----------------------------------------------------------------------------
+struct NodeEval
+{+ int left, right, split;
+};
+
+//
+// Evaluate a seg as a partition candidate, storing the results in `eval`.
+// returns true if the partition is viable, false otherwise.
+//
+boolean BSP_EvalPartition (seg_t * part, seg_t * soup, struct NodeEval * eval)
+{+ // TODO
+
+ return false;
+}
+
+//
+// Look for an axis-aligned seg which can divide the other segs in a
+// "nice" way. returns NULL if none found.
+//
+seg_t * BSP_PickNode_Fast (seg_t * soup)
+{+ // TODO
+ return NULL;
+}
+
+//
+// Evaluate *every* seg in the list as a partition candidate,
+// returning the best one, or NULL if none found (which means
+// the remaining segs form a subsector).
+//
+seg_t * BSP_PickNode_Slow (seg_t * soup)
+{+ // TODO
+ return NULL;
+}
+
+//----------------------------------------------------------------------------
+
+void BSP_SplitSegs (seg_t * part, seg_t * soup, seg_t ** lefts, seg_t ** rights)
+{+ // TODO
+}
+
nnode_t * BSP_SubdivideSegs (seg_t * soup)
{seg_t * part = BSP_PickNode_Fast (soup);
if (part == NULL)
- part = BSP_PickNode_Normal (soup);
+ part = BSP_PickNode_Slow (soup);
if (part == NULL)
return BSP_CreateLeaf (soup);
--
⑨