MiniDoom

src/wi_stuff.ml

Implements intermission flow, counters, and transition screens.

Package
(global)
Reachable
Yes

Imports

Declarations

_WI_Abs

inline function _WI_Abs(v)

Returns a signed integer magnitude for counter animation and layout math.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_WI_AnimDefault

inline function _WI_AnimDefault()

Creates an inert animation record used to preallocate episode animation tables.

View source

_WI_CacheOrVoid

inline function _WI_CacheOrVoid(name, tag)

Looks up an optional patch lump and caches it with the requested zone tag.

ParameterTypeDefaultDescription
namedynamic—Resource or object name to resolve.
tagdynamic—Zone-memory or resource-lifetime tag.

View source

_WI_Clamp

inline function _WI_Clamp(v, lo, hi)

Bounds animated counters between their scoreboard-specific minimum and target value.

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

View source

_WI_DrawRowName

inline function _WI_DrawRowName(slot, x, y)

Draws one player name at netgame row start.

ParameterTypeDefaultDescription
slotdynamic—Slot value supplied to `_WI_DrawRowName`.
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.

View source

_WI_GetPlr

inline function _WI_GetPlr(index)

Returns a checked wminfo player row, falling back to an empty scoreboard record.

ParameterTypeDefaultDescription
indexdynamic—Zero-based element or table index.

View source

_WI_GetPlrFrag

inline function _WI_GetPlrFrag(playernum, target)

Reads one frag-matrix entry from wb player stats safely.

ParameterTypeDefaultDescription
playernumdynamic—Index identifying player.
targetdynamic—Target value supplied to `_WI_GetPlrFrag`.

View source

_WI_IDiv

inline function _WI_IDiv(a, b)

Truncates intermission percentage/time quotients toward zero and returns zero on invalid input.

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

View source

_WI_NumPixelWidth

function _WI_NumPixelWidth(n, digits)

Computes rendered pixel width for one WI number, matching WI_drawNum semantics.

ParameterTypeDefaultDescription
ndynamic—Number of values to process.
digitsdynamic—Digits value supplied to `_WI_NumPixelWidth`.

View source

_WI_PatchH

inline function _WI_PatchH(p)

Reads a patch height safely for intermission alignment calculations.

ParameterTypeDefaultDescription
pdynamic—Object or data record consumed by the operation.

View source

_WI_PatchW

inline function _WI_PatchW(p)

Reads a patch width safely for intermission alignment calculations.

ParameterTypeDefaultDescription
pdynamic—Object or data record consumed by the operation.

View source

_WI_PlayerIngame

inline function _WI_PlayerIngame(index)

Returns whether a player slot is active for intermission tables.

ParameterTypeDefaultDescription
indexdynamic—Zero-based element or table index.

View source

_WI_PlayerRowName

function _WI_PlayerRowName(slot)

Resolves readable player name for intermission net rows.

ParameterTypeDefaultDescription
slotdynamic—Slot value supplied to `_WI_PlayerRowName`.

View source

_WI_Point

inline function _WI_Point(x, y)

Constructs an immutable two-coordinate map-node position.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.

View source

_WI_SafeDrawNamedPatch

inline function _WI_SafeDrawNamedPatch(x, y, patch, name)

Draws an intermission patch and its OpenGL high-resolution package image.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
patchdynamic—Patch value supplied to `_WI_SafeDrawNamedPatch`.
namedynamic—Resource or object name to resolve.

View source

_WI_SafeDrawPatch

inline function _WI_SafeDrawPatch(x, y, patch)

Draws a patch only when its decoded resource and destination coordinates are valid.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
patchdynamic—Patch value supplied to `_WI_SafeDrawPatch`.

View source

_WI_SafeStartSound

inline function _WI_SafeStartSound(origin, sfx)

Plays an intermission cue only when the sound backend is available.

ParameterTypeDefaultDescription
origindynamic—Origin value supplied to `_WI_SafeStartSound`.
sfxdynamic—Sound-effect descriptor to process.

View source

_WI_Substr

inline function _WI_Substr(s, n)

Returns at most n bytes from the beginning of s.

ParameterTypeDefaultDescription
sdynamic—S value supplied to `_WI_Substr`.
ndynamic—Number of values to process.

View source

_WI_TargetItems

function _WI_TargetItems(index)

Computes the bounded final item percentage for the local single-player row.

