MiniDoom

src/p_maputl.ml

Supplies fixed-point geometry tests, blockmap linking, opening calculations, and ordered path traversal.

Package
(global)
Reachable
Yes

Imports

Declarations

_abs

inline function _abs(x)

Returns an integer magnitude for distance and side-of-line calculations.

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

View source

_EnsureIntercepts

inline function _EnsureIntercepts()

Lazily allocates the reusable baseline intercept records required before path traversal begins.

View source

_PMU_DiagUseEnabled

inline function _PMU_DiagUseEnabled()

Caches whether path/use diagnostic output was requested on the command line.

View source

_PMU_DiagUseLog

inline function _PMU_DiagUseLog(msg)

Emits a map-use diagnostic only when the cached diagnostic option is active.

ParameterTypeDefaultDescription
msgdynamic—Msg value supplied to `_PMU_DiagUseLog`.

View source

_PMU_HasSignBit

inline function _PMU_HasSignBit(v)

Tests bit 31 of a value after unsigned 32-bit normalization.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_PMU_IsSeq

inline function _PMU_IsSeq(v)

Accepts arrays and byte buffers as the indexable sequence forms used by compatibility helpers.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_PMU_U32

inline function _PMU_U32(v)

Normalizes an integer to unsigned 32-bit form for sign-bit tests that emulate Doom C arithmetic.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_pmuDiagUse

_pmuDiagUse

Tracks whether pmu diag use is active in the p maputl subsystem.

View source

_pmuDiagUseCount

_pmuDiagUseCount

Tracks the mutable pmu diag use count value used by the p maputl subsystem.

View source

_pmuDiagUseInit

_pmuDiagUseInit

Tracks whether pmu diag use init is active in the p maputl subsystem.

View source

_PT_AddLineIntercept

function _PT_AddLineIntercept(ld)

Tests one line against the active trace and appends its in-range fractional crossing to the intercept buffer.

ParameterTypeDefaultDescription
lddynamic—Ld value supplied to `_PT_AddLineIntercept`.

View source

_PT_AddThingIntercept

function _PT_AddThingIntercept(thing)

Approximates a thing as a trace-facing diagonal and appends an in-range crossing intercept.

ParameterTypeDefaultDescription
thingdynamic—World object affected by the operation.

View source

_PT_EnsureInterceptCapacity

function _PT_EnsureInterceptCapacity(need)

Lazily allocates and geometrically grows the reusable intercept array required by path traversal.

ParameterTypeDefaultDescription
needdynamic—Need value supplied to `_PT_EnsureInterceptCapacity`.

View source

earlyout

earlyout

Tracks whether earlyout is active in the p maputl subsystem.

View source

P_AproxDistance

inline function P_AproxDistance(dx, dy)

Computes Doom's inexpensive fixed-point distance approximation from horizontal and vertical deltas.

ParameterTypeDefaultDescription
dxdynamic—Horizontal coordinate or vector component represented by dx.
dydynamic—Vertical coordinate or vector component represented by dy.

View source

P_BlockLinesIterator

function P_BlockLinesIterator(x, y, func)

Visits each valid line in one blockmap cell once per traversal and stops immediately when the callback rejects it.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
funcdynamic—Func value supplied to `P_BlockLinesIterator`.

View source

P_BlockThingsIterator

function P_BlockThingsIterator(x, y, func)

Walks the mobj chain for one blockmap cell and stops when the callback returns false.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
funcdynamic—Func value supplied to `P_BlockThingsIterator`.

View source

P_BoxOnLineSide

inline function P_BoxOnLineSide(tmbox, ld)

Classifies an axis-aligned bounding box against a line, returning -1 when the box straddles both sides.

ParameterTypeDefaultDescription
tmboxdynamic—Temporary movement bounding box to read or update.
lddynamic—Ld value supplied to `P_BoxOnLineSide`.

View source

P_InterceptVector

inline function P_InterceptVector(v2, v1)

Computes the fixed-point fraction where one divline intersects another, returning zero for parallel traces.

ParameterTypeDefaultDescription
v2dynamic—V2 value supplied to `P_InterceptVector`.
v1dynamic—V1 value supplied to `P_InterceptVector`.

View source

P_LineOpening

function P_LineOpening(linedef)

Computes the vertical opening, top, bottom, and low-floor values across a two-sided line into shared trace globals.

ParameterTypeDefaultDescription
linedefdynamic—Linedef value supplied to `P_LineOpening`.

View source

P_MakeDivline

inline function P_MakeDivline(li, dl)

Copies a linedef's first vertex and direction into the lightweight divline form used by trace calculations.

ParameterTypeDefaultDescription
lidynamic—Li value supplied to `P_MakeDivline`.
dldynamic—Dl value supplied to `P_MakeDivline`.

View source

P_PathTraverse

function P_PathTraverse(x1, y1, x2, y2, flags, trav)

Steps a trace through blockmap cells, collects requested line and thing crossings, sorts them by fraction, and invokes the traverser in order.

ParameterTypeDefaultDescription
x1dynamic—Horizontal coordinate of the first endpoint.
y1dynamic—Vertical coordinate of the first endpoint.
x2dynamic—Horizontal coordinate of the second endpoint.
y2dynamic—Vertical coordinate of the second endpoint.
flagsdynamic—Bit flags that control the operation.
travdynamic—Trav value supplied to `P_PathTraverse`.

View source

P_PointOnDivlineSide

inline function P_PointOnDivlineSide(x, y, line)

Classifies a fixed-point point against an infinite divline using overflow-safe sign tests and scaled cross products.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
linedynamic—Map line or text line affected by the operation.

View source

P_PointOnLineSide

inline function P_PointOnLineSide(x, y, line)

Classifies a fixed-point point against a partition line while preserving Doom's vertical, horizontal, and sign-bit shortcuts.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
linedynamic—Map line or text line affected by the operation.

View source

P_SetThingPosition

function P_SetThingPosition(thing)

Finds a thing's subsector and links it into sector and blockmap lists unless its flags suppress either index.

ParameterTypeDefaultDescription
thingdynamic—World object affected by the operation.

View source

P_TraverseIntercepts

function P_TraverseIntercepts(func, maxfrac)

Computes intercepts values for the map utility.

ParameterTypeDefaultDescription
funcdynamic—Func value supplied to `P_TraverseIntercepts`.
maxfracdynamic—Maxfrac value supplied to `P_TraverseIntercepts`.

View source

P_UnsetThingPosition

function P_UnsetThingPosition(thing)

Unlinks a mobj from sector and blockmap chains before movement, honoring no-sector and no-blockmap flags.

ParameterTypeDefaultDescription
thingdynamic—World object affected by the operation.

View source

PIT_AddLineIntercepts

function PIT_AddLineIntercepts(ld)

Adapts blockmap line iteration to the current path-traversal intercept collector.

ParameterTypeDefaultDescription
lddynamic—Ld value supplied to `PIT_AddLineIntercepts`.

View source

PIT_AddThingIntercepts

function PIT_AddThingIntercepts(thing)

Adapts blockmap thing iteration to the current path-traversal intercept collector.

ParameterTypeDefaultDescription
thingdynamic—World object affected by the operation.

View source

PT_ADDLINES

const PT_ADDLINES = 1

Defines pt addlines for the p maputl subsystem.

View source

PT_ADDTHINGS

const PT_ADDTHINGS = 2

Defines pt addthings for the p maputl subsystem.

View source

PT_EARLYOUT

const PT_EARLYOUT = 4

Defines pt earlyout for the p maputl subsystem.

View source

ptflags

ptflags

Tracks the mutable ptflags value used by the p maputl subsystem.

View source