MiniDoom

src/r_plane.ml

Aggregates visible floor, ceiling, and sky regions into visplanes and rasterizes their horizontal spans or sky columns.

Package
(global)
Reachable
Yes

Imports

Declarations

_RP_Abs

inline function _RP_Abs(v)

Returns the non-negative integer magnitude of a possibly non-integer plane value.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_RP_AngNorm

inline function _RP_AngNorm(a)

Normalizes a coerced angle to Doom's unsigned 32-bit binary-angle domain.

ParameterTypeDefaultDescription
adynamic—First input operand.

View source

_rp_default_colormap

_rp_default_colormap

Holds the optional rp default colormap resource used by the r plane subsystem.

View source

_RP_DefaultColorMap

inline function _RP_DefaultColorMap()

Caches the first 256-byte colormap for unlit sky columns, falling back to a zeroed map when assets are absent.

View source

_RP_DrawVisplanes

function _RP_DrawVisplanes()

Rasterizes queued sky visplanes as vertical texture columns and ordinary flats as lit horizontal spans, updating profile counts.

View source

_RP_EnsurePlaneCapacity

function _RP_EnsurePlaneCapacity(needIndex)

Geometrically grows reusable visplane storage up to a hard safety limit and initializes every new slot.

ParameterTypeDefaultDescription
needIndexdynamic—Index identifying need.

View source

_RP_FineAt

inline function _RP_FineAt(tab, idx)

Samples a fine-angle lookup table with wraparound and returns zero when the table is unavailable.

ParameterTypeDefaultDescription
tabdynamic—Tab value supplied to `_RP_FineAt`.
idxdynamic—Zero-based element or table index.

View source

_RP_I

inline function _RP_I(v, fallback)

Coerces numeric values to truncation-toward-zero integers and returns a caller fallback on conversion failure.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.
fallbackdynamic—Value returned when the requested conversion or lookup is unavailable.

View source

_RP_IDiv

inline function _RP_IDiv(a, b)

Returns a signed quotient truncated toward zero, or zero for invalid operands and a zero divisor in `_RP_IDiv`

ParameterTypeDefaultDescription
adynamic—First input operand.
bdynamic—Second input operand.

View source

_RP_IsSeq

inline function _RP_IsSeq(v)

Recognizes both array and list containers accepted by plane tables and geometry records.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_RP_NewPlane

inline function _RP_NewPlane(height, picnum, lightlevel)

Constructs an unused visplane with target-width top/bottom arrays and sentinel horizontal bounds.

ParameterTypeDefaultDescription
heightdynamic—Height of the target in pixels or map units.
picnumdynamic—Index identifying pic.
lightleveldynamic—Lightlevel value supplied to `_RP_NewPlane`.

View source

_rp_prof_mapplane_calls

_rp_prof_mapplane_calls

Tracks the mutable rp prof mapplane calls value used by the r plane subsystem.

View source

_rp_prof_visplanes_flat

_rp_prof_visplanes_flat

Tracks the mutable rp prof visplanes flat value used by the r plane subsystem.

View source

_rp_prof_visplanes_sky

_rp_prof_visplanes_sky

Tracks the mutable rp prof visplanes sky value used by the r plane subsystem.

View source

_rp_prof_visplanes_total

_rp_prof_visplanes_total

Tracks the mutable rp prof visplanes total value used by the r plane subsystem.

View source

_RP_RecomputeSlopeTables

function _RP_RecomputeSlopeTables()

Rebuilds row distance slopes and per-column perspective correction factors for the active view geometry.

View source

_RP_ResetPlane

function _RP_ResetPlane(pl, height, picnum, lightlevel, minx, maxx)

Recycles a visplane for new height, texture, and light keys while clearing every covered-column marker.

ParameterTypeDefaultDescription
pldynamic—Pl value supplied to `_RP_ResetPlane`.
heightdynamic—Height of the target in pixels or map units.
picnumdynamic—Index identifying pic.
lightleveldynamic—Lightlevel value supplied to `_RP_ResetPlane`.
minxdynamic—Minx value supplied to `_RP_ResetPlane`.
maxxdynamic—Maxx value supplied to `_RP_ResetPlane`.

View source

_RP_TargetHeight

inline function _RP_TargetHeight()

Returns active world render height.

View source

_RP_TargetWidth

inline function _RP_TargetWidth()

Returns active world render width.

View source

basexscale

basexscale

Tracks the mutable basexscale value used by the r plane subsystem.

View source

baseyscale

baseyscale

Tracks the mutable baseyscale value used by the r plane subsystem.

View source

cacheddistance

cacheddistance