ParameterTypeDefaultDescription
indexdynamic—Zero-based element or table index.

View source

_WI_TargetKills

function _WI_TargetKills(index)

Computes the bounded final kill percentage for the local single-player row.

ParameterTypeDefaultDescription
indexdynamic—Zero-based element or table index.

View source

_WI_TargetPar

inline function _WI_TargetPar()

Converts the map par time from tics to scoreboard seconds.

View source

_WI_TargetSecrets

function _WI_TargetSecrets(index)

Computes the bounded final secret percentage for the local single-player row.

ParameterTypeDefaultDescription
indexdynamic—Zero-based element or table index.

View source

_WI_TargetTime

inline function _WI_TargetTime(index)

Converts the player's completion time from tics to scoreboard seconds.

ParameterTypeDefaultDescription
indexdynamic—Zero-based element or table index.

View source

_WI_ToInt

function _WI_ToInt(v, fallback)

Normalizes values to int for intermission math and counters.

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

View source

acceleratestage

acceleratestage

Tracks the mutable acceleratestage value used by the wi stuff subsystem.

View source

anim_t struct

animenum_t enum

anims

anims

Stores the anims collection used by the wi stuff subsystem.

View source

bcnt

bcnt

Tracks the mutable bcnt value used by the wi stuff subsystem.

View source

bg

bg

Holds the optional bg resource used by the wi stuff subsystem.

View source

bg_name

bg_name

Stores the mutable bg name text used by the wi stuff subsystem.

View source

bstar

bstar

Holds the optional bstar resource used by the wi stuff subsystem.

View source

bstar_name

bstar_name

Stores the mutable bstar name text used by the wi stuff subsystem.

View source

cnt

cnt

Tracks the mutable cnt value used by the wi stuff subsystem.

View source

cnt_frags

cnt_frags

Stores the cnt frags collection used by the wi stuff subsystem.

View source

cnt_items

cnt_items

Stores the cnt items collection used by the wi stuff subsystem.

View source

cnt_kills

cnt_kills

Stores the cnt kills collection used by the wi stuff subsystem.

View source

cnt_par

cnt_par

Tracks the mutable cnt par value used by the wi stuff subsystem.

View source

cnt_pause

cnt_pause

Tracks the mutable cnt pause value used by the wi stuff subsystem.

View source

cnt_secret

cnt_secret

Stores the cnt secret collection used by the wi stuff subsystem.

View source

cnt_time

cnt_time

Tracks the mutable cnt time value used by the wi stuff subsystem.

View source

colon

colon

Holds the optional colon resource used by the wi stuff subsystem.

View source

colon_name

colon_name

Stores the mutable colon name text used by the wi stuff subsystem.

View source

dm_frags

dm_frags

Stores the dm frags collection used by the wi stuff subsystem.

View source

DM_KILLERSX

const DM_KILLERSX = 10

Defines dm killersx for the wi stuff subsystem.

View source

DM_KILLERSY

const DM_KILLERSY = 100

Defines dm killersy for the wi stuff subsystem.

View source

DM_MATRIXX

const DM_MATRIXX = 42

Defines dm matrixx for the wi stuff subsystem.

View source

DM_MATRIXY

const DM_MATRIXY = 68

Defines dm matrixy for the wi stuff subsystem.

View source

DM_SPACINGX

const DM_SPACINGX = 40

Defines dm spacingx for the wi stuff subsystem.

View source

dm_state

dm_state

Tracks the mutable dm state value used by the wi stuff subsystem.

View source

dm_totals

dm_totals

Stores the dm totals collection used by the wi stuff subsystem.

View source

DM_TOTALSX

const DM_TOTALSX = 269

Defines dm totalsx for the wi stuff subsystem.

View source

DM_VICTIMSX

const DM_VICTIMSX = 5

Defines dm victimsx for the wi stuff subsystem.

View source

DM_VICTIMSY

const DM_VICTIMSY = 50

Defines dm victimsy for the wi stuff subsystem.

View source

dofrags

dofrags

Tracks whether dofrags is active in the wi stuff subsystem.

View source

entering

entering

Holds the optional entering resource used by the wi stuff subsystem.

View source

entering_name

entering_name

Stores the mutable entering name text used by the wi stuff subsystem.

View source

finished

finished

Holds the optional finished resource used by the wi stuff subsystem.

View source

finished_name

finished_name

Stores the mutable finished name text used by the wi stuff subsystem.

