MiniDoom

src/r_segs.ml

Projects BSP wall segments into columns, maintains clip openings, and defers masked middle textures.

Package
(global)
Reachable
Yes

Imports

Declarations

_RS_Abs

inline function _RS_Abs(v)

Returns the non-negative integer magnitude of a numeric wall-renderer input.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_RS_AllocIntList

inline function _RS_AllocIntList(n, fill)

Allocates an integer list of a requested length initialized to one sentinel value.

ParameterTypeDefaultDescription
ndynamic—Number of values to process.
filldynamic—Fill value supplied to `_RS_AllocIntList`.

View source

_RS_AllocMaskedCols

function _RS_AllocMaskedCols(start, stop)

Reserves an inclusive masked-column range in openings, initializes MAXSHORT sentinels, and returns an x-biased reference.

ParameterTypeDefaultDescription
startdynamic—Start value supplied to `_RS_AllocMaskedCols`.
stopdynamic—Stop value supplied to `_RS_AllocMaskedCols`.

View source

_RS_AngNorm

inline function _RS_AngNorm(a)

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

ParameterTypeDefaultDescription
adynamic—First input operand.

View source

_RS_AngSub

inline function _RS_AngSub(a, b)

Subtracts two binary angles with unsigned 32-bit wraparound.

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

View source

_RS_Clamp

inline function _RS_Clamp(v, lo, hi)

Constrains a wall-rendering scalar to the supplied inclusive bounds.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.
lodynamic—Inclusive lower bound.
hidynamic—Inclusive upper bound.

View source

_RS_ClampIndex

inline function _RS_ClampIndex(i, n)

Clamps an index to the first or last entry of a non-empty lookup table.

ParameterTypeDefaultDescription
idynamic—Zero-based iteration index.
ndynamic—Number of values to process.

View source

_RS_CopyClipToOpenings

function _RS_CopyClipToOpenings(src, start, stop, fallback)

