shithub: nanobsp

Download patch

ref: d3a77733f886d51c879e324d7c87baf4635de5e0
parent: 81c7d03b48a5a15c16a93e4c39bf2508e91fcdff
author: Andrew Apted <ajapted@gmail.com>
date: Fri Dec 15 13:55:02 EST 2023

updated README for this reworked version.

--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
 About
 -----
 
-This is a project to make a simple node-builder which can be plugged
+This is a project to make a simple node-builder which can be dropped
 into an existing DOOM code-base, and build nodes at level-load time.
 It is written in C, and uses fixed-point math (no FPU required).
 
@@ -28,8 +28,14 @@
 the nodes are even slightly different.
 
 
-Engine changes
---------------
+Status
+------
+
+Finished, working, usable.
+
+
+Using this code in a DOOM port
+------------------------------
 
 The bulk of my node-building code is in two new source files:
 ```
@@ -37,16 +43,18 @@
     nano_bsp.h
 ```
 
-However, several other parts of the engine need to be updated, due to
-the changes to the *node_t* and *subsector_t* types in the `r_defs.h`
-header file, since these structs no longer exist in one big array,
-but now get allocated individually and linked via pointers.
+So firstly (and obviously) those files need to be added.
 
-The following functions need to be updated:
--  R_RenderBSPNode() and R_Subsector() in `r_bsp.c`
--  R_PointInSubsector() in `r_main.c`
--  P_CrossBSPNode() and P_CrossSubsector() in `p_sight.c`
--  P_LoadSegs(), P_LoadSubsectors(), P_LoadNodes() in `p_setup.c`
+Secondly, the *seg_t* struct in `r_defs.h` needs two new fields, `side`
+and `next`.  Look at that file in this repository and copy'n'paste
+those fields.
+
+Finally, add `#include "nano_bsp.h"` to p_setup.c, and within the
+P_SetupLevel function call `BSP_BuildNodes()`.  In this code-base, it
+is always called unless explicitly disabled by a command-line option
+or when playing back demos.  In your code-base, you may want to only
+invoke it when the map is lacking nodes, and/or give users a config
+setting to explictly enable it.
 
 
 About this repository
--