MiniQuake

src/miniquake/protocol_transients.ml

Package
miniquake.protocol_transients
Reachable
Yes

Imports

Declarations

activeCompactBeamList

function activeCompactBeamList(beams, currentTime)

Return only the records that CL_UpdateTEnts would draw at currentTime. This is deliberately a view over the compact beam state: expired records remain in the retained fixed-slot state so CL_ParseBeam can still find a previous entity in pass one, exactly like the original cl_beams[MAX_BEAMS] array.

ParameterTypeDefaultDescription
beamsdynamic—The beams input consumed by `activeCompactBeamList`.
currentTimedynamic—Time value used by the operation.

View source

beamAlive

function beamAlive(endTime, currentTime)

Implements the `beamAlive` operation for `miniquake.protocol_transients` (beam alive).

ParameterTypeDefaultDescription
endTimedynamic—Time value used by the operation.
currentTimedynamic—Time value used by the operation.

View source

beamEndTime

function beamEndTime(currentTime)

beam_t.endtime and dlight_t.die are C floats while cl.time is double.

ParameterTypeDefaultDescription
currentTimedynamic—Time value used by the operation.

View source

canWriteDynamicSound

inline function canWriteDynamicSound(buffer)

WinQuake reserves a conservative 16-byte tail before looking up the sound. Equality is accepted; only cursize > MAX_DATAGRAM-16 drops the event.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `canWriteDynamicSound`.

View source

cFloat

function cFloat(value)

Implements the `cFloat` operation for `miniquake.protocol_transients` (c float).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `cFloat`.

View source

cFloatProduct

function cFloatProduct(left, right)

Implements the `cFloatProduct` operation for `miniquake.protocol_transients` (c float product).

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

View source

clientSoundAttenuation

function clientSoundAttenuation(attenuationByte)

Implements the `clientSoundAttenuation` operation for `miniquake.protocol_transients` (client sound attenuation).

ParameterTypeDefaultDescription
attenuationBytedynamic—The attenuation byte input consumed by `clientSoundAttenuation`.

View source

clientSoundVolume

function clientSoundVolume(volumeByte)

CL_ParseStartSoundPacket stores attenuation as float and S_StartSound takes float volume/attenuation parameters. Explicit binary32 conversion prevents MiniLang's wider numeric representation from changing mixer state.

ParameterTypeDefaultDescription
volumeBytedynamic—The volume byte input consumed by `clientSoundVolume`.

View source

compactBeamIndexForSlot

function compactBeamIndexForSlot(beams, slot)

Implements the `compactBeamIndexForSlot` operation for `miniquake.protocol_transients` (compact beam index for slot).

ParameterTypeDefaultDescription
beamsdynamic—The beams input consumed by `compactBeamIndexForSlot`.
slotdynamic—The slot input consumed by `compactBeamIndexForSlot`.

View source

compactBeamSlot

function compactBeamSlot(record, fallback)

The integrated renderer stores compact records instead of beam_t objects. Each record is [wirePayload, endTime, originalSlot]. Retain expired records until their slot is reused: CL_ParseBeam first replaces the same entity even when that beam has expired, and only then searches the first free/expired slot in the fixed 24-entry pool.

ParameterTypeDefaultDescription
recorddynamic—The record input consumed by `compactBeamSlot`.
fallbackdynamic—Value to use when the requested input is unavailable or invalid.

View source

compactBeamSlotTaken

function compactBeamSlotTaken(beams, slot)

Implements the `compactBeamSlotTaken` operation for `miniquake.protocol_transients` (compact beam slot taken).

ParameterTypeDefaultDescription
beamsdynamic—The beams input consumed by `compactBeamSlotTaken`.
slotdynamic—The slot input consumed by `compactBeamSlotTaken`.

View source

dynamicLightDieTime

function dynamicLightDieTime(currentTime)

Implements the `dynamicLightDieTime` operation for `miniquake.protocol_transients` (dynamic light die time).

ParameterTypeDefaultDescription
currentTimedynamic—Time value used by the operation.

View source

dynamicSoundWireSize