View source

firstrefresh

firstrefresh

Tracks the mutable firstrefresh value used by the wi stuff subsystem.

View source

frags

frags

Holds the optional frags resource used by the wi stuff subsystem.

View source

frags_name

frags_name

Stores the mutable frags name text used by the wi stuff subsystem.

View source

items

items

Holds the optional items resource used by the wi stuff subsystem.

View source

items_name

items_name

Stores the mutable items name text used by the wi stuff subsystem.

View source

killers

killers

Holds the optional killers resource used by the wi stuff subsystem.

View source

killers_name

killers_name

Stores the mutable killers name text used by the wi stuff subsystem.

View source

kills

kills

Holds the optional kills resource used by the wi stuff subsystem.

View source

kills_name

kills_name

Stores the mutable kills name text used by the wi stuff subsystem.

View source

lnames

lnames

Stores the lnames collection used by the wi stuff subsystem.

View source

lnodes

lnodes

Stores the lnodes collection used by the wi stuff subsystem.

View source

me

me

Tracks the mutable me value used by the wi stuff subsystem.

View source

NG_NAMEX

const NG_NAMEX = 6

Defines ng namex for the wi stuff subsystem.

View source

NG_NAMEYOFF

const NG_NAMEYOFF = 10

Defines ng nameyoff for the wi stuff subsystem.

View source

NG_SPACINGX

const NG_SPACINGX = 64

Defines ng spacingx for the wi stuff subsystem.

View source

ng_state

ng_state

Tracks the mutable ng state value used by the wi stuff subsystem.

View source

NG_STATSX

const NG_STATSX = 32

Defines ng statsx for the wi stuff subsystem.

View source

NG_STATSY

const NG_STATSY = 50

Defines ng statsy for the wi stuff subsystem.

View source

num

num

Stores the num collection used by the wi stuff subsystem.

View source

num_names

num_names

Stores the num names collection used by the wi stuff subsystem.

View source

NUMCMAPS

NUMCMAPS

Tracks the mutable numcmaps value used by the wi stuff subsystem.

View source

NUMEPISODES

const NUMEPISODES = 4

Defines the numepisodes count used by the wi stuff subsystem.

View source

NUMMAPS

const NUMMAPS = 9

Defines the nummaps count used by the wi stuff subsystem.

View source

par

par

Holds the optional par resource used by the wi stuff subsystem.

View source

par_name

par_name

Stores the mutable par name text used by the wi stuff subsystem.

View source

percent

percent

Holds the optional percent resource used by the wi stuff subsystem.

View source

percent_name

percent_name

Stores the mutable percent name text used by the wi stuff subsystem.

View source

plrs

plrs

Stores the plrs collection used by the wi stuff subsystem.

View source

point_t struct

secret

secret

Holds the optional secret resource used by the wi stuff subsystem.

View source

secret_name

secret_name

Stores the mutable secret name text used by the wi stuff subsystem.

View source

SHOWNEXTLOCDELAY

const SHOWNEXTLOCDELAY = 4

Defines shownextlocdelay for the wi stuff subsystem.

View source

SP_FRAGS

const SP_FRAGS = 6

Defines sp frags for the wi stuff subsystem.

View source

SP_ITEMS

const SP_ITEMS = 2

Defines sp items for the wi stuff subsystem.

View source

SP_KILLS

const SP_KILLS = 0

Defines sp kills for the wi stuff subsystem.

View source

SP_PAR

const SP_PAR = 8

Defines sp par for the wi stuff subsystem.

View source

SP_PAUSE

const SP_PAUSE = 1

Defines sp pause for the wi stuff subsystem.

View source

SP_SECRET

const SP_SECRET = 4

Defines sp secret for the wi stuff subsystem.

View source

sp_secret

sp_secret

Holds the optional sp secret resource used by the wi stuff subsystem.

View source

sp_secret_name

sp_secret_name

Stores the mutable sp secret name text used by the wi stuff subsystem.

View source

sp_state

sp_state

Tracks the mutable sp state value used by the wi stuff subsystem.

View source

SP_STATSX

const SP_STATSX = 50

Defines sp statsx for the wi stuff subsystem.

View source

SP_STATSY

const SP_STATSY = 50

Defines sp statsy for the wi stuff subsystem.

View source

SP_TIME

const SP_TIME = 8

Defines sp time for the wi stuff subsystem.

View source

SP_TIMEX

