stdlib/replayView source ↗
replay
27 items · generated by scribe fromstdlib/replay.fd· synced 2026-11-15
Contents
- ReplayFrame (struct)
- ReplayHeader (struct)
- Replay (struct)
- REPLAY_IDLE: (const)
- replay_create (function)
- replay_start_recording (function)
- replay_record_frame (function)
- replay_stop_recording (function)
- replay_start_playback (function)
- replay_make_frame (function)
- replay_get_frame_into (function)
- replay_get_frame (function)
- replay_next_frame (function)
- replay_is_finished (function)
- replay_stop_playback (function)
- replay_mode (function)
- replay_frame_count (function)
- replay_current_frame_idx (function)
- replay_start_seed (function)
- replay_progress (function)
- replay_seek (function)
- replay_set_max_frames (function)
- replay_save (function)
- replay_load (function)
- replay_clear (function)
ReplayFrame
pub struct ReplayFrame {Fields:
| Name | Type |
|---|---|
frame_number | i64 |
key_count | i64 |
key0 | i64 |
key1 | i64 |
key2 | i64 |
key3 | i64 |
mouse_x | i64 |
mouse_y | i64 |
mouse_buttons | i64 |
dt_ms | i64 |
seed | i64 |
Defined at line 23
ReplayHeader
pub struct ReplayHeader {Fields:
| Name | Type |
|---|---|
magic | i64 |
version | i64 |
frame_count | i64 |
start_seed | i64 |
game_name | str |
game_version | str |
recorded_at | i64 |
Defined at line 37
Replay
pub struct Replay {Fields:
| Name | Type |
|---|---|
header | ReplayHeader |
frame_numbers | Vec<i64> |
key_counts | Vec<i64> |
key0s | Vec<i64> |
key1s | Vec<i64> |
key2s | Vec<i64> |
key3s | Vec<i64> |
mouse_xs | Vec<i64> |
mouse_ys | Vec<i64> |
mouse_buttons | Vec<i64> |
dt_ms | Vec<i64> |
seeds | Vec<i64> |
current_frame | i64 |
mode | i64 |
max_frames | i64 |
read_pos | i64 |
read_data | Vec<i64> |
Defined at line 47
REPLAY_IDLE:
pub const REPLAY_IDLE: i64 = 0; pub const REPLAY_RECORDING: i64 = 1; pub const REPLAY_PLAYING: i64 = 2; pub const REPLAY_MAGIC: i64 = 0x46505244; pub const REPLAY_VERSION: i64 = 1;Defined at line 67
replay_create
Create a new replay state.
pub fn replay_create() -> Replay {Returns: Replay
Defined at line 69
replay_start_recording
Start recording a replay.
pub fn replay_start_recording(rp: & mut Replay, seed: i64, game_name: str, game_version: str) -> void {Parameters:
rp:& mut Replayseed:i64game_name:strgame_version:str
Returns: void
Defined at line 78
replay_record_frame
Record a frame of input (up to 4 keys per frame).
pub fn replay_record_frame(rp: & mut Replay, keys: Vec<i64>, mouse_x: i64, mouse_y: i64, mouse_buttons: i64, dt_ms: i64, seed: i64) -> void {Parameters:
rp:& mut Replaykeys:Vec<i64>mouse_x:i64mouse_y:i64mouse_buttons:i64dt_ms:i64seed:i64
Returns: void
Defined at line 98
replay_stop_recording
Stop recording.
pub fn replay_stop_recording(rp: & mut Replay) -> void {Parameters:
rp:& mut Replay
Returns: void
Defined at line 138
replay_start_playback
Start playback of a loaded replay.
pub fn replay_start_playback(rp: & mut Replay) -> void {Parameters:
rp:& mut Replay
Returns: void
Defined at line 143
replay_make_frame
Create a default replay frame (for pre-allocation).
pub fn replay_make_frame() -> ReplayFrame {Returns: ReplayFrame
Defined at line 152
replay_get_frame_into
Get the current replay frame (during playback). Writes into the provided frame.
pub fn replay_get_frame_into(rp: & Replay, out: & mut ReplayFrame) -> void {Parameters:
rp:& Replayout:& mut ReplayFrame
Returns: void
Defined at line 159
replay_get_frame
Get the current replay frame (during playback).
pub fn replay_get_frame(rp: & Replay) -> ReplayFrame {Parameters:
rp:& Replay
Returns: ReplayFrame
Defined at line 202
replay_next_frame
Advance to the next frame during playback.
pub fn replay_next_frame(rp: & mut Replay) -> void {Parameters:
rp:& mut Replay
Returns: void
Defined at line 211
replay_is_finished
Check if playback is finished.
pub fn replay_is_finished(rp: & Replay) -> bool {Parameters:
rp:& Replay
Returns: bool
Defined at line 222
replay_stop_playback
Stop playback.
pub fn replay_stop_playback(rp: & mut Replay) -> void {Parameters:
rp:& mut Replay
Returns: void
Defined at line 227
replay_mode
Get the current replay mode.
pub fn replay_mode(rp: & Replay) -> i64 {Parameters:
rp:& Replay
Returns: i64
Defined at line 232
replay_frame_count
Get the total number of frames.
pub fn replay_frame_count(rp: & Replay) -> i64 {Parameters:
rp:& Replay
Returns: i64
Defined at line 237
replay_current_frame_idx
Get the current frame index (during playback).
pub fn replay_current_frame_idx(rp: & Replay) -> i64 {Parameters:
rp:& Replay
Returns: i64
Defined at line 242
replay_start_seed
Get the start seed from the replay.
pub fn replay_start_seed(rp: & Replay) -> i64 {Parameters:
rp:& Replay
Returns: i64
Defined at line 247
replay_progress
Get the progress (0..1) of playback.
pub fn replay_progress(rp: & Replay) -> f64 {Parameters:
rp:& Replay
Returns: f64
Defined at line 252
replay_seek
Seek to a specific frame (for scrubbing).
pub fn replay_seek(rp: & mut Replay, frame: i64) -> void {Parameters:
rp:& mut Replayframe:i64
Returns: void
Defined at line 260
replay_set_max_frames
Set the maximum recording length (in frames).
pub fn replay_set_max_frames(rp: & mut Replay, max: i64) -> void {Parameters:
rp:& mut Replaymax:i64
Returns: void
Defined at line 273
replay_save
Save the replay to a file as a binary string.
pub fn replay_save(rp: & Replay, path: str) -> bool {Parameters:
rp:& Replaypath:str
Returns: bool
Defined at line 278
replay_load
Load a replay from a file.
pub fn replay_load(rp: & mut Replay, path: str) -> bool {Parameters:
rp:& mut Replaypath:str
Returns: bool
Defined at line 305
replay_clear
Clear the replay buffer.
pub fn replay_clear(rp: & mut Replay) -> void {Parameters:
rp:& mut Replay
Returns: void
Defined at line 379
Generated by scribe, the Fides documentation generator