function dynamicSoundWireSize(volume, attenuation)

Return dynamic sound wire size derived from the active module state.

ParameterTypeDefaultDescription
volumedynamic—The volume input consumed by `dynamicSoundWireSize`.
attenuationdynamic—The attenuation input consumed by `dynamicSoundWireSize`.

View source

firstUnusedCompactBeamSlot

function firstUnusedCompactBeamSlot(beams)

Return first unused compact beam slot for the active module state.

ParameterTypeDefaultDescription
beamsdynamic—The beams input consumed by `firstUnusedCompactBeamSlot`.

View source

insertCompactBeamBySlot

function insertCompactBeamBySlot(beams, record)

Add state for insert compact beam by slot.

ParameterTypeDefaultDescription
beamsdynamic—The beams input consumed by `insertCompactBeamBySlot`.
recorddynamic—The record input consumed by `insertCompactBeamBySlot`.

View source

isBeamType

function isBeamType(type)

Report whether is beam type.

ParameterTypeDefaultDescription
typedynamic—The type input consumed by `isBeamType`.

View source

isPointType

function isPointType(type)

Report whether is point type.

ParameterTypeDefaultDescription
typedynamic—The type input consumed by `isPointType`.

View source

MAX_BEAMS

const MAX_BEAMS = 24

Defines the max beams value used by `miniquake.protocol_transients`.

View source

normalizeCompactBeamList

function normalizeCompactBeamList(beams)

Convert compact beam list into its canonical representation.

ParameterTypeDefaultDescription
beamsdynamic—The beams input consumed by `normalizeCompactBeamList`.

View source

packSoundChannel

function packSoundChannel(entityNumber, channel)

Implements the `packSoundChannel` operation for `miniquake.protocol_transients` (pack sound channel).

ParameterTypeDefaultDescription
entityNumberdynamic—The entity number input consumed by `packSoundChannel`.
channeldynamic—The channel input consumed by `packSoundChannel`.

View source

quakeCSoundAttenuation

function quakeCSoundAttenuation(value)

Implements the `quakeCSoundAttenuation` operation for `miniquake.protocol_transients` (quake c sound attenuation).

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `quakeCSoundAttenuation`.

View source

quakeCSoundChannel

function quakeCSoundChannel(value)

PF_sound receives QuakeC floats. The multiplication by 255 is performed as binary32 before assignment to C int.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `quakeCSoundChannel`.

View source

quakeCSoundVolumeByte

function quakeCSoundVolumeByte(value)

Return quake csound volume byte derived from the active module state.

ParameterTypeDefaultDescription
valuedynamic—Value consumed by `quakeCSoundVolumeByte`.

View source

soundAttenuationByte

function soundAttenuationByte(attenuation)

Return sound attenuation byte derived from the active module state.

ParameterTypeDefaultDescription
attenuationdynamic—The attenuation input consumed by `soundAttenuationByte`.

View source

soundCenter

function soundCenter(origin, minimum, maximum)

Implements the `soundCenter` operation for `miniquake.protocol_transients` (sound center).

ParameterTypeDefaultDescription
origindynamic—World-space origin of the operation.
minimumdynamic—Smallest accepted value.
maximumdynamic—Largest accepted value.

View source

soundCenterComponent

function soundCenterComponent(origin, minimum, maximum)

SV_StartSound computes origin + 0.5 * (mins + maxs), then converts the result to MSG_WriteCoord's float parameter. Keep both binary32 boundaries explicit rather than allowing MiniLang's wider arithmetic to leak into the Protocol-15 coordinate.

ParameterTypeDefaultDescription
origindynamic—World-space origin of the operation.
minimumdynamic—Smallest accepted value.
maximumdynamic—Largest accepted value.

View source

soundChannel

function soundChannel(packedChannel)

Implements the `soundChannel` operation for `miniquake.protocol_transients` (sound channel).

ParameterTypeDefaultDescription
packedChanneldynamic—The packed channel input consumed by `soundChannel`.

View source

soundEntity

function soundEntity(packedChannel)

Implements the `soundEntity` operation for `miniquake.protocol_transients` (sound entity).

