Files
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.
| Parameter | Type | Default | Description |
|---|
beams | dynamic | — | The beams input consumed by `activeCompactBeamList`. |
currentTime | dynamic | — | Time value used by the operation. |
View source
# beamAlive
function beamAlive(endTime, currentTime)
Implements the `beamAlive` operation for `miniquake.protocol_transients` (beam alive).
| Parameter | Type | Default | Description |
|---|
endTime | dynamic | — | Time value used by the operation. |
currentTime | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
currentTime | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `canWriteDynamicSound`. |
View source
# cFloat
function cFloat(value)
Implements the `cFloat` operation for `miniquake.protocol_transients` (c float).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `cFloat`. |
View source
# cFloatProduct
function cFloatProduct(left, right)
Implements the `cFloatProduct` operation for `miniquake.protocol_transients` (c float product).
| Parameter | Type | Default | Description |
|---|
left | dynamic | — | The left input consumed by `cFloatProduct`. |
right | dynamic | — | The right input consumed by `cFloatProduct`. |
View source
# clientSoundAttenuation
function clientSoundAttenuation(attenuationByte)
Implements the `clientSoundAttenuation` operation for `miniquake.protocol_transients` (client sound attenuation).
| Parameter | Type | Default | Description |
|---|
attenuationByte | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
volumeByte | dynamic | — | 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).
| Parameter | Type | Default | Description |
|---|
beams | dynamic | — | The beams input consumed by `compactBeamIndexForSlot`. |
slot | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
record | dynamic | — | The record input consumed by `compactBeamSlot`. |
fallback | dynamic | — | 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).
| Parameter | Type | Default | Description |
|---|
beams | dynamic | — | The beams input consumed by `compactBeamSlotTaken`. |
slot | dynamic | — | The slot input consumed by `compactBeamSlotTaken`. |
View source
# dynamicLightDieTime
function dynamicLightDieTime(currentTime)
Implements the `dynamicLightDieTime` operation for `miniquake.protocol_transients` (dynamic light die time).
| Parameter | Type | Default | Description |
|---|
currentTime | dynamic | — | Time value used by the operation. |
View source
# dynamicSoundWireSize
function dynamicSoundWireSize(volume, attenuation)
Return dynamic sound wire size derived from the active module state.
| Parameter | Type | Default | Description |
|---|
volume | dynamic | — | The volume input consumed by `dynamicSoundWireSize`. |
attenuation | dynamic | — | The attenuation input consumed by `dynamicSoundWireSize`. |
View source
# firstUnusedCompactBeamSlot
function firstUnusedCompactBeamSlot(beams)
Return first unused compact beam slot for the active module state.
| Parameter | Type | Default | Description |
|---|
beams | dynamic | — | The beams input consumed by `firstUnusedCompactBeamSlot`. |
View source
# insertCompactBeamBySlot
function insertCompactBeamBySlot(beams, record)
Add state for insert compact beam by slot.
| Parameter | Type | Default | Description |
|---|
beams | dynamic | — | The beams input consumed by `insertCompactBeamBySlot`. |
record | dynamic | — | The record input consumed by `insertCompactBeamBySlot`. |
View source
# isBeamType
function isBeamType(type)
Report whether is beam type.
| Parameter | Type | Default | Description |
|---|
type | dynamic | — | The type input consumed by `isBeamType`. |
View source
# isPointType
function isPointType(type)
Report whether is point type.
| Parameter | Type | Default | Description |
|---|
type | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
beams | dynamic | — | The beams input consumed by `normalizeCompactBeamList`. |
View source
# packSoundChannel
function packSoundChannel(entityNumber, channel)
Implements the `packSoundChannel` operation for `miniquake.protocol_transients` (pack sound channel).
| Parameter | Type | Default | Description |
|---|
entityNumber | dynamic | — | The entity number input consumed by `packSoundChannel`. |
channel | dynamic | — | The channel input consumed by `packSoundChannel`. |
View source
# quakeCSoundAttenuation
function quakeCSoundAttenuation(value)
Implements the `quakeCSoundAttenuation` operation for `miniquake.protocol_transients` (quake c sound attenuation).
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `quakeCSoundChannel`. |
View source
# quakeCSoundVolumeByte
function quakeCSoundVolumeByte(value)
Return quake csound volume byte derived from the active module state.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | Value consumed by `quakeCSoundVolumeByte`. |
View source
# soundAttenuationByte
function soundAttenuationByte(attenuation)
Return sound attenuation byte derived from the active module state.
| Parameter | Type | Default | Description |
|---|
attenuation | dynamic | — | The attenuation input consumed by `soundAttenuationByte`. |
View source
# soundCenter
function soundCenter(origin, minimum, maximum)
Implements the `soundCenter` operation for `miniquake.protocol_transients` (sound center).
| Parameter | Type | Default | Description |
|---|
origin | dynamic | — | World-space origin of the operation. |
minimum | dynamic | — | Smallest accepted value. |
maximum | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
origin | dynamic | — | World-space origin of the operation. |
minimum | dynamic | — | Smallest accepted value. |
maximum | dynamic | — | Largest accepted value. |
View source
# soundChannel
function soundChannel(packedChannel)
Implements the `soundChannel` operation for `miniquake.protocol_transients` (sound channel).
| Parameter | Type | Default | Description |
|---|
packedChannel | dynamic | — | The packed channel input consumed by `soundChannel`. |
View source
# soundEntity
function soundEntity(packedChannel)
Implements the `soundEntity` operation for `miniquake.protocol_transients` (sound entity).
| Parameter | Type | Default | Description |
|---|
packedChannel | dynamic | — | 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).
| Parameter | Type | Default | Description |
|---|
volume | dynamic | — | The volume input consumed by `soundFieldMask`. |
attenuation | dynamic | — | The attenuation input consumed by `soundFieldMask`. |
View source
# staticSoundAttenuation
function staticSoundAttenuation(attenuationByte)
Implements the `staticSoundAttenuation` operation for `miniquake.protocol_transients` (static sound attenuation).
| Parameter | Type | Default | Description |
|---|
attenuationByte | dynamic | — | The attenuation byte input consumed by `staticSoundAttenuation`. |
View source
# staticSoundVolume
function staticSoundVolume(volumeByte)
Implements the `staticSoundVolume` operation for `miniquake.protocol_transients` (static sound volume).
| Parameter | Type | Default | Description |
|---|
volumeByte | dynamic | — | 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).
| Parameter | Type | Default | Description |
|---|
type | dynamic | — | The type input consumed by `tempKind`. |
View source
# tempWireSize
function tempWireSize(type)
Return temp wire size derived from the active module state.
| Parameter | Type | Default | Description |
|---|
type | dynamic | — | The type input consumed by `tempWireSize`. |
View source
# updateCompactBeamList
function updateCompactBeamList(beams, value, currentTime)
Update module state for compact beam list.
| Parameter | Type | Default | Description |
|---|
beams | dynamic | — | The beams input consumed by `updateCompactBeamList`. |
value | dynamic | — | Value consumed by `updateCompactBeamList`. |
currentTime | dynamic | — | Time value used by the operation. |
View source
# updateCompactBeamListResult
function updateCompactBeamListResult(beams, value, currentTime)
Update module state for compact beam list result.
| Parameter | Type | Default | Description |
|---|
beams | dynamic | — | The beams input consumed by `updateCompactBeamListResult`. |
value | dynamic | — | Value consumed by `updateCompactBeamListResult`. |
currentTime | dynamic | — | Time value used by the operation. |
View source
# writeBeam
function writeBeam(buffer, type, entityNumber, startPosition, endPosition)
Encode and write beam.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeBeam`. |
type | dynamic | — | The type input consumed by `writeBeam`. |
entityNumber | dynamic | — | The entity number input consumed by `writeBeam`. |
startPosition | dynamic | — | The start position input consumed by `writeBeam`. |
endPosition | dynamic | — | The end position input consumed by `writeBeam`. |
View source
# writeExplosion2
function writeExplosion2(buffer, origin, colorStart, colorLength)
Encode and write explosion2.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeExplosion2`. |
origin | dynamic | — | World-space origin of the operation. |
colorStart | dynamic | — | The color start input consumed by `writeExplosion2`. |
colorLength | dynamic | — | Length of the requested data in units appropriate to the operation. |
View source
# writePoint
function writePoint(buffer, type, origin)
Encode and write point.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writePoint`. |
type | dynamic | — | The type input consumed by `writePoint`. |
origin | dynamic | — | World-space origin of the operation. |
View source
# writeReconnect
function writeReconnect(buffer)
Encode and write reconnect.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeReconnect`. |
View source
# writeStopSound
function writeStopSound(buffer, entityNumber, channel)
Encode and write stop sound.
| Parameter | Type | Default | Description |
|---|
buffer | dynamic | — | The buffer input consumed by `writeStopSound`. |
entityNumber | dynamic | — | The entity number input consumed by `writeStopSound`. |
channel | dynamic | — | The channel input consumed by `writeStopSound`. |
View source