start of a replay system
[carveJwlIkooP6JGAAIwe30JlM.git] / player_replay.h
diff --git a/player_replay.h b/player_replay.h
new file mode 100644 (file)
index 0000000..1befaad
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef PLAYER_REPLAY_H
+#define PLAYER_REPLAY_H
+
+#include "skaterift.h"
+#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;
+
+struct replay_buffer {
+   void *data;
+   u32 size; /* bytes */
+
+   replay_frame *head, *tail, *cursor_frame;
+
+   f64 cursor;
+};
+
+struct replay_frame {
+   player_animation anim;
+   struct board_pose board_pose;
+
+   f64 time;
+   replay_frame *l, *r;
+
+   /* eventually, sound events, player iframes and stuff? */
+};
+
+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 );
+VG_STATIC void replay_seek( replay_buffer *replay, f64 t );
+
+#endif /* PLAYER_REPLAY_H */