ParameterTypeDefaultDescription
packedChanneldynamic—The packed channel input consumed by `soundEntity`.

View source

soundFieldMask

function soundFieldMask(volume, attenuation)

Implements the `soundFieldMask` operation for `miniquake.protocol_transients` (sound field mask).

ParameterTypeDefaultDescription
volumedynamic—The volume input consumed by `soundFieldMask`.
attenuationdynamic—The attenuation input consumed by `soundFieldMask`.

View source

staticSoundAttenuation

function staticSoundAttenuation(attenuationByte)

Implements the `staticSoundAttenuation` operation for `miniquake.protocol_transients` (static sound attenuation).

ParameterTypeDefaultDescription
attenuationBytedynamic—The attenuation byte input consumed by `staticSoundAttenuation`.

View source

staticSoundVolume

function staticSoundVolume(volumeByte)

Implements the `staticSoundVolume` operation for `miniquake.protocol_transients` (static sound volume).

ParameterTypeDefaultDescription
volumeBytedynamic—The volume byte input consumed by `staticSoundVolume`.

View source

TEMP_KIND_BEAM

const TEMP_KIND_BEAM = 2

Defines the temp kind beam value used by `miniquake.protocol_transients`.

View source

TEMP_KIND_EXPLOSION2

const TEMP_KIND_EXPLOSION2 = 3

Defines the temp kind explosion2 value used by `miniquake.protocol_transients`.

View source

TEMP_KIND_POINT

const TEMP_KIND_POINT = 1

Defines the temp kind point value used by `miniquake.protocol_transients`.

View source

tempKind

function tempKind(type)

Implements the `tempKind` operation for `miniquake.protocol_transients` (temp kind).

ParameterTypeDefaultDescription
typedynamic—The type input consumed by `tempKind`.

View source

tempWireSize

function tempWireSize(type)

Return temp wire size derived from the active module state.

ParameterTypeDefaultDescription
typedynamic—The type input consumed by `tempWireSize`.

View source

updateCompactBeamList

function updateCompactBeamList(beams, value, currentTime)

Update module state for compact beam list.

ParameterTypeDefaultDescription
beamsdynamic—The beams input consumed by `updateCompactBeamList`.
valuedynamic—Value consumed by `updateCompactBeamList`.
currentTimedynamic—Time value used by the operation.

View source

updateCompactBeamListResult

function updateCompactBeamListResult(beams, value, currentTime)

Update module state for compact beam list result.

ParameterTypeDefaultDescription
beamsdynamic—The beams input consumed by `updateCompactBeamListResult`.
valuedynamic—Value consumed by `updateCompactBeamListResult`.
currentTimedynamic—Time value used by the operation.

View source

writeBeam

function writeBeam(buffer, type, entityNumber, startPosition, endPosition)

Encode and write beam.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeBeam`.
typedynamic—The type input consumed by `writeBeam`.
entityNumberdynamic—The entity number input consumed by `writeBeam`.
startPositiondynamic—The start position input consumed by `writeBeam`.
endPositiondynamic—The end position input consumed by `writeBeam`.

View source

writeExplosion2

function writeExplosion2(buffer, origin, colorStart, colorLength)

Encode and write explosion2.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeExplosion2`.
origindynamic—World-space origin of the operation.
colorStartdynamic—The color start input consumed by `writeExplosion2`.
colorLengthdynamic—Length of the requested data in units appropriate to the operation.

View source

writePoint

function writePoint(buffer, type, origin)

Encode and write point.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writePoint`.
typedynamic—The type input consumed by `writePoint`.
origindynamic—World-space origin of the operation.

View source

writeReconnect

function writeReconnect(buffer)

Encode and write reconnect.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeReconnect`.

View source

writeStopSound

function writeStopSound(buffer, entityNumber, channel)

Encode and write stop sound.

ParameterTypeDefaultDescription
bufferdynamic—The buffer input consumed by `writeStopSound`.
entityNumberdynamic—The entity number input consumed by `writeStopSound`.
channeldynamic—The channel input consumed by `writeStopSound`.

View source