MiniDoom

src/r_draw.ml

Rasterizes software wall columns, spans, fuzz, translated sprites, and depth-tested pixels into the active view buffer.

Package
(global)
Reachable
Yes

Imports

Declarations

_RD_CenterY

inline function _RD_CenterY()

Returns the configured projection center or the logical screen midpoint when view setup has not supplied one.

View source

_RD_DepthPass

inline function _RD_DepthPass(di)

Always accepts a pixel because visibility is already resolved by BSP and sprite draw order in the software renderer.

ParameterTypeDefaultDescription
didynamic—Di value supplied to `_RD_DepthPass`.

View source

_RD_DepthStore

inline function _RD_DepthStore(di)

Retains the depth-write call site for alternate backends while intentionally storing nothing in the painter-ordered path.

ParameterTypeDefaultDescription
didynamic—Di value supplied to `_RD_DepthStore`.

View source

_RD_DrawPatchIfExists

inline function _RD_DrawPatchIfExists(x, y, scrn, name)

Resolves and draws an optional named border patch without failing when an IWAD omits it.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
scrndynamic—Scrn value supplied to `_RD_DrawPatchIfExists`.
namedynamic—Resource or object name to resolve.

View source

_RD_FlatSampleCoord

inline function _RD_FlatSampleCoord(frac, size)

Maps Doom's fixed 64x64 flat coordinate into a variable-size source image.

ParameterTypeDefaultDescription
fracdynamic—Frac value supplied to `_RD_FlatSampleCoord`.
sizedynamic—Requested size in bytes or elements.

View source

_RD_IDiv

inline function _RD_IDiv(a, b)

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

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

View source

_RD_IsPow2

inline function _RD_IsPow2(n)

Tests whether a positive texture dimension permits bit-mask wrapping.

ParameterTypeDefaultDescription
ndynamic—Number of values to process.

View source

_rd_prof_col_calls

_rd_prof_col_calls

Tracks the mutable rd prof col calls value used by the r draw subsystem.

View source

_rd_prof_col_pixels

_rd_prof_col_pixels

Tracks the mutable rd prof col pixels value used by the r draw subsystem.

View source

_rd_prof_enabled

_rd_prof_enabled

Tracks whether rd prof enabled is active in the r draw subsystem.

View source

_rd_prof_span_calls

_rd_prof_span_calls

Tracks the mutable rd prof span calls value used by the r draw subsystem.

View source

_rd_prof_span_pixels

_rd_prof_span_pixels

Tracks the mutable rd prof span pixels value used by the r draw subsystem.

View source

_RD_TargetBuffer

inline function _RD_TargetBuffer()

Returns the active render target buffer.

View source

_RD_TargetHeight

inline function _RD_TargetHeight()

Returns the active render target height.

View source

_RD_TargetWidth

inline function _RD_TargetWidth()

Returns the active render target width.

View source

_RD_WrapIndex

inline function _RD_WrapIndex(i, n)

Wraps positive or negative texture indices into a validated source period.

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

View source

columnofs

columnofs

Stores the columnofs collection used by the r draw subsystem.

View source

dc_colormap

dc_colormap

Tracks the mutable dc colormap value used by the r draw subsystem.

View source

dc_iscale

dc_iscale

Tracks the mutable dc iscale value used by the r draw subsystem.

View source

dc_source

dc_source

Tracks the mutable dc source value used by the r draw subsystem.

View source

dc_sourcebase

dc_sourcebase

Holds the optional dc sourcebase resource used by the r draw subsystem.

View source

dc_sourceclamp

dc_sourceclamp

Tracks whether dc sourceclamp is active in the r draw subsystem.

View source

dc_sourcelen

dc_sourcelen

Tracks the mutable dc sourcelen value used by the r draw subsystem.

View source

dc_sourceoff

dc_sourceoff

Tracks the mutable dc sourceoff value used by the r draw subsystem.

View source

dc_texturemid

dc_texturemid

Tracks the mutable dc texturemid value used by the r draw subsystem.

View source

dc_translation

dc_translation

Tracks the mutable dc translation value used by the r draw subsystem.

View source

dc_x

dc_x

Tracks the mutable dc x value used by the r draw subsystem.

View source

dc_yh

dc_yh

Tracks the mutable dc yh value used by the r draw subsystem.

View source

dc_yl

dc_yl

Tracks the mutable dc yl value used by the r draw subsystem.

View source

ds_colormap

ds_colormap

Tracks the mutable ds colormap value used by the r draw subsystem.

View source

ds_source

ds_source

Tracks the mutable ds source value used by the r draw subsystem.

View source

ds_source_height

ds_source_height

Tracks the mutable ds source height value used by the r draw subsystem.

View source

ds_source_width

ds_source_width

Tracks the mutable ds source width value used by the r draw subsystem.

View source

ds_x1

ds_x1

Tracks the mutable ds x1 value used by the r draw subsystem.

View source

ds_x2

ds_x2

Tracks the mutable ds x2 value used by the r draw subsystem.

View source

ds_xfrac

ds_xfrac

