-#include "player_animation.h"
-#include "player_audio.h"
-
-/*
- * -----------------------------------------------------------------------------
- * Events
- * -----------------------------------------------------------------------------
- */
-
-static void player_register(void) /* 0 */
-{
- player_model_register();
-}
-
-static void player_init(void) /* 1 */
-{
- player_model_init();
-
- rb_init( &player.collide_front );
- rb_init( &player.collide_back );
-}
-
-static void player_update(void) /* 2 */
-{
- for( int i=0; i<player.land_log_count; i++ )
- vg_line_cross( player.land_target_log[i],
- player.land_target_colours[i], 0.25f);
-
- if( vg_get_axis("grabl")>0.0f)
- {
- player.rb = player.rb_gate_frame;
- player.on_board = player.on_board_frame;
- player.in_air = player.in_air_frame;
- m3x3_copy( player.gate_vr_frame, player.vr );
- m3x3_copy( player.gate_vr_pstep_frame, player.vr_pstep );
- player.is_dead = 0;
- player.in_air = 1;
-
-
- if( !player.on_board )
- {
- player.angles[0] = atan2f( -player.rb.forward[2],
- -player.rb.forward[0] );
- }
-
- m3x3_identity( player.vr );
-
- player.mdl.shoes[0] = 1;
- player.mdl.shoes[1] = 1;
-
- world_routes_notify_reset();
- }
-
- if( vg_get_button_down( "switchmode" ) )
- {
- player.on_board ^= 0x1;
- }
-
- if( (glfwGetKey( vg_window, GLFW_KEY_O ) || (player.rb.co[1] < 0.0f)) &&
- !player.is_dead)
- {
- player_ragdoll_copy_model( player.rb.v );
- player.is_dead = 1;
- }
-
- if( player.is_dead )
- {
- player_ragdoll_iter();
- player_debug_ragdoll();
-
- if( !freecam )
- player_animate_death_cam();
- }
- else
- {
- player_do_motion();
- player_animate();
-
- if( !freecam )
- player_animate_camera();
+#include "player_walk.h"
+#include "player_skate.h"
+#include "player_dead.h"
+#include "player_drive.h"
+#include "player_replay.h"
+
+#define PLAYER_REWIND_FRAMES 60*4
+#define RESET_MAX_TIME 45.0
+
+static i32 k_cinema_fixed = 0;
+static f32 k_cinema = 0.0f;
+static i32 k_invert_y = 0;
+
+struct {
+ /* transform definition */
+ rigidbody rb;
+ v3f angles;
+
+#if 0
+ v4f qbasis;
+ m3x3f basis, invbasis, basis_gate;
+ world_instance *viewable_world;
+#endif
+
+ /*
+ * Camera management
+ * ---------------------------
+ */
+ camera cam;
+ struct player_cam_controller cam_control;
+ f32 cam_trackshake;
+
+ float cam_velocity_influence,
+ cam_velocity_coefficient,
+ cam_velocity_constant,
+ cam_velocity_coefficient_smooth,
+ cam_velocity_constant_smooth,
+ cam_velocity_influence_smooth;
+
+ v3f cam_land_punch, cam_land_punch_v;
+ ent_gate *gate_waiting;
+ int immobile;
+
+ /*
+ * Network
+ * --------------------------------------------------
+ */
+ u16 boundary_hash;
+ struct net_sfx {
+ u8 system, priority, id;
+ f32 subframe, volume;
+ v3f location;