Stores the cacheddistance collection used by the r plane subsystem.

View source

cachedheight

cachedheight

Stores the cachedheight collection used by the r plane subsystem.

View source

cachedxstep

cachedxstep

Stores the cachedxstep collection used by the r plane subsystem.

View source

cachedystep

cachedystep

Stores the cachedystep collection used by the r plane subsystem.

View source

ceilingclip

ceilingclip

Stores the ceilingclip collection used by the r plane subsystem.

View source

ceilingfunc_t

ceilingfunc_t

Holds the optional ceilingfunc t resource used by the r plane subsystem.

View source

ceilingplane

ceilingplane

Holds the optional ceilingplane resource used by the r plane subsystem.

View source

distscale

distscale

Stores the distscale collection used by the r plane subsystem.

View source

floorclip

floorclip

Stores the floorclip collection used by the r plane subsystem.

View source

floorfunc

floorfunc

Holds the optional floorfunc resource used by the r plane subsystem.

View source

floorplane

floorplane

Holds the optional floorplane resource used by the r plane subsystem.

View source

lastopening

lastopening

Holds the optional lastopening resource used by the r plane subsystem.

View source

MAXOPENINGS

const MAXOPENINGS = SCREENWIDTH * 64

Defines the maximum maxopenings accepted by the r plane subsystem.

View source

MAXVISPLANES

const MAXVISPLANES = 128

Defines the maximum maxvisplanes accepted by the r plane subsystem.

View source

openings

openings

Stores the openings collection used by the r plane subsystem.

View source

planeheight

planeheight

Tracks the mutable planeheight value used by the r plane subsystem.

View source

planezlight

planezlight

Holds the optional planezlight resource used by the r plane subsystem.

View source

R_CheckPlane

function R_CheckPlane(pl, start, stop)

Extends a visplane across unused columns or splits it into a duplicate when the requested range overlaps existing spans.

ParameterTypeDefaultDescription
pldynamic—Pl value supplied to `R_CheckPlane`.
startdynamic—Start value supplied to `R_CheckPlane`.
stopdynamic—Stop value supplied to `R_CheckPlane`.

View source

R_ClearPlanes

function R_ClearPlanes()

Resets per-column floor/ceiling clips and visplane allocation, invalidates row caches, and derives view-relative texture scales.

View source

R_DrawPlanes

function R_DrawPlanes()

Executes the queued visplane rasterization pass after wall clipping has finalized visible column bounds.

View source

R_FindPlane

function R_FindPlane(height, picnum, lightlevel)

Reuses a visplane with matching height, texture, and light keys or allocates a cleared entry for a new region.

ParameterTypeDefaultDescription
heightdynamic—Height of the target in pixels or map units.
picnumdynamic—Index identifying pic.
lightleveldynamic—Lightlevel value supplied to `R_FindPlane`.

View source

R_InitPlanes

function R_InitPlanes()

Sizes clipping, slope, span, opening, cache, and visplane workspaces for the active logical or HD render target.

View source

R_MakeSpans

function R_MakeSpans(x, t1, b1, t2, b2)

Compares adjacent visplane column bounds, closes rows that ended, and records starting columns for newly opened rows.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
t1dynamic—T1 value supplied to `R_MakeSpans`.
b1dynamic—B1 value supplied to `R_MakeSpans`.
t2dynamic—T2 value supplied to `R_MakeSpans`.
b2dynamic—B2 value supplied to `R_MakeSpans`.

View source

R_MapPlane

function R_MapPlane(y, x1, x2)

Derives perspective distance, texture stepping, origin, and lighting for one horizontal plane span before rasterization.

ParameterTypeDefaultDescription
ydynamic—Vertical map- or screen-space coordinate.
x1dynamic—Horizontal coordinate of the first endpoint.
x2dynamic—Horizontal coordinate of the second endpoint.

View source

RP_MAXVISPLANES_HARD

const RP_MAXVISPLANES_HARD = 4096

Defines the maximum rp maxvisplanes hard accepted by the r plane subsystem.

View source

RP_SPAN_SENTINEL

const RP_SPAN_SENTINEL = 2147483647

Defines rp span sentinel for the r plane subsystem.

View source

spanstart

spanstart

Stores the spanstart collection used by the r plane subsystem.

View source

spanstop

spanstop

Stores the spanstop collection used by the r plane subsystem.

View source

visplanes

visplanes

Stores the visplanes collection used by the r plane subsystem.

View source

visplanes_last

visplanes_last

Tracks the mutable visplanes last value used by the r plane subsystem.

View source

yslope

yslope

Stores the yslope collection used by the r plane subsystem.

View source