X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_replay.h;h=9a3f2aba658a4cc67ec8a207499e6f3baf4f3c63;hb=ca35eceae3abfcfb9ba266d6ea8e664bc06b0a3e;hp=1befaada2a0f5f8a86747c58be5be61178d080d2;hpb=b615f03b922d155f9449d2a23d3cc18eed320ed3;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_replay.h b/player_replay.h index 1befaad..9a3f2ab 100644 --- a/player_replay.h +++ b/player_replay.h @@ -5,17 +5,17 @@ #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; +typedef struct replay_sfx replay_sfx; struct replay_buffer { void *data; u32 size; /* bytes */ - replay_frame *head, *tail, *cursor_frame; - + replay_frame *head, *tail, *cursor_frame, + *statehead; f64 cursor; }; @@ -23,15 +23,51 @@ struct replay_frame { 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? */ + u32 subsystem_gamestate_size, + sfx_count; }; -VG_STATIC void replay_debug_info( player_instance *player ); -VG_STATIC replay_frame *replay_newframe( replay_buffer *replay ); -VG_STATIC void replay_imgui( player_instance *player ); +struct replay_gamestate { + enum player_subsystem system; + rigidbody rb; + v3f angles; + + struct player_cam_controller cam_control; + +#if 0 + union { + struct player_skate_state skate; + struct player_walk_state walk; + struct player_ragdoll ragdoll; + }; +#endif +}; + +struct replay_sfx { + u32 none; +}; + +VG_STATIC replay_frame *replay_newframe( replay_buffer *replay, + u32 gamestate_count, u32 sfx_count ); VG_STATIC void replay_seek( replay_buffer *replay, f64 t ); +replay_gamestate *replay_frame_gamestate( replay_frame *frame ); +void *replay_gamestate_subsystem_data( replay_gamestate *gs ); +replay_sfx *replay_frame_sfx( replay_frame *frame, u32 index ); +VG_STATIC replay_frame *replay_find_recent_stateframe( replay_buffer *replay ); +VG_STATIC void replay_get_camera( replay_buffer *replay, camera *cam ); +VG_STATIC void replay_get_frame_camera( replay_frame *frame, camera *cam ); +VG_STATIC f32 replay_subframe_time( replay_buffer *replay ); +VG_STATIC void replay_clear( replay_buffer *replay ); + +VG_STATIC void skaterift_replay_pre_update(void); +VG_STATIC void skaterift_replay_imgui(void); +VG_STATIC void skaterift_replay_debug_info(void); + #endif /* PLAYER_REPLAY_H */