const SP_TIMEX = 16

Defines sp timex for the wi stuff subsystem.

View source

SP_TIMEY

const SP_TIMEY = SCREENHEIGHT - 32

Defines sp timey for the wi stuff subsystem.

View source

splat

splat

Holds the optional splat resource used by the wi stuff subsystem.

View source

splat_name

splat_name

Stores the mutable splat name text used by the wi stuff subsystem.

View source

star

star

Holds the optional star resource used by the wi stuff subsystem.

View source

star_name

star_name

Stores the mutable star name text used by the wi stuff subsystem.

View source

state

state

Exposes `stateenum_t.NoState` through the legacy `state` alias.

View source

stateenum_t enum

sucks

sucks

Holds the optional sucks resource used by the wi stuff subsystem.

View source

sucks_name

sucks_name

Stores the mutable sucks name text used by the wi stuff subsystem.

View source

timepatch

timepatch

Holds the optional timepatch resource used by the wi stuff subsystem.

View source

timepatch_name

timepatch_name

Stores the mutable timepatch name text used by the wi stuff subsystem.

View source

total

total

Holds the optional total resource used by the wi stuff subsystem.

View source

total_name

total_name

Stores the mutable total name text used by the wi stuff subsystem.

View source

victims

victims

Holds the optional victims resource used by the wi stuff subsystem.

View source

victims_name

victims_name

Stores the mutable victims name text used by the wi stuff subsystem.

View source

wbs

wbs

Holds the optional wbs resource used by the wi stuff subsystem.

View source

wi_bp

wi_bp

Stores the wi bp collection used by the wi stuff subsystem.

View source

wi_bp_names

wi_bp_names

Stores the wi bp names collection used by the wi stuff subsystem.

View source

WI_checkForAccelerate

function WI_checkForAccelerate()

Latches rising attack/use buttons from any active player into the shared accelerate flag.

View source

WI_drawAnimatedBack

function WI_drawAnimatedBack()

Draws each active episode-map background animation frame.

View source

WI_drawDeathmatchStats

function WI_drawDeathmatchStats()

Draws the deathmatch frag matrix, totals, and host-synchronized player names.

View source

WI_drawEL

function WI_drawEL()

Draws the localized entering-map heading and next map name.

View source

WI_Drawer

function WI_Drawer()

Selects and draws the current deathmatch, coop, solo, or map-transition intermission screen.

View source

WI_drawLF

function WI_drawLF()

Draws the localized finished-map heading and current map name.

View source

WI_drawNetgameStats

function WI_drawNetgameStats()

Draws cooperative kill/item/secret/frag columns for every active slot.

View source

WI_drawNoState

function WI_drawNoState()

Draws the final static world-map frame before leaving intermission.

View source

WI_drawNum

function WI_drawNum(x, y, n, digits)

Draws a signed decimal counter using WI digit/minus patches and right alignment.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
ndynamic—Number of values to process.
digitsdynamic—Digits value supplied to `WI_drawNum`.

View source

WI_drawNumRight

function WI_drawNumRight(xRight, y, n, digits)

Draws number right-aligned to xRight.

ParameterTypeDefaultDescription
xRightdynamic—X right value supplied to `WI_drawNumRight`.
ydynamic—Vertical map- or screen-space coordinate.
ndynamic—Number of values to process.
digitsdynamic—Digits value supplied to `WI_drawNumRight`.

View source

WI_drawOnLnode

function WI_drawOnLnode(n, c)

Places one map marker on a node while keeping its patch inside screen bounds.

ParameterTypeDefaultDescription
ndynamic—Number of values to process.
cdynamic—C value supplied to `WI_drawOnLnode`.

View source

WI_drawPercent

function WI_drawPercent(x, y, p)

Draws a percentage value followed by the percent patch at the requested anchor.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
pdynamic—Object or data record consumed by the operation.

View source

WI_drawPercentAligned

function WI_drawPercentAligned(x, y, p)

Draws percent with numeric part right-aligned before the percent sign.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
pdynamic—Object or data record consumed by the operation.

View source

WI_drawShowNextLoc

function WI_drawShowNextLoc()

Draws the world map, completed splats, blinking pointer, and entering heading.

View source

WI_drawStats

function WI_drawStats()

Draws the animated single-player completion counters and their labels.

View source

WI_drawTime

function WI_drawTime(x, y, t)