Tracks the mutable ds xfrac value used by the r draw subsystem.

View source

ds_xstep

ds_xstep

Tracks the mutable ds xstep value used by the r draw subsystem.

View source

ds_y

ds_y

Tracks the mutable ds y value used by the r draw subsystem.

View source

ds_yfrac

ds_yfrac

Tracks the mutable ds yfrac value used by the r draw subsystem.

View source

ds_ystep

ds_ystep

Tracks the mutable ds ystep value used by the r draw subsystem.

View source

fuzzoffset

fuzzoffset

Stores the fuzzoffset collection used by the r draw subsystem.

View source

fuzzpos

fuzzpos

Tracks the mutable fuzzpos value used by the r draw subsystem.

View source

FUZZTABLE

const FUZZTABLE = 50

Defines fuzztable for the r draw subsystem.

View source

R_DepthBeginSprite

function R_DepthBeginSprite(scale)

Accepts the projected sprite scale for depth-aware renderer compatibility; painter ordering makes it a no-op here.

ParameterTypeDefaultDescription
scaledynamic—Scale value supplied to `R_DepthBeginSprite`.

View source

R_DepthBeginWall

function R_DepthBeginWall(scale)

Accepts the projected wall scale for depth-aware renderer compatibility; painter ordering makes it a no-op here.

ParameterTypeDefaultDescription
scaledynamic—Scale value supplied to `R_DepthBeginWall`.

View source

R_DepthClear

function R_DepthClear()

Preserves the depth-buffer reset hook used by renderer callers; the current painter-ordered software path requires no separate buffer.

View source

R_DepthEndSprite

function R_DepthEndSprite()

Closes the compatibility scope opened for a sprite column without changing software draw state.

View source

R_DepthEndWall

function R_DepthEndWall()

Closes the compatibility scope opened for a wall column; no state is retained by the painter-ordered path.

View source

R_DrawColumn

function R_DrawColumn()

Samples a vertically stepped texture column through the active colormap into one clipped high-detail screen column.

View source

R_DrawColumnLow

function R_DrawColumnLow()

Draws a low-detail texture column by duplicating each logical sample across two horizontal target pixels.

View source

R_DrawFuzzColumn

function R_DrawFuzzColumn()

Produces the spectre effect by copying neighboring framebuffer samples through the fuzz colormap while advancing the cyclic fuzz offset.

View source

R_DrawFuzzColumnLow

function R_DrawFuzzColumnLow()

Applies the fuzz-neighbor effect to a doubled low-detail column.

View source

R_DrawProfileReset

function R_DrawProfileReset()

Clears draw Profile Reset state before the next software drawing update.

View source

R_DrawProfileSetEnabled

function R_DrawProfileSetEnabled(on)

Enables or disables software column/span counters without changing the active draw-function bindings.

ParameterTypeDefaultDescription
ondynamic—On value supplied to `R_DrawProfileSetEnabled`.

View source

R_DrawSpan

function R_DrawSpan()

Perspective-steps texture coordinates across one horizontal floor/ceiling span and writes colormapped samples to the active target.

View source

R_DrawSpanLow

function R_DrawSpanLow()

Draws a perspective-correct flat span with horizontally doubled samples for low-detail mode.

View source

R_DrawTranslatedColumn

function R_DrawTranslatedColumn()

Remaps each texture texel through the active player-color translation before applying the lighting colormap.

View source

R_DrawTranslatedColumnLow

function R_DrawTranslatedColumnLow()

Draws a player-color-translated column with each result duplicated for low-detail mode.

View source

R_DrawViewBorder

function R_DrawViewBorder()

Copies only the cached top, bottom, and side border regions around a reduced view into the foreground screen.

View source

R_FillBackScreen

function R_FillBackScreen()

Tiles the game-mode border flat into the background screen and surrounds a reduced view with optional border patches.

View source

R_InitBuffer

function R_InitBuffer(width, height)

Recomputes view-window offsets plus per-row and per-column destination lookup tables for the active render target size.

ParameterTypeDefaultDescription
widthdynamic—Width of the target in pixels or map units.
heightdynamic—Height of the target in pixels or map units.

View source

R_InitTranslationTables

function R_InitTranslationTables()

Precomputes the three Doom player-color remaps while leaving every non-green palette index unchanged.

View source

R_VideoErase

function R_VideoErase(ofs, count)

Restores a clipped byte range in the foreground screen from the cached background screen.

ParameterTypeDefaultDescription
ofsdynamic—Ofs value supplied to `R_VideoErase`.
countdynamic—Number of elements or iterations to process.

View source

RD_FLAT_PERIOD_MASK

const RD_FLAT_PERIOD_MASK = 4194303

Defines rd flat period mask for the r draw subsystem.

View source

SBARHEIGHT

const SBARHEIGHT = 32

Defines sbarheight for the r draw subsystem.

View source

translationtables

translationtables

Tracks the mutable translationtables value used by the r draw subsystem.

View source

ylookup

ylookup

Stores the ylookup collection used by the r draw subsystem.

View source