MiniQuake

src/miniquake/format/bsp.ml

Package
miniquake.format.bsp
Reachable
Yes

Imports

Declarations

animationSlot

function animationSlot(name)

Implements the `animationSlot` operation for `miniquake.format.bsp` (animation slot).

ParameterTypeDefaultDescription
namedynamic—Stable name that identifies the requested object or option.

View source

CalcSurfaceExtents

function CalcSurfaceExtents(map, faceIndex)

Implements the `CalcSurfaceExtents` operation for `miniquake.format.bsp` (calc surface extents).

ParameterTypeDefaultDescription
mapdynamic—The map input consumed by `CalcSurfaceExtents`.
faceIndexdynamic—Zero-based index of the requested entry.

View source

ceilValue

function ceilValue(value)

Return ceil value derived from the active module state.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `ceilValue`.

View source

decompressVisibility

function decompressVisibility(data, offset, rowBytes)

Implements the `decompressVisibility` operation for `miniquake.format.bsp` (decompress visibility).

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
offsetdynamic—Zero-based offset of the requested data.
rowBytesdynamic—Byte data consumed by the operation.

View source

emptyAnimationTable

function emptyAnimationTable(count)

Implements the `emptyAnimationTable` operation for `miniquake.format.bsp` (empty animation table).

ParameterTypeDefaultDescription
countdynamic—Number of entries or units to process.

View source

entityValue

function entityValue(entity, key)

Return entity value derived from the active module state.

ParameterTypeDefaultDescription
entitydynamic—Entity affected by the operation.
keydynamic—Key used to identify the requested entry.

View source

entityVector

function entityVector(entity, key)

Implements the `entityVector` operation for `miniquake.format.bsp` (entity vector).

ParameterTypeDefaultDescription
entitydynamic—Entity affected by the operation.
keydynamic—Key used to identify the requested entry.

View source

exactPrefix

function exactPrefix(text, prefix)

Implements the `exactPrefix` operation for `miniquake.format.bsp` (exact prefix).

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.
prefixdynamic—The prefix input consumed by `exactPrefix`.

View source

faceUnderwater

function faceUnderwater(map, faceIndex)

Implements the `faceUnderwater` operation for `miniquake.format.bsp` (face underwater).

ParameterTypeDefaultDescription
mapdynamic—The map input consumed by `faceUnderwater`.
faceIndexdynamic—Zero-based index of the requested entry.

View source

floorValue

function floorValue(value)

Implements the `floorValue` operation for `miniquake.format.bsp` (floor value).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `floorValue`.

View source

load

function load(filename)

Implements the `load` operation for `miniquake.format.bsp` (load).

ParameterTypeDefaultDescription
filenamedynamic—Path of the file to process.

View source

Mod_DecompressVis

function Mod_DecompressVis(data, offset, numLeafs)

Mirror Quake's Mod_DecompressVis routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
offsetdynamic—Zero-based offset of the requested data.
numLeafsdynamic—The num leafs input consumed by `Mod_DecompressVis`.

View source

Mod_LoadBrushModel

function Mod_LoadBrushModel(data, filename)

Mirror Quake's Mod_LoadBrushModel routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
filenamedynamic—Path of the file to process.

View source

Mod_LoadClipnodes

function Mod_LoadClipnodes(data, lump)

Mirror Quake's Mod_LoadClipnodes routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadClipnodes`.

View source

Mod_LoadEdges

function Mod_LoadEdges(data, lump)

Mirror Quake's Mod_LoadEdges routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadEdges`.

View source

Mod_LoadEntities

function Mod_LoadEntities(data, lump)

Mirror Quake's Mod_LoadEntities routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadEntities`.

View source

Mod_LoadFaces

function Mod_LoadFaces(data, lump)

Mirror Quake's Mod_LoadFaces routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadFaces`.

View source

Mod_LoadLeafs

function Mod_LoadLeafs(data, lump)

Mirror Quake's Mod_LoadLeafs routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadLeafs`.

View source

Mod_LoadLighting

function Mod_LoadLighting(data, lump)

Mirror Quake's Mod_LoadLighting routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadLighting`.

View source

Mod_LoadMarksurfaces

function Mod_LoadMarksurfaces(data, lump)

Mirror Quake's Mod_LoadMarksurfaces routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadMarksurfaces`.

View source

Mod_LoadNodes

function Mod_LoadNodes(data, lump)

Mirror Quake's Mod_LoadNodes routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadNodes`.

View source

Mod_LoadPlanes

function Mod_LoadPlanes(data, lump)

Mirror Quake's Mod_LoadPlanes routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadPlanes`.

View source

Mod_LoadSubmodels

function Mod_LoadSubmodels(data, lump)

Mirror Quake's Mod_LoadSubmodels routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadSubmodels`.

View source

Mod_LoadSurfedges

function Mod_LoadSurfedges(data, lump)

Mirror Quake's Mod_LoadSurfedges routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadSurfedges`.

View source

Mod_LoadTexinfo

function Mod_LoadTexinfo(data, lump)

Mirror Quake's Mod_LoadTexinfo routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadTexinfo`.

View source

Mod_LoadTextures

function Mod_LoadTextures(data, lump)

Logical equivalents of the original per-lump loaders. Their storage outputs are immutable arrays rather than hunk pointer ranges.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadTextures`.

View source

Mod_LoadVertexes

function Mod_LoadVertexes(data, lump)

Mirror Quake's Mod_LoadVertexes routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadVertexes`.

View source

Mod_LoadVisibility

function Mod_LoadVisibility(data, lump)