Copies an inclusive screen-column clip range into the openings arena and returns an x-biased reference.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_RS_CopyClipToOpenings`.
startdynamic—Start value supplied to `_RS_CopyClipToOpenings`.
stopdynamic—Stop value supplied to `_RS_CopyClipToOpenings`.
fallbackdynamic—Value returned when the requested conversion or lookup is unavailable.

View source

_RS_DrawMaskedTextureColumn

function _RS_DrawMaskedTextureColumn(x, texnum, texturecolumn, texturemid, yscale, topclip, bottomclip)

Decodes patch posts for one masked wall column, clips each post, draws with depth state, and restores shared column inputs.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
texnumdynamic—Index identifying tex.
texturecolumndynamic—Texturecolumn value supplied to `_RS_DrawMaskedTextureColumn`.
texturemiddynamic—Texturemid value supplied to `_RS_DrawMaskedTextureColumn`.
yscaledynamic—Yscale value supplied to `_RS_DrawMaskedTextureColumn`.
topclipdynamic—Topclip value supplied to `_RS_DrawMaskedTextureColumn`.
bottomclipdynamic—Bottomclip value supplied to `_RS_DrawMaskedTextureColumn`.

View source

_RS_DrawTexturedRange

function _RS_DrawTexturedRange(fb, x, y1, y2, texnum, texCol, cmap)

Scales one opaque texture column across a bounded vertical framebuffer range using a lighting colormap.

ParameterTypeDefaultDescription
fbdynamic—Fb value supplied to `_RS_DrawTexturedRange`.
xdynamic—Horizontal map- or screen-space coordinate.
y1dynamic—Vertical coordinate of the first endpoint.
y2dynamic—Vertical coordinate of the second endpoint.
texnumdynamic—Index identifying tex.
texColdynamic—Tex col value supplied to `_RS_DrawTexturedRange`.
cmapdynamic—Cmap value supplied to `_RS_DrawTexturedRange`.

View source

_RS_EnsureOpeningsCapacity

function _RS_EnsureOpeningsCapacity(needed)

Grows the shared openings arena geometrically so a requested exclusive end offset is addressable.

ParameterTypeDefaultDescription
neededdynamic—Needed value supplied to `_RS_EnsureOpeningsCapacity`.

View source

_RS_GetClipValue

inline function _RS_GetClipValue(clipref, x, fallback)

Reads a screen-column clip from either a direct sequence or a biased offset into the openings arena.

ParameterTypeDefaultDescription
cliprefdynamic—Clipref value supplied to `_RS_GetClipValue`.
xdynamic—Horizontal map- or screen-space coordinate.
fallbackdynamic—Value returned when the requested conversion or lookup is unavailable.

View source

_RS_IDiv

inline function _RS_IDiv(a, b)

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

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

View source

_RS_IsSeq

inline function _RS_IsSeq(v)

Recognizes the array and list containers used for column clips and renderer tables.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_RS_ReadMaskedCol

inline function _RS_ReadMaskedCol(maskref, x)

Reads a deferred masked texture column through direct or openings-backed storage, defaulting to MAXSHORT.

ParameterTypeDefaultDescription
maskrefdynamic—Maskref value supplied to `_RS_ReadMaskedCol`.
xdynamic—Horizontal map- or screen-space coordinate.

View source

_RS_ResolveTexture

inline function _RS_ResolveTexture(texId)

Applies animation translation to a positive texture id and rejects invalid or out-of-table results.

ParameterTypeDefaultDescription
texIddynamic—Tex id value supplied to `_RS_ResolveTexture`.

View source

_RS_SelectWallLights

function _RS_SelectWallLights(line, sec)

Selects the scale-light row for a sector, including horizontal/vertical wall bias and fixed-colormap override.

ParameterTypeDefaultDescription
linedynamic—Map line or text line affected by the operation.
secdynamic—Sec value supplied to `_RS_SelectWallLights`.

View source

_RS_SetClipValue

inline function _RS_SetClipValue(clipref, x, value)

Writes a screen-column clip through either a direct sequence or a biased openings-arena reference.

ParameterTypeDefaultDescription
cliprefdynamic—Clipref value supplied to `_RS_SetClipValue`.
xdynamic—Horizontal map- or screen-space coordinate.
valuedynamic—Value consumed by the operation.

View source

_RS_ToInt

inline function _RS_ToInt(v, fallback)

Coerces numeric values to truncation-toward-zero integers and returns fallback on failure in `_RS_ToInt`

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

View source

_RS_WrapIndex

inline function _RS_WrapIndex(i, n)

Wraps a possibly negative index into a non-empty cyclic lookup table.

ParameterTypeDefaultDescription
idynamic—Zero-based iteration index.
ndynamic—Number of values to process.

View source

_RS_WriteMaskedCol

inline function _RS_WriteMaskedCol(maskref, x, value)

Writes a deferred masked texture column through direct or openings-backed storage.

ParameterTypeDefaultDescription
maskrefdynamic—Maskref value supplied to `_RS_WriteMaskedCol`.
xdynamic—Horizontal map- or screen-space coordinate.
valuedynamic—Value consumed by the operation.

View source

bottomfrac

bottomfrac

Tracks the mutable bottomfrac value used by the r segs subsystem.

View source

bottomstep

bottomstep

Tracks the mutable bottomstep value used by the r segs subsystem.

View source

bottomtexture

bottomtexture

Tracks the mutable bottomtexture value used by the r segs subsystem.

View source

HEIGHTBITS

const HEIGHTBITS = 12

Defines heightbits for the r segs subsystem.

View source

HEIGHTUNIT

const HEIGHTUNIT = 1 << HEIGHTBITS

Defines heightunit for the r segs subsystem.

View source

maskedtexture

maskedtexture

Tracks whether maskedtexture is active in the r segs subsystem.

View source

maskedtexturecol

maskedtexturecol

Holds the optional maskedtexturecol resource used by the r segs subsystem.

View source

midtexture

midtexture

Tracks the mutable midtexture value used by the r segs subsystem.

View source

pixhigh

pixhigh

Tracks the mutable pixhigh value used by the r segs subsystem.

View source

pixhighstep

pixhighstep

Tracks the mutable pixhighstep value used by the r segs subsystem.

View source

pixlow

pixlow

Tracks the mutable pixlow value used by the r segs subsystem.

View source

pixlowstep

pixlowstep

Tracks the mutable pixlowstep value used by the r segs subsystem.

View source

R_ClearSolidClipScales

function R_ClearSolidClipScales()

Retains the classic renderer hook; solid clip scales need no separate reset in this implementation.

View source

R_RenderMaskedSegRange

function R_RenderMaskedSegRange(ds, x1, x2)

Renders an inclusive deferred middle-texture range with pegging, scale lighting, and saved sprite clip arrays.

ParameterTypeDefaultDescription
dsdynamic—Ds value supplied to `R_RenderMaskedSegRange`.
x1dynamic—Horizontal coordinate of the first endpoint.
x2dynamic—Horizontal coordinate of the second endpoint.

View source

R_RenderSegLoop

function R_RenderSegLoop()

Projects a prepared wall range column by column, draws its wall tiers, updates plane spans, clips, and records masked columns.

View source

R_StoreWallRange

function R_StoreWallRange(start, stop)

Builds a drawseg for a visible wall range, derives textures/pegging/silhouettes, renders opaque tiers, and saves sprite clips.

ParameterTypeDefaultDescription
startdynamic—Start value supplied to `R_StoreWallRange`.
stopdynamic—Stop value supplied to `R_StoreWallRange`.

View source

RS_INV_SCALE_NUM

const RS_INV_SCALE_NUM = 4294967295

Defines the rs inv scale num count used by the r segs subsystem.

View source

rw_bottomtexturemid

rw_bottomtexturemid

Tracks the mutable rw bottomtexturemid value used by the r segs subsystem.

View source

rw_centerangle

rw_centerangle

Tracks the mutable rw centerangle value used by the r segs subsystem.

View source

rw_midtexturemid

rw_midtexturemid

Tracks the mutable rw midtexturemid value used by the r segs subsystem.

View source

rw_offset

rw_offset

Tracks the mutable rw offset value used by the r segs subsystem.

View source

rw_scale

rw_scale

Tracks the mutable rw scale value used by the r segs subsystem.

View source

rw_scalestep

rw_scalestep

Tracks the mutable rw scalestep value used by the r segs subsystem.

View source

rw_solidwall

rw_solidwall

Tracks whether rw solidwall is active in the r segs subsystem.

View source

rw_toptexturemid

rw_toptexturemid

Tracks the mutable rw toptexturemid value used by the r segs subsystem.

View source

topfrac

topfrac

Tracks the mutable topfrac value used by the r segs subsystem.

View source

topstep

topstep

Tracks the mutable topstep value used by the r segs subsystem.

View source

toptexture

toptexture

Tracks the mutable toptexture value used by the r segs subsystem.

View source

walllights

walllights

Holds the optional walllights resource used by the r segs subsystem.

View source

worldbottom

worldbottom

Tracks the mutable worldbottom value used by the r segs subsystem.

View source

worldhigh

worldhigh

Tracks the mutable worldhigh value used by the r segs subsystem.

View source

worldlow

worldlow

Tracks the mutable worldlow value used by the r segs subsystem.

View source

worldtop

worldtop

Tracks the mutable worldtop value used by the r segs subsystem.

View source