coastline 0.0.4
Loading...
Searching...
No Matches
snapshot.h File Reference

The snapshots of frames of the PC port. More...

Include dependency graph for snapshot.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FrameSnapshot
 Captured race geometry, cameras, and particles for interpolation between simulation steps. More...

Macros

#define g_abFrameSnapshotInUse   (*GetSdlSnapshotUsage())
 Slot-use flags for the active SDL engine's snapshot pool.

Enumerations

enum  { FRAME_SNAPSHOT_COUNT = 5 }
 The capacity of the rotating race snapshot pool. More...

Functions

int(* GetSdlSnapshotUsage (void))[FRAME_SNAPSHOT_COUNT]
void InitFrameSnapshotSlots (void)
 Initialise slot flags, sequence counters, and interpolation timers once per valid pool.
int AcquireNextFrameSnapshotSlot (void)
 Select the oldest unused slot, advancing the current and previous completed slot selectors.
FrameSnapshot * InterpolateFrameSnapshots (float share)
 Blend the last two snapshots of the race into g_InterpolatedFrameSnapshot as InterpolateFrameSnapshotsAndRender() blends them, without drawing, for the SDL game to draw.
void InvalidateFrameSnapshotSlots (void)
 Mark the snapshots of frames as not set up.
int GetInterpolatedFrameCount (void)
 Get the number of frames rendered from interpolated snapshots since the slots were set up.

Variables

FrameSnapshot g_aFrameSnapshots [FRAME_SNAPSHOT_COUNT]
 The rotating snapshot pool, indexed by the current, previous, and blend slot selectors.
FrameSnapshot g_InterpolatedFrameSnapshot
 Temporary output of interpolation between two captured race frames.
int g_dwFrameSnapshotBlendFromSlot
 The earlier snapshot selected for the current blend, or -1 before selection.
int g_nLastInterpolatedSnapshot
 The later snapshot slot selected for interpolation, or -1 before selection.
int g_dwFrameSnapshotCurrentSlot
 The most recent completed snapshot slot, or -1 before the first capture.
int g_dwFrameSnapshotPreviousSlot
 The completed snapshot slot preceding the current slot, or -1 before two captures.
float g_fFrameSnapshotBlendCarry
 Fractional interpolation progress retained from the previous rendered frame.
unsigned g_dwFrameSnapshotBlendStartTime
 The millisecond timer value of the previous interpolation update, or zero before the first.
int g_bFrameSnapshotsInitialized
 Whether the snapshots of frames are set up.
int g_dwInterpolatedFrameCount
 The number of frames rendered from interpolated snapshots since the slots were set up.

Detailed Description

The snapshots of frames of the PC port.

Macro Definition Documentation

◆ g_abFrameSnapshotInUse

#define g_abFrameSnapshotInUse   (*GetSdlSnapshotUsage())

Slot-use flags for the active SDL engine's snapshot pool.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The capacity of the rotating race snapshot pool.

Enumerator
FRAME_SNAPSHOT_COUNT 

Five slots for captured and currently rendered frames.

Function Documentation

◆ GetSdlSnapshotUsage()

int(* GetSdlSnapshotUsage ( void ) )[FRAME_SNAPSHOT_COUNT]
Returns
The active engine's slot-use flags, one per snapshot slot.
Ghidra address:
BRD3D: 0x1039b728

◆ InitFrameSnapshotSlots()

void InitFrameSnapshotSlots ( void )

Initialise slot flags, sequence counters, and interpolation timers once per valid pool.

Ghidra address:
BRD3D: 0x10016910
Ghidra address:
BRGlide: 0x10013e80

◆ AcquireNextFrameSnapshotSlot()

int AcquireNextFrameSnapshotSlot ( void )

Select the oldest unused slot, advancing the current and previous completed slot selectors.

At least one unused slot other than the current write slot must be available.

Returns
The selected write slot, from 0 through FRAME_SNAPSHOT_COUNT - 1.
Ghidra address:
BRD3D: 0x100169b0
Ghidra address:
BRGlide: 0x10013f20

◆ InterpolateFrameSnapshots()

FrameSnapshot * InterpolateFrameSnapshots ( float share)

Blend the last two snapshots of the race into g_InterpolatedFrameSnapshot as InterpolateFrameSnapshotsAndRender() blends them, without drawing, for the SDL game to draw.

Parameters
shareHow far the frame is from the previous snapshot to the current one, from 0 to 1.
Returns
The blended snapshot, or null before the race has two snapshots.

◆ InvalidateFrameSnapshotSlots()

void InvalidateFrameSnapshotSlots ( void )

Mark the snapshots of frames as not set up.

Ghidra address:
BRD3D: 0x10016990
Ghidra address:
BRGlide: 0x10013f00

◆ GetInterpolatedFrameCount()

int GetInterpolatedFrameCount ( void )

Get the number of frames rendered from interpolated snapshots since the slots were set up.

Returns
The number of frames.
Ghidra address:
BRD3D: 0x10016a50
Ghidra address:
BRGlide: 0x10013fc0

Variable Documentation

◆ g_aFrameSnapshots

FrameSnapshot g_aFrameSnapshots[FRAME_SNAPSHOT_COUNT]
extern

The rotating snapshot pool, indexed by the current, previous, and blend slot selectors.

Ghidra address:
BRD3D: 0x1039b760
Ghidra address:
BRGlide: 0x10396f48

◆ g_InterpolatedFrameSnapshot

FrameSnapshot g_InterpolatedFrameSnapshot
extern

Temporary output of interpolation between two captured race frames.

Ghidra address:
BRD3D: 0x10481c10
Ghidra address:
BRGlide: 0x1047d3f8

◆ g_dwFrameSnapshotBlendFromSlot

int g_dwFrameSnapshotBlendFromSlot
extern

The earlier snapshot selected for the current blend, or -1 before selection.

Ghidra address:
BRD3D: 0x104afd14

◆ g_nLastInterpolatedSnapshot

int g_nLastInterpolatedSnapshot
extern

The later snapshot slot selected for interpolation, or -1 before selection.

Ghidra address:
BRD3D: 0x1039b75c

◆ g_dwFrameSnapshotCurrentSlot

int g_dwFrameSnapshotCurrentSlot
extern

The most recent completed snapshot slot, or -1 before the first capture.

Ghidra address:
BRD3D: 0x104afd04

◆ g_dwFrameSnapshotPreviousSlot

int g_dwFrameSnapshotPreviousSlot
extern

The completed snapshot slot preceding the current slot, or -1 before two captures.

Ghidra address:
BRD3D: 0x104afd18

◆ g_fFrameSnapshotBlendCarry

float g_fFrameSnapshotBlendCarry
extern

Fractional interpolation progress retained from the previous rendered frame.

Ghidra address:
BRD3D: 0x1039b73c

◆ g_dwFrameSnapshotBlendStartTime

unsigned g_dwFrameSnapshotBlendStartTime
extern

The millisecond timer value of the previous interpolation update, or zero before the first.

Ghidra address:
BRD3D: 0x104afd0c

◆ g_bFrameSnapshotsInitialized

int g_bFrameSnapshotsInitialized
extern

Whether the snapshots of frames are set up.

Ghidra address:
BRD3D: 0x104afd1c
Ghidra address:
BRGlide: 0x104ab504

◆ g_dwInterpolatedFrameCount

int g_dwInterpolatedFrameCount
extern

The number of frames rendered from interpolated snapshots since the slots were set up.

Ghidra address:
BRD3D: 0x104afd08
Ghidra address:
BRGlide: 0x104ab4f0