Mirror Quake's Mod_LoadVisibility routine and its observable state changes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `Mod_LoadVisibility`.

View source

Mod_SetParent

function Mod_SetParent(map)

Mirror Quake's Mod_SetParent routine and its observable state changes.

ParameterTypeDefaultDescription
mapdynamic—The map input consumed by `Mod_SetParent`.

View source

parse

function parse(data, filename)

Implements the `parse` operation for `miniquake.format.bsp` (parse).

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
filenamedynamic—Path of the file to process.

View source

parseClipNodes

function parseClipNodes(data, lump)

Read and validate clip nodes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseClipNodes`.

View source

parseEdges

function parseEdges(data, lump)

Read and validate edges.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseEdges`.

View source

parseEntities

function parseEntities(text)

Read and validate entities.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.

View source

parseFaces

function parseFaces(data, lump)

Read and validate faces.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseFaces`.

View source

parseLeafs

function parseLeafs(data, lump)

Read and validate leafs.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseLeafs`.

View source

parseLumps

function parseLumps(data)

Read and validate lumps.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.

View source

parseMarkSurfaces

function parseMarkSurfaces(data, lump)

Read and validate mark surfaces.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseMarkSurfaces`.

View source

parseModels

function parseModels(data, lump)

Read and validate models.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseModels`.

View source

parseNodes

function parseNodes(data, lump)

Read and validate nodes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseNodes`.

View source

parsePlanes

function parsePlanes(data, lump)

Read and validate planes.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parsePlanes`.

View source

parseSurfEdges

function parseSurfEdges(data, lump)

Read and validate surf edges.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseSurfEdges`.

View source

parseTexInfo

function parseTexInfo(data, lump)

Read and validate tex info.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseTexInfo`.

View source

parseTextures

function parseTextures(data, lump)

Read and validate textures.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseTextures`.

View source

parseVector

function parseVector(text)

Read and validate vector.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.

View source

parseVertices

function parseVertices(data, lump)

Read and validate vertices.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
lumpdynamic—The lump input consumed by `parseVertices`.

View source

planeSignBits

function planeSignBits(plane)

Return plane sign bits derived from the active module state.

ParameterTypeDefaultDescription
planedynamic—The plane input consumed by `planeSignBits`.

View source

sameAnimationName

function sameAnimationName(left, right)

Return same animation name derived from the active module state.

ParameterTypeDefaultDescription
leftdynamic—The left input consumed by `sameAnimationName`.
rightdynamic—The right input consumed by `sameAnimationName`.

View source

sequenceTextureAnimations

function sequenceTextureAnimations(textures)

The pointer links of texture_t are represented as stable texture indices.

ParameterTypeDefaultDescription
texturesdynamic—The textures input consumed by `sequenceTextureAnimations`.

View source

surfaceVertex

function surfaceVertex(map, face, edgeNumber)

Implements the `surfaceVertex` operation for `miniquake.format.bsp` (surface vertex).

ParameterTypeDefaultDescription
mapdynamic—The map input consumed by `surfaceVertex`.
facedynamic—The face input consumed by `surfaceVertex`.
edgeNumberdynamic—The edge number input consumed by `surfaceVertex`.

View source

texInfoMipAdjust

function texInfoMipAdjust(info)

Implements the `texInfoMipAdjust` operation for `miniquake.format.bsp` (tex info mip adjust).

ParameterTypeDefaultDescription
infodynamic—The info input consumed by `texInfoMipAdjust`.

View source

TEXTURE_ANIMATION_CACHE_SIZE

const TEXTURE_ANIMATION_CACHE_SIZE = 16

BSP texture arrays are immutable after loading. Cache their linked animation tables so a render-frame lookup does not rebuild hundreds of short arrays for every visible animated texture.

View source

textureAnimationCacheKeys

textureAnimationCacheKeys

Tracks the module-level texture animation cache keys state owned by `miniquake.format.bsp`.

View source

textureAnimationCacheSources

textureAnimationCacheSources

Tracks the module-level texture animation cache sources state owned by `miniquake.format.bsp`.

View source

textureAnimationCacheTables

textureAnimationCacheTables

Tracks the module-level texture animation cache tables state owned by `miniquake.format.bsp`.

View source

textureAnimationIndex

function textureAnimationIndex(textures, baseIndex, time, alternate)

Return texture animation index derived from the active module state.

ParameterTypeDefaultDescription
texturesdynamic—The textures input consumed by `textureAnimationIndex`.
baseIndexdynamic—Zero-based index of the requested entry.
timedynamic—Simulation or presentation time for the operation.
alternatedynamic—The alternate input consumed by `textureAnimationIndex`.

View source

tokenizeEntities

function tokenizeEntities(text)

Convert entities into its canonical representation.

ParameterTypeDefaultDescription
textdynamic—Text to parse or process.

View source

validateBrushModel

function validateBrushModel(map)

Validate brush model and report any incompatibility.

ParameterTypeDefaultDescription
mapdynamic—The map input consumed by `validateBrushModel`.

View source

validLeafVisibilityOffset

function validLeafVisibilityOffset(offset, visibilitySize)

External BSP29 models (ammo and health boxes in the retail data) have no visibility lump and store visofs 0 in their leaves. GLQuake accepts this: Mod_LoadVisibility leaves loadmodel->visdata NULL and NULL + 0 remains the no-PVS case. World BSPs additionally use -1 as the explicit no-PVS sentinel. Preserve both original encodings while still rejecting offsets outside a non-empty visibility lump.

ParameterTypeDefaultDescription
offsetdynamic—Zero-based offset of the requested data.
visibilitySizedynamic—Size of the requested data or resource.

View source