Files
src/r_bsp.ml
Traverses front-to-back BSP nodes, culls occluded child bounds, and clips wall segments against solid screen ranges.
- Package
(global)- Reachable
- Yes
Imports
Declarations
# _makeClip
inline function _makeClip(first, last)
Constructs one inclusive solid-column interval for the occlusion list.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | First value supplied to `_makeClip`. |
last | dynamic | — | Last value supplied to `_makeClip`. |
View source
# _makeDrawseg
inline function _makeDrawseg()
Constructs an empty draw-segment record used to preallocate the reusable masked-sprite clipping table.
View source
# _R_ClipGet
inline function _R_ClipGet(i)
Returns a solid clip interval by index, substituting an empty sentinel for invalid access.
| Parameter | Type | Default | Description |
|---|
i | dynamic | — | Zero-based iteration index. |
View source
# _R_ClipSet
inline function _R_ClipSet(i, c)
Replaces or appends a solid clip interval, growing intermediate slots with empty sentinels.
| Parameter | Type | Default | Description |
|---|
i | dynamic | — | Zero-based iteration index. |
c | dynamic | — | C value supplied to `_R_ClipSet`. |
View source
# _R_ViewAngleToX
inline function _R_ViewAngleToX(aidx)
Clamps a fine view-angle index and maps it to a projected screen column, falling back to view center when unavailable.
| Parameter | Type | Default | Description |
|---|
aidx | dynamic | — | Aidx value supplied to `_R_ViewAngleToX`. |
View source
# _rb_prof_addline_calls
_rb_prof_addline_calls
Tracks the mutable rb prof addline calls value used by the r bsp subsystem.
View source
# _rb_prof_addline_ms
_rb_prof_addline_ms
Tracks the mutable rb prof addline ms value used by the r bsp subsystem.
View source
# _rb_prof_bbox_calls
_rb_prof_bbox_calls
Tracks the mutable rb prof bbox calls value used by the r bsp subsystem.
View source
# _rb_prof_bbox_ms
_rb_prof_bbox_ms
Tracks the mutable rb prof bbox ms value used by the r bsp subsystem.
View source
# _rb_prof_enabled
_rb_prof_enabled
Tracks whether rb prof enabled is active in the r bsp subsystem.
View source
# _rb_prof_newend_max
_rb_prof_newend_max
Tracks the mutable rb prof newend max value used by the r bsp subsystem.
View source
# _rb_prof_node_calls
_rb_prof_node_calls
Tracks the mutable rb prof node calls value used by the r bsp subsystem.
View source
# _rb_prof_pointonside_calls
_rb_prof_pointonside_calls
Tracks the mutable rb prof pointonside calls value used by the r bsp subsystem.
View source
# _rb_prof_pointonside_ms
_rb_prof_pointonside_ms
Tracks the mutable rb prof pointonside ms value used by the r bsp subsystem.
View source
# _rb_prof_revspans
_rb_prof_revspans
Tracks the mutable rb prof revspans value used by the r bsp subsystem.
View source
# _rb_prof_segloop_ms
_rb_prof_segloop_ms
Tracks the mutable rb prof segloop ms value used by the r bsp subsystem.
View source
# _rb_prof_store_calls
_rb_prof_store_calls
Tracks the mutable rb prof store calls value used by the r bsp subsystem.
View source
# _rb_prof_store_ms
_rb_prof_store_ms
Tracks the mutable rb prof store ms value used by the r bsp subsystem.
View source
# _rb_prof_subsector_calls
_rb_prof_subsector_calls
Tracks the mutable rb prof subsector calls value used by the r bsp subsystem.
View source
# _RBSP_AngNorm
inline function _RBSP_AngNorm(a)
Normalizes a coerced angle to Doom's unsigned 32-bit binary-angle domain.
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | First input operand. |
View source
# _RBSP_AngSub
inline function _RBSP_AngSub(a, b)
Subtracts two binary angles with explicit unsigned 32-bit wraparound.
| Parameter | Type | Default | Description |
|---|
a | dynamic | — | First input operand. |
b | dynamic | — | Second input operand. |
View source
# _rbsp_disable_bbox_cull
_rbsp_disable_bbox_cull
Tracks whether rbsp disable bbox cull is active in the r bsp subsystem.
View source
# _RBSP_IsSeq
inline function _RBSP_IsSeq(v)
Recognizes both array and list containers accepted by BSP geometry and lookup tables.
| Parameter | Type | Default | Description |
|---|
v | dynamic | — | Value consumed by the operation. |
View source
# _RBSP_StoreWallRange
inline function _RBSP_StoreWallRange(first, last)
Delegates a visible wall-column range and, when profiling is active, accumulates its storage time and call count.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | First value supplied to `_RBSP_StoreWallRange`. |
last | dynamic | — | Last value supplied to `_RBSP_StoreWallRange`. |
View source
# _RBSP_TimeMs
inline function _RBSP_TimeMs()
Returns the runtime tick clock as a truncation-toward-zero integer for BSP profiling deltas.
View source
# _RBSP_ToInt
inline function _RBSP_ToInt(v, fallback)
Coerces numeric values to truncation-toward-zero integers and returns a caller fallback on conversion failure.
| Parameter | Type | Default | Description |
|---|
v | dynamic | — | Value consumed by the operation. |
fallback | dynamic | — | Value returned when the requested conversion or lookup is unavailable. |
View source
# backsector
backsector
Holds the optional backsector resource used by the r bsp subsystem.
View source
# checkcoord
checkcoord
Stores the checkcoord collection used by the r bsp subsystem.
View source
cliprange_t struct
# curline
curline
Holds the optional curline resource used by the r bsp subsystem.
View source
# drawsegs
drawsegs
Stores the drawsegs collection used by the r bsp subsystem.
View source
# ds_p
ds_p
Tracks the mutable ds p value used by the r bsp subsystem.
View source
# dscalelight
dscalelight
Holds the optional dscalelight resource used by the r bsp subsystem.
View source
# frontsector
frontsector
Holds the optional frontsector resource used by the r bsp subsystem.
View source
# hscalelight
hscalelight
Holds the optional hscalelight resource used by the r bsp subsystem.
View source
# linedef
linedef
Holds the optional linedef resource used by the r bsp subsystem.
View source
# markceiling
markceiling
Tracks whether markceiling is active in the r bsp subsystem.
View source
# markfloor
markfloor
Tracks whether markfloor is active in the r bsp subsystem.
View source
# MAXSEGS
const MAXSEGS = 32
Defines the maximum maxsegs accepted by the r bsp subsystem.
View source
# newend
newend
Tracks the mutable newend value used by the r bsp subsystem.
View source
# R_AddLine
function R_AddLine(line)
Adds line entries to the renderer.
| Parameter | Type | Default | Description |
|---|
line | dynamic | — | Map line or text line affected by the operation. |
View source
# R_BspProfileReset
function R_BspProfileReset()
Zeros every BSP timing, call-count, span, and peak-clip statistic before a new measurement window.
View source
# R_BspProfileSetEnabled
function R_BspProfileSetEnabled(on)
Enables or disables collection of BSP traversal, clipping, and wall-storage timing counters.
| Parameter | Type | Default | Description |
|---|
on | dynamic | — | On value supplied to `R_BspProfileSetEnabled`. |
View source
# R_CheckBBox
function R_CheckBBox(bspcoord)
Projects the visible corners of a BSP child bound and rejects it only when its complete screen span is already occluded.
| Parameter | Type | Default | Description |
|---|
bspcoord | dynamic | — | Bspcoord value supplied to `R_CheckBBox`. |
View source
# R_ClearClipSegs
function R_ClearClipSegs()
Resets solid-wall occlusion to left and right offscreen sentinels and records the baseline peak when profiling.
View source
# R_ClearDrawSegs
function R_ClearDrawSegs()
Rewinds draw-segment allocation for a frame and lazily seeds the reusable table to its baseline capacity.
View source
# R_ClipPassWallSegment
function R_ClipPassWallSegment(first, last)
Computes pass wall segment values for the renderer.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | First value supplied to `R_ClipPassWallSegment`. |
last | dynamic | — | Last value supplied to `R_ClipPassWallSegment`. |
View source
# R_ClipSolidWallSegment
function R_ClipSolidWallSegment(first, last)
Emits visible portions of a solid wall range, then merges that range into the ordered screen-space occlusion intervals.
| Parameter | Type | Default | Description |
|---|
first | dynamic | — | First value supplied to `R_ClipSolidWallSegment`. |
last | dynamic | — | Last value supplied to `R_ClipSolidWallSegment`. |
View source
# R_RenderBSPNode
function R_RenderBSPNode(bspnum)
Recurses front-to-back through a BSP node, always renders the near child, and visits the far child only if its bound remains visible.
| Parameter | Type | Default | Description |
|---|
bspnum | dynamic | — | Index identifying bsp. |
View source
# R_Subsector
function R_Subsector(num)
Selects visible floor/ceiling planes, queues sector sprites, and submits every seg belonging to one BSP leaf.
| Parameter | Type | Default | Description |
|---|
num | dynamic | — | Index identifying the requested item. |
View source
# rw_stopx
rw_stopx
Tracks the mutable rw stopx value used by the r bsp subsystem.
View source
# rw_x
rw_x
Tracks the mutable rw x value used by the r bsp subsystem.
View source
# segtextured
segtextured
Tracks whether segtextured is active in the r bsp subsystem.
View source
# sidedef
sidedef
Holds the optional sidedef resource used by the r bsp subsystem.
View source
# skymap
skymap
Tracks whether skymap is active in the r bsp subsystem.
View source
# solidsegs
solidsegs
Stores the solidsegs collection used by the r bsp subsystem.
View source
# vscalelight
vscalelight
Holds the optional vscalelight resource used by the r bsp subsystem.
View source