-#include "player_animation.h"
-#include "player_audio.h"
-
-/*
- * -----------------------------------------------------------------------------
- * Events
- * -----------------------------------------------------------------------------
- */
-
-static void player_init(void) /* 1 */
-{
- rb_init( &player.phys.rb );
- rb_init( &player.collide_front );
- rb_init( &player.collide_back );
-
- vg_convar_push( (struct vg_convar){
- .name = "walk_speed",
- .data = &k_walkspeed,
- .data_type = k_convar_dtype_f32,
- .opt_f32 = { .clamp = 0 },
- .persistent = 1
- });
-
- vg_convar_push( (struct vg_convar){
- .name = "run_speed",
- .data = &k_runspeed,
- .data_type = k_convar_dtype_f32,
- .opt_f32 = { .clamp = 0 },
- .persistent = 1
- });
-
- vg_convar_push( (struct vg_convar){
- .name = "walk_accel",
- .data = &k_walk_accel,
- .data_type = k_convar_dtype_f32,
- .opt_f32 = { .clamp = 0 },
- .persistent = 1
- });
-
- vg_convar_push( (struct vg_convar){
- .name = "fc",
- .data = &freecam,
- .data_type = k_convar_dtype_i32,
- .opt_i32 = { .min=0, .max=1, .clamp=1 },
- .persistent = 1
- });
-
- vg_convar_push( (struct vg_convar){
- .name = "fcs",
- .data = &fc_speed,
- .data_type = k_convar_dtype_f32,
- .opt_f32 = { .clamp = 0 },
- .persistent = 1
- });
-
- vg_function_push( (struct vg_cmd){
- .name = "reset",
- .function = reset_player
- });
-
- /* other systems */
- vg_loader_highwater( player_model_init, player_model_free, NULL );
-}
-
-/* Deal with input etc */
-static void player_update_pre(void)
-{
- struct player_phys *phys = &player.phys;
-
- if( vg_get_button_down( "reset" ) )
- {
- player.is_dead = 0;
- player_restore_frame();
-
- if( !phys->on_board )
- {
- player.angles[0] = atan2f( -phys->rb.forward[2],
- -phys->rb.forward[0] );
- }
-
- player.mdl.shoes[0] = 1;
- player.mdl.shoes[1] = 1;
-
- world_routes_notify_reset();
- }
-
- if( vg_get_button_down( "switchmode" ) )
- {
- phys->on_board ^= 0x1;
-
- if( phys->on_board )
- {
- v3_muladds( phys->rb.v, phys->rb.forward, 0.2f, phys->rb.v );
- }
- }
-}
-
-static void player_update_fixed(void) /* 2 */
-{
- struct player_phys *phys = &player.phys;
+#include "player_render.h"
+
+struct player_subsystem_interface{
+ void(*system_register)(void);
+ void(*bind)(void);
+ void(*pre_update)(void);
+ void(*update)(void);
+ void(*post_update)(void);
+ void(*im_gui)(void);
+ void(*animate)(void);
+ void(*pose)( void *animator, player_pose *pose );
+ void(*effects)( void *animator, m4x3f *final_mtx, struct player_board *board,
+ struct player_effects_data *effect_data );
+ void(*post_animate)(void);
+
+ void(*network_animator_exchange)( bitpack_ctx *ctx, void *data );
+ void(*sfx_oneshot)( u8 id, v3f pos, f32 volume );
+
+ void(*sfx_comp)(void *animator);
+ void(*sfx_kill)(void);
+
+ void *animator_data;
+ u32 animator_size;
+
+ const char *name;
+};