# _AM_Abs
inline function _AM_Abs(v)Returns the magnitude of an integer without altering its fixed-point scale.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
src/am_map.mlImplements automap input, state, and drawing logic.
doomdef.ml → src/doomdef.mldoomstat.ml → src/doomstat.mldstrings.ml → src/dstrings.mli_system.ml → src/i_system.mlm_cheat.ml → src/m_cheat.mlm_fixed.ml → src/m_fixed.mlp_local.ml → src/p_local.mlr_state.ml → src/r_state.mlst_stuff.ml → src/st_stuff.mlv_video.ml → src/v_video.mlw_wad.ml → src/w_wad.mlz_zone.ml → src/z_zone.mlinline function _AM_Abs(v)Returns the magnitude of an integer without altering its fixed-point scale.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
inline function _AM_CacheOrVoid(name, tag)Resolves an optional automap patch lump and returns its tagged cache entry, or void when the name is absent.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | dynamic | — | Resource or object name to resolve. |
tag | dynamic | — | Zone-memory or resource-lifetime tag. |
inline function _AM_CaseKey(k)Normalizes an input key to lowercase ASCII for case-insensitive automap bindings.
| Parameter | Type | Default | Description |
|---|---|---|---|
k | dynamic | — | K value supplied to `_AM_CaseKey`. |
inline function _AM_Clamp(v, lo, hi)Restricts a zoom or coordinate value to the caller's inclusive lower and upper bounds.
| Parameter | Type | Default | Description |
|---|---|---|---|
v | dynamic | — | Value consumed by the operation. |
lo | dynamic | — | Inclusive lower bound. |
hi | dynamic | — | Inclusive upper bound. |
inline function _AM_CXMTOF(x)Projects a map-space x coordinate into the automap window relative to its current origin.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
inline function _AM_CYMTOF(y)Projects a map-space y coordinate into the vertically inverted automap framebuffer.
| Parameter | Type | Default | Description |
|---|---|---|---|
y | dynamic | — | Vertical map- or screen-space coordinate. |
inline function _AM_FLine(x1, y1, x2, y2)Constructs a framebuffer-space line used by the clipping and rasterization stages.
| Parameter | Type | Default | Description |
|---|---|---|---|
x1 | dynamic | — | Horizontal coordinate of the first endpoint. |
y1 | dynamic | — | Vertical coordinate of the first endpoint. |
x2 | dynamic | — | Horizontal coordinate of the second endpoint. |
y2 | dynamic | — | Vertical coordinate of the second endpoint. |
inline function _AM_FPoint(x, y)Constructs a point in automap framebuffer pixel coordinates.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
y | dynamic | — | Vertical map- or screen-space coordinate. |
inline function _AM_FTOM(x)Converts a framebuffer pixel distance to map-space fixed-point units using the current zoom scale.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
inline function _AM_IDiv(a, b)Returns a signed quotient truncated toward zero, or zero for invalid operands and a zero divisor in `_AM_IDiv`
| Parameter | Type | Default | Description |
|---|---|---|---|
a | dynamic | — | First input operand. |
b | dynamic | — | Second input operand. |
inline function _AM_MLine(x1, y1, x2, y2)Constructs a map-space line from two fixed-point endpoints.
| Parameter | Type | Default | Description |
|---|---|---|---|
x1 | dynamic | — | Horizontal coordinate of the first endpoint. |
y1 | dynamic | — | Vertical coordinate of the first endpoint. |
x2 | dynamic | — | Horizontal coordinate of the second endpoint. |
y2 | dynamic | — | Vertical coordinate of the second endpoint. |
inline function _AM_Mod(n, d)Computes a non-negative remainder for grid alignment, returning zero for a zero divisor.
| Parameter | Type | Default | Description |
|---|---|---|---|
n | dynamic | — | Number of values to process. |
d | dynamic | — | Divisor or direction value used by the operation. |
inline function _AM_MPoint(x, y)Constructs a point in map-space fixed-point coordinates.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
y | dynamic | — | Vertical map- or screen-space coordinate. |
inline function _AM_MTOF(x)Converts a map-space fixed-point distance to framebuffer pixels using the current zoom scale.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
inline function _AM_PutPixel(x, y, color)Writes one clipped color index into the logical automap framebuffer.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
y | dynamic | — | Vertical map- or screen-space coordinate. |
color | dynamic | — | Doom palette index used for drawing. |
inline function _AM_ToLowerAscii(c)Folds one uppercase ASCII byte to lowercase while leaving all other bytes unchanged.
| Parameter | Type | Default | Description |
|---|---|---|---|
c | dynamic | — | C value supplied to `_AM_ToLowerAscii`. |
function AM_activateNewScale()Recomputes the map-space viewport for the current zoom while preserving its center point.
function AM_addMark()Adds mark entries to the automap.
function AM_changeWindowLoc()Applies manual pan increments when follow mode is off and clamps the viewport to level bounds.
function AM_changeWindowScale()Applies the pending zoom multiplier, clamps it to level limits, derives its inverse, and recenters the viewport.
function AM_clearFB()Fills the clipped automap viewport in the logical framebuffer with its background palette index.
const AM_CLEARMARKKEY = 99Defines the input key code for am clearmarkkey.
function AM_clearMarks()Replaces every mark slot with the unused sentinel and restarts insertion at slot zero.
function AM_clipMline(ml, fl)Computes mline values for the automap.
| Parameter | Type | Default | Description |
|---|---|---|---|
ml | dynamic | — | Ml value supplied to `AM_clipMline`. |
fl | dynamic | — | Fl value supplied to `AM_clipMline`. |
function AM_doFollowPlayer()Recenters the map only when the tracked player position changes and remembers that position for the next frame.
function AM_drawCrosshair(color)Draws the single-pixel cursor at the center of the automap window.
| Parameter | Type | Default | Description |
|---|---|---|---|
color | dynamic | — | Doom palette index used for drawing. |
function AM_Drawer()Renders one complete automap frame in layer order, including geometry, actors, marks, and cursor.
function AM_drawFline(fl, color)Clips and rasterizes a framebuffer-space line with integer stepping.
| Parameter | Type | Default | Description |
|---|---|---|---|
fl | dynamic | — | Fl value supplied to `AM_drawFline`. |
color | dynamic | — | Doom palette index used for drawing. |
function AM_drawGrid(color)Draws map-aligned grid lines across the visible automap extent when the grid option is enabled.
| Parameter | Type | Default | Description |
|---|---|---|---|
color | dynamic | — | Doom palette index used for drawing. |
function AM_drawLineCharacter(lineset, count, scale, angle, color, x, y)Transforms and draws a vector glyph at a map position, applying scale and rotation to each source segment.
| Parameter | Type | Default | Description |
|---|---|---|---|
lineset | dynamic | — | Lineset value supplied to `AM_drawLineCharacter`. |
count | dynamic | — | Number of elements or iterations to process. |
scale | dynamic | — | Scale value supplied to `AM_drawLineCharacter`. |
angle | dynamic | — | Doom binary-angle measurement. |
color | dynamic | — | Doom palette index used for drawing. |
x | dynamic | — | Horizontal map- or screen-space coordinate. |
y | dynamic | — | Vertical map- or screen-space coordinate. |
function AM_drawMarks()Projects user mark positions and labels them with numbered patch glyphs.
function AM_drawMline(ml, color)Projects a map-space line into the automap window and rasterizes the visible segment.
| Parameter | Type | Default | Description |
|---|---|---|---|
ml | dynamic | — | Ml value supplied to `AM_drawMline`. |
color | dynamic | — | Doom palette index used for drawing. |
function AM_drawPlayers()Draws the local or network player arrow glyphs at their interpolated positions and facing angles.
function AM_drawThings(color, radius)Draws cheat-visible map objects as scaled vector triangles around their world positions.
| Parameter | Type | Default | Description |
|---|---|---|---|
color | dynamic | — | Doom palette index used for drawing. |
radius | dynamic | — | Radius value supplied to `AM_drawThings`. |
function AM_drawWalls()Classifies discovered map lines by geometry and special type, then draws them with the corresponding automap colors.
const AM_ENDKEY = KEY_TABDefines the input key code for am endkey.
function AM_findMinMaxBoundaries()Computes minimum maximum boundaries values for the automap.
const AM_FOLLOWKEY = 102Defines the input key code for am followkey.
const AM_FRACUNIT = 65536Defines am fracunit for the am map subsystem.
function AM_getIslope(ml, sl)Computes both dy/dx and dx/dy for a map line, using signed sentinels for vertical and horizontal cases.
| Parameter | Type | Default | Description |
|---|---|---|---|
ml | dynamic | — | Ml value supplied to `AM_getIslope`. |
sl | dynamic | — | Sl value supplied to `AM_getIslope`. |
const AM_GOBIGKEY = 48Defines the input key code for am gobigkey.
const AM_GRIDKEY = 103Defines the input key code for am gridkey.
function AM_initVariables()Activates the automap, resets frame-local counters and pan state, selects the console player, and centers the viewport.
function AM_LevelInit()Resets the framebuffer viewport and initial zoom, derives level map bounds, and clears the level-start flag.
function AM_loadPics()Resolves and pins the ten AMMNUM digit patches used to label player map marks.
const AM_MARKKEY = 109Defines the input key code for am markkey.
const AM_MAXINT = 2147483647Defines the maximum am maxint accepted by the am map subsystem.
function AM_maxOutWindowScale()Clamps zoom-in to the configured maximum map-to-frame scale.
function AM_minOutWindowScale()Clamps zoom-out at the scale where the complete level bounding box fits in the automap window.
const AM_MSGENTERED = AM_MSGHEADER | 101 << 8Defines am msgentered for the am map subsystem.
const AM_MSGEXITED = AM_MSGHEADER | 120 << 8Defines am msgexited for the am map subsystem.
const AM_MSGHEADER = 97 << 24 + 109 << 16Defines am msgheader for the am map subsystem.
const AM_NUMMARKPOINTS = 10Defines the am nummarkpoints count used by the am map subsystem.
const AM_PANDOWNKEY = KEY_DOWNARROWDefines the input key code for am pandownkey.
const AM_PANLEFTKEY = KEY_LEFTARROWDefines the input key code for am panleftkey.
const AM_PANRIGHTKEY = KEY_RIGHTARROWDefines the input key code for am panrightkey.
const AM_PANUPKEY = KEY_UPARROWDefines the input key code for am panupkey.
function AM_Responder(ev)Consumes automap key events, toggling modes and updating pan, zoom, follow, grid, and mark state.
| Parameter | Type | Default | Description |
|---|---|---|---|
ev | dynamic | — | Input event to process. |
function AM_restoreScaleAndLoc()Restores the saved viewport, repairs invalid dimensions from the active zoom, and refreshes its far edges.
function AM_rotate(x, y, a)Rotates a map-space vector by a Doom binary angle using the fine sine/cosine tables.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | dynamic | — | Horizontal map- or screen-space coordinate. |
y | dynamic | — | Vertical map- or screen-space coordinate. |
a | dynamic | — | First input operand. |
function AM_saveScaleAndLoc()Snapshots the current map viewport so big-map mode can later restore the prior zoom and location.
function AM_Start()Activates the automap once, prepares level/view state and mark graphics, then notifies the status bar.
const AM_STARTKEY = KEY_TABDefines the input key code for am startkey.
function AM_Stop()Releases mark graphics, restores normal view rendering, and notifies the status bar that the automap closed.
function AM_Ticker()Applies held pan and zoom increments once per game tic while the automap is active.
function AM_unloadPics()Drops automap mark-patch references when leaving the map display.
function AM_updateLightLev()Increments the automap pulse counter used to vary wall brightness over successive frames.
const AM_ZOOMINKEY = 61Defines the input key code for am zoominkey.
const AM_ZOOMOUTKEY = 45Defines the input key code for am zoomoutkey.
amclockTracks the mutable amclock value used by the am map subsystem.
automapactiveTracks whether automapactive is active in the am map subsystem.
const BACKGROUND = BLACKDefines background for the am map subsystem.
const BLACK = 0Defines the Doom palette selection for black.
const BROWNRANGE = 16Defines brownrange for the am map subsystem.
const BROWNS = 4 * 16Defines the Doom palette selection for browns.
const CDWALLCOLORS = YELLOWSDefines the Doom palette selection for cdwallcolors.
cheat_amapTracks the mutable cheat amap value used by the am map subsystem.
cheat_amap_seqTracks the mutable cheat amap seq value used by the am map subsystem.
cheatingTracks the mutable cheating value used by the am map subsystem.
f_hTracks the mutable f h value used by the am map subsystem.
f_oldlocTracks the mutable f oldloc value used by the am map subsystem.
const F_PANINC = 4Defines f paninc for the am map subsystem.
f_wTracks the mutable f w value used by the am map subsystem.
f_xTracks the mutable f x value used by the am map subsystem.
f_yTracks the mutable f y value used by the am map subsystem.
const FB = 0Defines fb for the am map subsystem.
fbHolds the optional fb resource used by the am map subsystem.
const FDWALLCOLORS = BROWNSDefines the Doom palette selection for fdwallcolors.
finit_heightTracks the mutable finit height value used by the am map subsystem.
finit_widthTracks the mutable finit width value used by the am map subsystem.
fline_t struct
followplayerTracks the mutable followplayer value used by the am map subsystem.
fpoint_t struct
ftom_zoommulTracks the mutable ftom zoommul value used by the am map subsystem.
const GRAYS = 6 * 16Defines the Doom palette selection for grays.
const GRAYSRANGE = 16Defines graysrange for the am map subsystem.
const GREENRANGE = 16Defines greenrange for the am map subsystem.
const GREENS = 7 * 16Defines the Doom palette selection for greens.
gridTracks the mutable grid value used by the am map subsystem.
const GRIDCOLORS = GRAYS + GRAYSRANGE >> 1Defines the Doom palette selection for gridcolors.
const INITSCALEMTOF = 13107Defines initscalemtof for the am map subsystem.
islope_t struct
leveljuststartedTracks the mutable leveljuststarted value used by the am map subsystem.
lightlevTracks the mutable lightlev value used by the am map subsystem.
m_hTracks the mutable m h value used by the am map subsystem.
m_panincTracks the mutable m paninc value used by the am map subsystem.
m_wTracks the mutable m w value used by the am map subsystem.
m_xTracks the mutable m x value used by the am map subsystem.
m_x2Tracks the mutable m x2 value used by the am map subsystem.
m_yTracks the mutable m y value used by the am map subsystem.
m_y2Tracks the mutable m y2 value used by the am map subsystem.
const M_ZOOMIN = 66846Defines m zoomin for the am map subsystem.
const M_ZOOMOUT = 64250Defines m zoomout for the am map subsystem.
marknumsStores the marknums collection used by the am map subsystem.
markpointnumTracks the mutable markpointnum value used by the am map subsystem.
markpointsStores the markpoints collection used by the am map subsystem.
max_hTracks the mutable max h value used by the am map subsystem.
max_scale_mtofTracks the mutable max scale mtof value used by the am map subsystem.
max_wTracks the mutable max w value used by the am map subsystem.
max_xTracks the mutable max x value used by the am map subsystem.
max_yTracks the mutable max y value used by the am map subsystem.
min_hTracks the mutable min h value used by the am map subsystem.
min_scale_mtofTracks the mutable min scale mtof value used by the am map subsystem.
min_wTracks the mutable min w value used by the am map subsystem.
min_xTracks the mutable min x value used by the am map subsystem.
min_yTracks the mutable min y value used by the am map subsystem.
mline_t struct
mpoint_t struct
mtof_zoommulTracks the mutable mtof zoommul value used by the am map subsystem.
old_m_hTracks the mutable old m h value used by the am map subsystem.
old_m_wTracks the mutable old m w value used by the am map subsystem.
old_m_xTracks the mutable old m x value used by the am map subsystem.
old_m_yTracks the mutable old m y value used by the am map subsystem.
plrHolds the optional plr resource used by the am map subsystem.
const REDRANGE = 16Defines redrange for the am map subsystem.
const REDS = 256 - 5 * 16Defines the Doom palette selection for reds.
scale_ftomTracks the mutable scale ftom value used by the am map subsystem.
scale_mtofTracks the mutable scale mtof value used by the am map subsystem.
stoppedTracks whether stopped is active in the am map subsystem.
const THINGCOLORS = GREENSDefines the Doom palette selection for thingcolors.
const TSWALLCOLORS = GRAYSDefines the Doom palette selection for tswallcolors.
const WALLCOLORS = REDSDefines the Doom palette selection for wallcolors.
const WHITE = 256 - 47Defines the Doom palette selection for white.
const XHAIRCOLORS = GRAYSDefines the Doom palette selection for xhaircolors.
const YELLOWRANGE = 1Defines yellowrange for the am map subsystem.
const YELLOWS = 256 - 32 + 7Defines the Doom palette selection for yellows.
const YOURCOLORS = WHITEDefines the Doom palette selection for yourcolors.