typedef struct replay_buffer replay_buffer;
typedef struct replay_frame replay_frame;
+typedef struct replay_gamestate replay_gamestate;
+typedef struct replay_sfx replay_sfx;
struct replay_buffer {
void *data;
u32 size; /* bytes */
- replay_frame *head, *tail, *cursor_frame;
+ enum replay_control {
+ k_replay_control_scrub,
+ k_replay_control_play,
+ }
+ control;
+ replay_frame *head, *tail, *cursor_frame,
+ *statehead;
f64 cursor;
};
player_animation anim;
struct board_pose board_pose;
+ v3f cam_pos, cam_angles;
+ f32 cam_fov;
+
f64 time;
replay_frame *l, *r;
- /* eventually, sound events, player iframes and stuff? */
+ u16 gamestate_count, sfx_count;
+};
+
+struct replay_gamestate {
+ enum player_subsystem system;
+ rigidbody rb;
+ v3f angles;
+
+ struct player_cam_controller cam_control;
+
+ union {
+ struct player_skate_state skate;
+ struct player_walk_state walk;
+ };
+};
+
+struct replay_sfx {
+ u32 none;
};
VG_STATIC void replay_debug_info( player_instance *player );
-VG_STATIC replay_frame *replay_newframe( replay_buffer *replay );
+VG_STATIC replay_frame *replay_newframe( replay_buffer *replay,
+ u16 gamestate_count, u16 sfx_count );
VG_STATIC void replay_imgui( player_instance *player );
VG_STATIC void replay_seek( replay_buffer *replay, f64 t );
+replay_gamestate *replay_frame_gamestate( replay_frame *frame, u16 index );
+replay_sfx *replay_frame_sfx( replay_frame *frame, u16 index );
+VG_STATIC replay_frame *replay_find_recent_stateframe( replay_buffer *replay );
+
#endif /* PLAYER_REPLAY_H */