MiniQuake2

src/miniquake2/renderer/classic/world.ml

Provides miniquake2 renderer classic world facilities for this project.

Package
miniquake2.renderer.classic.world
Reachable
Yes

Imports

Declarations

addBaseTexture

function addBaseTexture(textures, image, generation)

Add base texture.

ParameterTypeDefaultDescription
texturesdynamic—textures value consumed by this operation.
imagedynamic—image value consumed by this operation.
generationdynamic—generation value consumed by this operation.

View source

addWorldDraw

function addWorldDraw(textures, draws, surface, generation)

Add world draw.

ParameterTypeDefaultDescription
texturesdynamic—textures value consumed by this operation.
drawsdynamic—draws value consumed by this operation.
surfacedynamic—surface value consumed by this operation.
generationdynamic—generation value consumed by this operation.

View source

build

function build(map, loadFile, lightStyles, entityFrame, modulate, generation)

Build state.

ParameterTypeDefaultDescription
mapdynamic—map value consumed by this operation.
loadFiledynamic—loadFile value consumed by this operation.
lightStylesdynamic—lightStyles value consumed by this operation.
entityFramedynamic—entityFrame value consumed by this operation.
modulatedynamic—modulate value consumed by this operation.
generationdynamic—generation value consumed by this operation.

View source

buildModelDraws

function buildModelDraws(scene, textures, generation, model)

Build model draws.

ParameterTypeDefaultDescription
scenedynamic—scene value consumed by this operation.
texturesdynamic—textures value consumed by this operation.
generationdynamic—generation value consumed by this operation.
modeldynamic—model value consumed by this operation.

View source

miniquake2.renderer.classic.world.ClassicTgaImage struct

classicWorldDecodeTga

function classicWorldDecodeTga(data, path)

Decode the uncompressed and RLE true-colour TGA variants accepted by ref_gl. The decoder remains MiniLang-owned so custom-server sky data is validated before it enters the renderer resource graph.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
pathdynamic—Path of the file or directory used by the operation.

View source

classicWorldEntityValue

function classicWorldEntityValue(entityText, key)

Return the classic world entity value.

ParameterTypeDefaultDescription
entityTextdynamic—entityText value consumed by this operation.
keydynamic—key value consumed by this operation.

View source

classicWorldSkyAxis

function classicWorldSkyAxis(entityText)

Return the classic world sky axis value.

ParameterTypeDefaultDescription
entityTextdynamic—entityText value consumed by this operation.

View source

classicWorldSkyRotate

function classicWorldSkyRotate(entityText)

Rotate classic world sky.

ParameterTypeDefaultDescription
entityTextdynamic—entityText value consumed by this operation.

View source

classicWorldSkyTexture

function classicWorldSkyTexture(loadFile, skyName, suffix, generation, fallbackPalette)

Return the classic world sky texture value.

ParameterTypeDefaultDescription
loadFiledynamic—loadFile value consumed by this operation.
skyNamedynamic—skyName value consumed by this operation.
suffixdynamic—suffix value consumed by this operation.
generationdynamic—generation value consumed by this operation.
fallbackPalettedynamic—fallbackPalette value consumed by this operation.

View source

configureSky

function configureSky(world, loadFile, name, rotate, axis)

Configure sky.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.
loadFiledynamic—loadFile value consumed by this operation.
namedynamic—Name of the affected item.
rotatedynamic—rotate value consumed by this operation.
axisdynamic—axis value consumed by this operation.

View source

copyLightmapAtlasRow

function copyLightmapAtlasRow(destination, destinationPixel, source, sourcePixel, pixels)

Copy lightmap atlas row.

ParameterTypeDefaultDescription
destinationdynamic—destination value consumed by this operation.
destinationPixeldynamic—destinationPixel value consumed by this operation.
sourcedynamic—source value consumed by this operation.
sourcePixeldynamic—sourcePixel value consumed by this operation.
pixelsdynamic—pixels value consumed by this operation.

View source

copyLightmapIntoAtlas

function copyLightmapIntoAtlas(texture, x, y, width, height, source)

Copy lightmap into atlas.

ParameterTypeDefaultDescription
texturedynamic—texture value consumed by this operation.
xdynamic—Horizontal coordinate used by the operation.
ydynamic—Vertical coordinate used by the operation.
widthdynamic—Width in the coordinate or storage units used by the caller.
heightdynamic—Height in the coordinate or storage units used by the caller.
sourcedynamic—source value consumed by this operation.

View source

findBrushModel

function findBrushModel(world, modelIndex)

Find brush model.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.
modelIndexdynamic—Zero-based index of model.

View source

findTexture

function findTexture(textures, role, name)

Find texture.

ParameterTypeDefaultDescription
texturesdynamic—textures value consumed by this operation.
roledynamic—role value consumed by this operation.
namedynamic—Name of the affected item.

View source

LIGHTMAP_ATLAS_SIZE

const LIGHTMAP_ATLAS_SIZE = 256

Defines the lightmap atlas size constant used by the miniquake2 renderer classic world module.

View source

miniquake2.renderer.classic.world.LightmapAtlasState struct

loadImages

function loadImages(map, loadFile, palette)

Load images.

ParameterTypeDefaultDescription
mapdynamic—map value consumed by this operation.
loadFiledynamic—loadFile value consumed by this operation.
palettedynamic—palette value consumed by this operation.

View source

newLightmapAtlas

function newLightmapAtlas(state)

Return the new lightmap atlas value.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.

View source

packLightmapAtlases

function packLightmapAtlases(draws, brushModels, generation, faceCount)

Pack lightmap atlases.

ParameterTypeDefaultDescription
drawsdynamic—draws value consumed by this operation.
brushModelsdynamic—brushModels value consumed by this operation.
generationdynamic—generation value consumed by this operation.
faceCountdynamic—Number of face to process.

View source

packLightmapDraw

function packLightmapDraw(state, draw)

Pack lightmap draw.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
drawdynamic—draw value consumed by this operation.

View source

PALETTE_PATH

const PALETTE_PATH = "pics/colormap.pcx"

Defines the palette path constant used by the miniquake2 renderer classic world module.

View source

planSignature

function planSignature(world)

Return the plan signature value.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.

View source

quakePalette

function quakePalette(loadFile)

Return the quake palette value.

ParameterTypeDefaultDescription
loadFiledynamic—loadFile value consumed by this operation.

View source

readBytes

function readBytes(loadFile, path)

Read bytes.

ParameterTypeDefaultDescription
loadFiledynamic—loadFile value consumed by this operation.
pathdynamic—Path of the file or directory used by the operation.

View source

surfaceBounds

function surfaceBounds(surface)

Return the surface bounds.

ParameterTypeDefaultDescription
surfacedynamic—surface value consumed by this operation.

View source

texturePath

function texturePath(name)

Return the texture path.

ParameterTypeDefaultDescription
namedynamic—Name of the affected item.

View source

triangleCount

function triangleCount(world)

Return the triangle count.

ParameterTypeDefaultDescription
worlddynamic—world value consumed by this operation.

View source