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
;
64 /* we save this per-anim-frame. if there glider is existing in any state */
65 struct replay_glider_data
67 bool have_glider
, glider_orphan
;
80 replay_frame
*resume_target
;
82 f32 resume_transition
;
85 k_replay_control_scrub
= 0x00,
86 k_replay_control_play
= 0x01,
87 k_replay_control_resume
= 0x02
91 struct gui_helper
*helper_resume
, *helper_freecam
;
93 vg_camera replay_freecam
;
97 v3f freecam_v
, freecam_w
;
101 replay_keyframe keyframes
[32];
105 extern player_replay
;
107 int replay_seek( replay_buffer
*replay
, f64 t
);
109 replay_frame
*replay_find_recent_stateframe( replay_buffer
*replay
);
110 void replay_get_camera( replay_buffer
*replay
, vg_camera
*cam
);
111 void replay_get_frame_camera( replay_frame
*frame
, vg_camera
*cam
);
112 f32
replay_subframe_time( replay_buffer
*replay
);
113 void replay_clear( replay_buffer
*replay
);
115 replay_frame_data( replay_frame
*frame
, enum replay_framedata type
);
117 void skaterift_replay_pre_update(void);
118 void skaterift_replay_imgui(void);
119 void skaterift_replay_debug_info(void);
120 void skaterift_record_frame( replay_buffer
*replay
,
121 int force_gamestate
);
122 void skaterift_replay_post_render(void);
123 void skaterift_replay_init(void);
124 void skaterift_get_replay_cam( vg_camera
*cam
);