2 #include "player_render.h"
3 #include "vg/vg_rigidbody.h"
5 typedef struct replay_buffer replay_buffer
;
6 typedef struct replay_frame replay_frame
;
7 typedef struct replay_keyframe replay_keyframe
;
9 typedef struct replay_gamestate replay_gamestate
;
10 typedef struct replay_sfx replay_sfx
;
12 struct replay_buffer
{
16 replay_frame
*head
, *tail
, *cursor_frame
,
21 enum replay_framedata
{
22 k_replay_framedata_animator
,
23 k_replay_framedata_gamestate
,
24 k_replay_framedata_internal_gamestate
,
25 k_replay_framedata_sfx
,
26 k_replay_framedata_glider
,
27 k_replay_framedata_rows
38 struct replay_cam cam
;
43 enum player_subsystem system
;
45 u16 data_table
[k_replay_framedata_rows
][2];
48 /* player-defined replay frames */
49 struct replay_keyframe
51 struct replay_cam cam
;
55 struct replay_gamestate
57 rigidbody rb
, glider_rb
; /* TODO: these don't need to be saved with their
60 struct player_cam_controller cam_control
;
61 u32 current_run_version
;
65 /* we save this per-anim-frame. if there glider is existing in any state */
66 struct replay_glider_data
68 bool have_glider
, glider_orphan
;
81 replay_frame
*resume_target
;
83 f32 resume_transition
;
86 k_replay_control_scrub
= 0x00,
87 k_replay_control_play
= 0x01,
88 k_replay_control_resume
= 0x02
92 struct gui_helper
*helper_resume
, *helper_freecam
;
94 vg_camera replay_freecam
;
98 v3f freecam_v
, freecam_w
;
102 replay_keyframe keyframes
[32];
106 extern player_replay
;
108 int replay_seek( replay_buffer
*replay
, f64 t
);
110 replay_frame
*replay_find_recent_stateframe( replay_buffer
*replay
);
111 void replay_get_camera( replay_buffer
*replay
, vg_camera
*cam
);
112 void replay_get_frame_camera( replay_frame
*frame
, vg_camera
*cam
);
113 f32
replay_subframe_time( replay_buffer
*replay
);
114 void replay_clear( replay_buffer
*replay
);
116 replay_frame_data( replay_frame
*frame
, enum replay_framedata type
);
118 void skaterift_replay_pre_update(void);
119 void skaterift_replay_imgui(void);
120 void skaterift_replay_debug_info(void);
121 void skaterift_record_frame( replay_buffer
*replay
,
122 int force_gamestate
);
123 void skaterift_replay_post_render(void);
124 void skaterift_replay_init(void);
125 void skaterift_get_replay_cam( vg_camera
*cam
);