MiniDoom

src/tables.ml

Provides precomputed lookup tables used by fixed-point math and rendering.

Package
(global)
Reachable
Yes

Imports

Declarations

_TB_Trunc

inline function _TB_Trunc(v)

Truncates a numeric value toward zero for deterministic lookup-table generation.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

ANG180

const ANG180 = 2147483648

Defines ang180 for the tables subsystem.

View source

ANG270

const ANG270 = 3221225472

Defines ang270 for the tables subsystem.

View source

ANG45

const ANG45 = 536870912

Defines ang45 for the tables subsystem.

View source

ANG90

const ANG90 = 1073741824

Defines ang90 for the tables subsystem.

View source

ANGLETOFINESHIFT

const ANGLETOFINESHIFT = 19

Defines angletofineshift for the tables subsystem.

View source

DBITS

const DBITS = 5

Defines dbits for the tables subsystem.

View source

FINEANGLES

const FINEANGLES = 8192

Defines fineangles for the tables subsystem.

View source

finecosine

finecosine

Holds the optional finecosine resource used by the tables subsystem.

View source

FINEMASK

const FINEMASK = FINEANGLES - 1

Defines finemask for the tables subsystem.

View source

finesine

finesine

Holds the optional finesine resource used by the tables subsystem.

View source

finetangent

finetangent

Holds the optional finetangent resource used by the tables subsystem.

View source

PI

const PI = 3.141592657

Defines pi for the tables subsystem.

View source

SLOPEBITS

const SLOPEBITS = 11

Defines slopebits for the tables subsystem.

View source

SlopeDiv

function SlopeDiv(num, den)

Maps an unsigned rise/run ratio into Doom's bounded slope-table index without overflowing the numerator shift.

ParameterTypeDefaultDescription
numdynamic—Index identifying the requested item.
dendynamic—Den value supplied to `SlopeDiv`.

View source

SLOPERANGE

const SLOPERANGE = 2048

Defines sloperange for the tables subsystem.

View source

Tables_Init

function Tables_Init()

Lazily generates the fixed-point sine, cosine, tangent, and slope-to-angle lookup tables at their canonical Doom sizes.

View source

tantoangle

tantoangle

Holds the optional tantoangle resource used by the tables subsystem.

View source