X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_remote.h;h=6cf7ce5fc86c61799ccfaa018c5bb879f25c2db2;hb=9385ff1868a052d92d60c0b49aa03848460b1916;hp=bd5f6ddafdd61831753486100ab44da071b3c6cf;hpb=46f4e9ee87dc67402166e4c6b05efbe922cd7574;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_remote.h b/player_remote.h index bd5f6dd..6cf7ce5 100644 --- a/player_remote.h +++ b/player_remote.h @@ -3,26 +3,52 @@ #include "player.h" #include "network.h" +#include "network_common.h" struct { struct network_player { int active; u16 board_view_slot, playermodel_view_slot; - player_pose pose; + enum player_subsystem subsystem; char username[32]; + u32 down_bytes; + f32 down_kbs; + } + list[ NETWORK_MAX_PLAYERS ]; - enum player_subsystem subsystem; - union { - struct player_skate_animator _skate; - struct player_walk_animator _walk; - struct player_dead_animator _dead; - }; + struct interp_buffer { + /* collect the most recent 6 frames of animation data */ + struct interp_frame { + int active; + f64 timestamp; + enum player_subsystem subsystem; + + union interp_animdata { + struct player_skate_animator _skate; + struct player_walk_animator _walk; + struct player_dead_animator _dead; + } + data; + } + frames[6]; + + f64 t; } - list[ 32 ]; + interp_data[ NETWORK_MAX_PLAYERS ]; + + m4x3f *final_mtx; + struct player_board_pose board_poses[ NETWORK_MAX_PLAYERS ]; + + u32 up_bytes; + f32 up_kbs, down_kbs; + f64 last_data_measurement; } static netplayers; -static void player_remote_packet( SteamNetworkingMessage_t *msg ); +static void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ); +static void remote_player_debug_update(void); +static void remote_player_send_playerframe(void); +static void animate_remote_player( u32 index ); #endif /* PLAYER_REMOTE_H */