Draws mm:ss completion/par time or the overflow label for very long runs.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
tdynamic—T value supplied to `WI_drawTime`.

View source

WI_End

function WI_End()

Controls end transitions in the intermission system.

View source

WI_FB

const WI_FB = 0

Defines wi fb for the wi stuff subsystem.

View source

WI_fragSum

function WI_fragSum(playernum)

Sums one player's net frags with Doom self-frag subtraction semantics.

ParameterTypeDefaultDescription
playernumdynamic—Index identifying player.

View source

WI_initAnimatedBack

function WI_initAnimatedBack()

Resets per-animation frame indices and schedules their first episode-specific background tick.

View source

WI_initDeathmatchStats

function WI_initDeathmatchStats()

Seeds the deathmatch frag matrix counters and opens the first staged scoreboard pause.

View source

WI_initNetgameStats

function WI_initNetgameStats()

Clears cooperative kill/item/secret counters and starts their staged count-up sequence.

View source

WI_initNoState

function WI_initNoState()

Enters the final ten-tic intermission hold before handing control back to world progression.

View source

WI_initShowNextLoc

function WI_initShowNextLoc()

Enters the next-location map screen with its fixed delay and pointer blink state reset.

View source

WI_initStats

function WI_initStats()

Clears single-player counters and begins the kill/item/secret/time tally sequence.

View source

WI_initVariables

function WI_initVariables(wbstartstruct)

Validates wminfo, selects the local scoreboard row, and resets clocks/accelerate flags.

ParameterTypeDefaultDescription
wbstartstructdynamic—Wbstartstruct value supplied to `WI_initVariables`.

View source

WI_loadData

function WI_loadData()

Caches scoreboard digits, labels, map patches, player markers, and episode animation frames.

View source

wi_p

wi_p

Stores the wi p collection used by the wi stuff subsystem.

View source

wi_p_names

wi_p_names

Stores the wi p names collection used by the wi stuff subsystem.

View source

WI_Responder

function WI_Responder(ev)

Records attack/use acceleration requests from every active player during intermission.

ParameterTypeDefaultDescription
evdynamic—Input event to process.

View source

WI_slamBackground

function WI_slamBackground()

Copies the cached intermission background into the active framebuffer.

View source

WI_SPACINGY

const WI_SPACINGY = 33

Defines wi spacingy for the wi stuff subsystem.

View source

WI_Start

function WI_Start(wbstartstruct)

Loads shared artwork and selects deathmatch, cooperative, or solo scoreboard state.

ParameterTypeDefaultDescription
wbstartstructdynamic—Wbstartstruct value supplied to `WI_Start`.

View source

wi_started

wi_started

Tracks whether wi started is active in the wi stuff subsystem.

View source

WI_Ticker

function WI_Ticker()

Samples acceleration, advances background animation, and ticks the active scoreboard state machine.

View source

WI_TITLEY

const WI_TITLEY = 2

Defines wi titley for the wi stuff subsystem.

View source

WI_unloadData

function WI_unloadData()

Releases intermission patch references so zone-cached graphics can be reclaimed after exit.

View source

WI_updateAnimatedBack

function WI_updateAnimatedBack()

Advances looping, one-shot, and level-gated background animations at their configured cadence.

View source

WI_updateDeathmatchStats

function WI_updateDeathmatchStats()

Animates each frag cell and total toward authoritative values, honoring accelerate-to-finish.

View source

WI_updateNetgameStats

function WI_updateNetgameStats()

Animates cooperative percentages for all active players and advances through pause stages.

View source

WI_updateNoState

function WI_updateNoState()

Counts down the terminal hold and invokes G_WorldDone exactly when it expires.

View source

WI_updateShowNextLoc

function WI_updateShowNextLoc()

Animates the map pointer and transitions to the terminal hold after the location delay.

View source

WI_updateStats

function WI_updateStats()

Animates single-player percentages and times, with attack/use acceleration and stage sounds.

View source

wi_wbstart

wi_wbstart

Holds the optional wi wbstart resource used by the wi stuff subsystem.

View source

wiminus

wiminus

Holds the optional wiminus resource used by the wi stuff subsystem.

View source

wiminus_name

wiminus_name

Stores the mutable wiminus name text used by the wi stuff subsystem.

View source

yah

yah

Stores the yah collection used by the wi stuff subsystem.

View source

yah_names

yah_names

Stores the yah names collection used by the wi stuff subsystem.

View source