# _makeVisSprite
inline function _makeVisSprite()Allocates a zeroed visible-sprite record with no linked-list neighbors or colormap.
src/r_things.mlBuilds sprite definitions, projects world/player sprites, clips them against drawsegs, and renders masked content.
doomdef.ml → src/doomdef.mldoomstat.ml → src/doomstat.mli_system.ml → src/i_system.mlm_swap.ml → src/m_swap.mlr_hires.ml → src/r_hires.mlr_local.ml → src/r_local.mlr_upscaled.ml → src/r_upscaled.mlstd/math.ml → ../MiniLangCompilerOptimization/MiniLangCompilerPy/std/math.ml external dependencyv_video.ml → src/v_video.mlw_wad.ml → src/w_wad.mlz_zone.ml → src/z_zone.mlinline function _makeVisSprite()Allocates a zeroed visible-sprite record with no linked-list neighbors or colormap.
inline function _RT_Abs(v)Coerces a numeric value and returns its non-negative integer magnitude.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
inline function _RT_AngNorm(a)Normalizes a numeric value to Doom's unsigned 32-bit binary-angle domain.
| Parameter | Type | Default | Description |
|---|---|---|---|
a | dynamic | — | First input operand. |
function _RT_BuildSpriteDef(sprname)Scans the sprite lump namespace for a four-letter prefix, installs primary/flip pairs, and validates every frame rotation.
| Parameter | Type | Default | Description |
|---|---|---|---|
sprname | dynamic | — | Sprname value supplied to `_RT_BuildSpriteDef`. |
inline function _RT_Clamp(v, lo, hi)Constrains a sprite-rendering scalar to the supplied inclusive bounds.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
lo | dynamic | — | Inclusive lower bound. |
hi | dynamic | — | Inclusive upper bound. |
_rt_clipbot_workStores the rt clipbot work collection used by the r things subsystem.
_rt_cliptop_workStores the rt cliptop work collection used by the r things subsystem.
_rt_colormap_cacheStores the rt colormap cache collection used by the r things subsystem.
_rt_colormap_cache_lenTracks the mutable rt colormap cache len value used by the r things subsystem.
inline function _RT_ColormapAt(idx)Returns a clamped cached 256-entry COLORMAP slice and rebuilds the cache when its source length changes.
| Parameter | Type | Default | Description |
|---|---|---|---|
idx | dynamic | — | Zero-based element or table index. |
_rt_debug_disable_spritesTracks the mutable rt debug disable sprites value used by the r things subsystem.
function _RT_DrawMaskedPatchColumn(patch, coloff)Decodes and clips every post in one patch column, dispatches the active column drawer, and restores shared source state.
| Parameter | Type | Default | Description |
|---|---|---|---|
patch | dynamic | — | Patch value supplied to `_RT_DrawMaskedPatchColumn`. |
coloff | dynamic | — | Coloff value supplied to `_RT_DrawMaskedPatchColumn`. |
_rt_drawTranslationHolds the optional rt draw translation resource used by the r things subsystem.
function _RT_DrawUpscaledLinearSprite(vis, entry, origW, x1, x2)Draws an upscaled transparent sprite image directly into the active framebuffer.
| Parameter | Type | Default | Description |
|---|---|---|---|
vis | dynamic | — | Vis value supplied to `_RT_DrawUpscaledLinearSprite`. |
entry | dynamic | — | Entry value supplied to `_RT_DrawUpscaledLinearSprite`. |
origW | dynamic | — | Orig w value supplied to `_RT_DrawUpscaledLinearSprite`. |
x1 | dynamic | — | Horizontal coordinate of the first endpoint. |
x2 | dynamic | — | Horizontal coordinate of the second endpoint. |
inline function _RT_EnumIndex(v, limit)Resolves integer, numeric, or enum values to a bounded sprite-table index, returning -1 when invalid.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
limit | dynamic | — | Limit value supplied to `_RT_EnumIndex`. |
inline function _RT_GetClipValue(clipref, x, fallback)Reads a column clip from a direct sequence or x-biased openings-arena reference.
| Parameter | Type | Default | Description |
|---|---|---|---|
clipref | dynamic | — | Clipref value supplied to `_RT_GetClipValue`. |
x | dynamic | — | Horizontal map- or screen-space coordinate. |
fallback | dynamic | — | Value returned when the requested conversion or lookup is unavailable. |
inline function _RT_IDiv(a, b)Returns a signed quotient truncated toward zero, or zero for invalid operands and a zero divisor in `_RT_IDiv`
| Parameter | Type | Default | Description |
|---|---|---|---|
a | dynamic | — | First input operand. |
b | dynamic | — | Second input operand. |
function _RT_InstallSpriteLump(frames, frame, rotation, lump, flipped, sprname, maxframe)Installs one rot=0 or directional lump into a frame table while rejecting mixed, duplicate, or invalid rotations.
| Parameter | Type | Default | Description |
|---|---|---|---|
frames | dynamic | — | Frames value supplied to `_RT_InstallSpriteLump`. |
frame | dynamic | — | Frame value supplied to `_RT_InstallSpriteLump`. |
rotation | dynamic | — | Rotation value supplied to `_RT_InstallSpriteLump`. |
lump | dynamic | — | Lump value supplied to `_RT_InstallSpriteLump`. |
flipped | dynamic | — | Flipped value supplied to `_RT_InstallSpriteLump`. |
sprname | dynamic | — | Sprname value supplied to `_RT_InstallSpriteLump`. |
maxframe | dynamic | — | Maxframe value supplied to `_RT_InstallSpriteLump`. |
inline function _RT_IsSeq(v)Recognizes the array and list containers used for sprite definitions, clips, and renderer tables.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
inline function _RT_LumpNameAt(lumpnum)Decodes a validated lump directory entry's zero-terminated eight-byte name.
| Parameter | Type | Default | Description |
|---|---|---|---|
lumpnum | dynamic | — | Index identifying lump. |
inline function _RT_MakeEmptyFrame()Creates an unresolved sprite frame with eight missing rotation lumps and unflipped defaults.
inline function _RT_Name4(s)Returns the uppercase four-byte sprite prefix from a name, or an empty string when too short.
| Parameter | Type | Default | Description |
|---|---|---|---|
s | dynamic | — | S value supplied to `_RT_Name4`. |
_rt_prof_enabledTracks whether rt prof enabled is active in the r things subsystem.
inline function _RT_ProfDrawn()Tracks drawn sprites for renderer profiling.
_rt_profDrawnTracks the mutable rt prof drawn value used by the r things subsystem.
inline function _RT_ProfProjected()Tracks successful sprite projections for renderer profiling.
_rt_profProjectedTracks the mutable rt prof projected value used by the r things subsystem.
inline function _RT_ProfReject(kind)Tracks sprite reject categories for renderer profiling.
| Parameter | Type | Default | Description |
|---|---|---|---|
kind | dynamic | — | Kind value supplied to `_RT_ProfReject`. |
_rt_profRejectedTracks the mutable rt prof rejected value used by the r things subsystem.
_rt_profThingsTracks the mutable rt prof things value used by the r things subsystem.
inline function _RT_ProfThingSeen()Tracks visited things for renderer profiling when profiling is active.
function _RT_RebuildColormapCache()Builds reusable colormap slices to avoid per-sprite slice allocations.
_rt_rejBadDefTracks the mutable rt rej bad def value used by the r things subsystem.
_rt_rejBadFrameTracks the mutable rt rej bad frame value used by the r things subsystem.
_rt_rejBadLumpTracks the mutable rt rej bad lump value used by the r things subsystem.
_rt_rejBadSpriteTracks the mutable rt rej bad sprite value used by the r things subsystem.
_rt_rejBehindTracks the mutable rt rej behind value used by the r things subsystem.
_rt_rejNoFrameTracks the mutable rt rej no frame value used by the r things subsystem.
_rt_rejNoSpritesTracks the mutable rt rej no sprites value used by the r things subsystem.
_rt_rejNoThingTracks the mutable rt rej no thing value used by the r things subsystem.
_rt_rejNoVisTracks the mutable rt rej no vis value used by the r things subsystem.
_rt_rejOffLeftTracks the mutable rt rej off left value used by the r things subsystem.
_rt_rejOffRightTracks the mutable rt rej off right value used by the r things subsystem.
_rt_rejSideTracks the mutable rt rej side value used by the r things subsystem.
inline function _RT_S32(v)Reinterprets the low 32 bits of a coerced numeric value as a signed coordinate.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
inline function _RT_SelectSpriteLights(lightnum)Selects and clamps the scale-light row used to shade sprites in the current sector.
| Parameter | Type | Default | Description |
|---|---|---|---|
lightnum | dynamic | — | Index identifying light. |
inline function _RT_ShadowColormap()Lazily caches the dark level-24 colormap used when fuzz rendering is unavailable.
_rt_shadowMapHolds the optional rt shadow map resource used by the r things subsystem.
_rt_sortedStores the rt sorted collection used by the r things subsystem.
_rt_sorted_countTracks the mutable rt sorted count value used by the r things subsystem.
inline function _RT_SourceScaleFromEntry(entry, origW)Resolves the high-resolution source scale for an upscaled sprite entry.
| Parameter | Type | Default | Description |
|---|---|---|---|
entry | dynamic | — | Entry value supplied to `_RT_SourceScaleFromEntry`. |
origW | dynamic | — | Orig w value supplied to `_RT_SourceScaleFromEntry`. |
inline function _RT_SpriteIndex(v)Resolves a sprite identifier against the loaded definition count.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
inline function _RT_TargetBuffer()Returns the active sprite render target.
inline function _RT_ToInt(v, fallback)Coerces numeric values to truncation-toward-zero integers and returns fallback on failure in `_RT_ToInt`
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
fallback | dynamic | — | Value returned when the requested conversion or lookup is unavailable. |
inline function _RT_UpperAscii(c)Normalizes lowercase ASCII bytes before comparing case-insensitive WAD sprite names.
| Parameter | Type | Default | Description |
|---|---|---|---|
c | dynamic | — | C value supplied to `_RT_UpperAscii`. |
const BASEYCENTER = 100Defines baseycenter for the r things subsystem.
const MAXVISSPRITES = 128Defines the maximum maxvissprites accepted by the r things subsystem.
mceilingclipHolds the optional mceilingclip resource used by the r things subsystem.
mfloorclipHolds the optional mfloorclip resource used by the r things subsystem.
const MINZ = 262144Defines the minimum minz accepted by the r things subsystem.
negonearrayStores the negonearray collection used by the r things subsystem.
pspriteiscaleTracks the mutable pspriteiscale value used by the r things subsystem.
pspritescaleTracks the mutable pspritescale value used by the r things subsystem.
function R_AddPSprites()Draws the display player's first-person weapon/flash layers after validating player ownership.
function R_AddSprites(sec)Projects each non-viewplayer thing in a sector once per validcount using that sector's light row.
| Parameter | Type | Default | Description |
|---|---|---|---|
sec | dynamic | — | Sec value supplied to `R_AddSprites`. |
function R_ClearSprites()Resets the visible-sprite pool, sorting/clipping workspaces, profiler counters, and sentinel list for a new frame.
function R_ClipVisSprite(vis, xl, xh)Retains the classic clipping hook; drawseg silhouette clipping is integrated into R_DrawSprite.
| Parameter | Type | Default | Description |
|---|---|---|---|
vis | dynamic | — | Vis value supplied to `R_ClipVisSprite`. |
xl | dynamic | — | Xl value supplied to `R_ClipVisSprite`. |
xh | dynamic | — | Xh value supplied to `R_ClipVisSprite`. |
function R_DrawMasked()Draws sorted world sprites, remaining masked wall ranges, and first-person sprites in final masked-pass order.
function R_DrawMaskedColumn(column)Retains the classic public hook; patch-column decoding is handled by _RT_DrawMaskedPatchColumn with explicit bytes and offsets.
| Parameter | Type | Default | Description |
|---|---|---|---|
column | dynamic | — | Column value supplied to `R_DrawMaskedColumn`. |
function R_DrawPlayerSprites(player)Selects the player's sector lighting, disables world clipping, and draws each active first-person sprite layer.
| Parameter | Type | Default | Description |
|---|---|---|---|
player | dynamic | — | Player state affected by the operation. |
function R_DrawPSprite(player, psp)Projects one weapon/flash state in screen space, selects invisibility or lighting colormap, and draws its patch.
| Parameter | Type | Default | Description |
|---|---|---|---|
player | dynamic | — | Player state affected by the operation. |
psp | dynamic | — | Psp value supplied to `R_DrawPSprite`. |
function R_DrawSprite(spr)Builds per-column top/bottom clips from overlapping drawseg silhouettes, draws nearer masked walls, then renders the sprite.
| Parameter | Type | Default | Description |
|---|---|---|---|
spr | dynamic | — | Spr value supplied to `R_DrawSprite`. |
function R_DrawSprites()Sorts and renders all projected world sprites unless the sprite debug-disable flag is set.
function R_DrawVisSprite(vis, x1, x2)Selects fuzz/translation/base drawing, maps screen columns to patch columns, and renders a clipped visible sprite.
| Parameter | Type | Default | Description |
|---|---|---|---|
vis | dynamic | — | Vis value supplied to `R_DrawVisSprite`. |
x1 | dynamic | — | Horizontal coordinate of the first endpoint. |
x2 | dynamic | — | Horizontal coordinate of the second endpoint. |
function R_InitSpriteDefs(namelist)Compatibility entry point that rebuilds sprite definitions and clip arrays from a name list.
| Parameter | Type | Default | Description |
|---|---|---|---|
namelist | dynamic | — | Namelist value supplied to `R_InitSpriteDefs`. |
function R_InitSprites(namelist)Sizes sprite clip sentinels and builds every named sprite definition from the WAD sprite-lump range.
| Parameter | Type | Default | Description |
|---|---|---|---|
namelist | dynamic | — | Namelist value supplied to `R_InitSprites`. |
function R_InstallSpriteLump(lump, frame, rotation, flipped)Retains the classic public hook; sprite-lump installation is performed on explicit frame arrays by the internal builder.
| Parameter | Type | Default | Description |
|---|---|---|---|
lump | dynamic | — | Lump value supplied to `R_InstallSpriteLump`. |
frame | dynamic | — | Frame value supplied to `R_InstallSpriteLump`. |
rotation | dynamic | — | Rotation value supplied to `R_InstallSpriteLump`. |
flipped | dynamic | — | Flipped value supplied to `R_InstallSpriteLump`. |
function R_NewVisSprite()Reserves the next preallocated visible-sprite record, returning void when MAXVISSPRITES is exhausted.
function R_ProjectSprite(thing)Transforms a world mobj into screen bounds, selects rotation/flip/light, and appends a visible sprite when in view.
| Parameter | Type | Default | Description |
|---|---|---|---|
thing | dynamic | — | World object affected by the operation. |
function R_SortVisSprites()Copies active visible sprites into reusable storage and insertion-sorts them back-to-front by projection scale.
function R_ThingsProfileSetEnabled(on)Enables or disables sprite/render profiling counters in hot paths.
| Parameter | Type | Default | Description |
|---|---|---|---|
on | dynamic | — | On value supplied to `R_ThingsProfileSetEnabled`. |
const RT_TRANSPARENT_INDEX = 255Defines rt transparent index for the r things subsystem.
screenheightarrayStores the screenheightarray collection used by the r things subsystem.
spritelightsHolds the optional spritelights resource used by the r things subsystem.
sprtopscreenTracks the mutable sprtopscreen value used by the r things subsystem.
spryscaleTracks the mutable spryscale value used by the r things subsystem.
vissprite_pTracks the mutable vissprite p value used by the r things subsystem.
visspritesStores the vissprites collection used by the r things subsystem.
vsprsortedheadHolds the optional vsprsortedhead resource used by the r things subsystem.