#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;
};
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 */