MiniDoom

src/p_plats.ml

Drives lift and perpetual-platform thinkers with active-slot tracking, waits, stasis, and sounds.

Package
(global)
Reachable
Yes

Imports

Declarations

_InitActivePlats

function _InitActivePlats()

Lazily creates the fixed-size active-platform slot table expected by tagged control operations.

View source

_PlatFrontSector

inline function _PlatFrontSector(line)

Resolves the sector on a line's front side for platform trigger calculations.

ParameterTypeDefaultDescription
linedynamic—Map line or text line affected by the operation.

View source

_PlatMakeThinker

inline function _PlatMakeThinker(fn)

Creates a platform thinker with list links, movement callback, direction, speed, and wait-state defaults.

ParameterTypeDefaultDescription
fndynamic—Fn value supplied to `_PlatMakeThinker`.

View source

_PlatSetSlot

function _PlatSetSlot(idx, v)

Rebuilds the active-platform sequence with one validated slot replaced, preserving list compatibility.

ParameterTypeDefaultDescription
idxdynamic—Zero-based element or table index.
vdynamic—Value consumed by the operation.

View source

_PlatSoundOrg

inline function _PlatSoundOrg(sec)

Selects the sector's positional sound origin, falling back to the sector when no dedicated origin exists.

ParameterTypeDefaultDescription
secdynamic—Sec value supplied to `_PlatSoundOrg`.

View source

_PlatStartSound

inline function _PlatStartSound(origin, snd)

Emits a positional platform sound only when the sound subsystem is available.

ParameterTypeDefaultDescription
origindynamic—Origin value supplied to `_PlatStartSound`.
snddynamic—Snd value supplied to `_PlatStartSound`.

View source

activeplats

activeplats

Stores the activeplats collection used by the p plats subsystem.

View source

EV_DoPlat

function EV_DoPlat(line, type, amount)

Starts the requested platform behavior in each tagged inactive sector and records it in the active-platform set.

ParameterTypeDefaultDescription
linedynamic—Map line or text line affected by the operation.
typedynamic—Type value supplied to `EV_DoPlat`.
amountdynamic—Amount value supplied to `EV_DoPlat`.

View source

EV_StopPlat

function EV_StopPlat(line)

Puts every moving platform with the trigger tag into stasis while preserving its status for later resume.

ParameterTypeDefaultDescription
linedynamic—Map line or text line affected by the operation.

View source

P_ActivateInStasis

function P_ActivateInStasis(tag)

Resumes tagged platforms in stasis by restoring their previous status and movement callback.

ParameterTypeDefaultDescription
tagdynamic—Zone-memory or resource-lifetime tag.

View source

P_AddActivePlat

function P_AddActivePlat(plat)

Places a platform mover in the first free active slot, failing explicitly when the fixed table is exhausted.

ParameterTypeDefaultDescription
platdynamic—Plat value supplied to `P_AddActivePlat`.

View source

P_RemoveActivePlat

function P_RemoveActivePlat(plat)

Clears a completed platform's sector ownership, removes its thinker, and frees its active slot.

ParameterTypeDefaultDescription
platdynamic—Plat value supplied to `P_RemoveActivePlat`.

View source

T_PlatRaise

function T_PlatRaise(plat)

Advances a platform through upward, downward, waiting, and stationary states and emits movement or stop sounds.

ParameterTypeDefaultDescription
platdynamic—Plat value supplied to `T_PlatRaise`.

View source