X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_replay.h;h=cd9bd849d14c1479166d736198f0bec87b77d0d9;hb=fbc68c65e01838feb77f47b30994b45fcc39ebaf;hp=2c18d4c68a17797ca5425f9ae8e42948baeb81fe;hpb=9eb3de757a997becb8406417a4bf613f4cb04900;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_replay.h b/player_replay.h index 2c18d4c..cd9bd84 100644 --- a/player_replay.h +++ b/player_replay.h @@ -5,8 +5,6 @@ #include "player.h" #include "player_render.h" -static i32 k_replay_test = 0; - typedef struct replay_buffer replay_buffer; typedef struct replay_frame replay_frame; typedef struct replay_gamestate replay_gamestate; @@ -16,55 +14,57 @@ struct replay_buffer { void *data; u32 size; /* bytes */ - enum replay_control { - k_replay_control_scrub, - k_replay_control_play, - } - control; - replay_frame *head, *tail, *cursor_frame, *statehead; f64 cursor; }; -struct replay_frame { - player_animation anim; - struct board_pose board_pose; +enum replay_framedata{ + k_replay_framedata_animator, + k_replay_framedata_gamestate, + k_replay_framedata_internal_gamestate, + k_replay_framedata_sfx +}; +struct replay_frame { v3f cam_pos, cam_angles; f32 cam_fov; f64 time; replay_frame *l, *r; - u16 gamestate_count, sfx_count; + enum player_subsystem system; + u16 total_size; + u16 data_table[4][2]; }; 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, - 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 ); +static replay_frame *replay_newframe( replay_buffer *replay, + u16 animator_size, + u16 gamestate_size, + u16 sfx_count ); +static void replay_seek( replay_buffer *replay, f64 t ); + +static replay_frame *replay_find_recent_stateframe( replay_buffer *replay ); +static void replay_get_camera( replay_buffer *replay, camera *cam ); +static void replay_get_frame_camera( replay_frame *frame, camera *cam ); +static f32 replay_subframe_time( replay_buffer *replay ); +static void replay_clear( replay_buffer *replay ); +static void * +replay_frame_data( replay_frame *frame, enum replay_framedata type ); + +static void skaterift_replay_pre_update(void); +static void skaterift_replay_imgui(void); +static void skaterift_replay_debug_info(void); #endif /* PLAYER_REPLAY_H */