X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_remote.h;h=021fcf5ff1db5b6cda5cb4550f20b86a18139651;hb=137d40d96fe923600d8378b8e138e3c276f27ff4;hp=1360e54b304c9221a26a8e85ebf5de453d1d4bd7;hpb=333430b27b5f9f73cbe9ad7921a4735aaff444f1;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_remote.h b/player_remote.h index 1360e54..021fcf5 100644 --- a/player_remote.h +++ b/player_remote.h @@ -3,26 +3,56 @@ #include "player.h" #include "network.h" +#include "network_common.h" + +#define NETWORK_SFX_QUEUE_LENGTH 12 struct { struct network_player { int active; u16 board_view_slot, playermodel_view_slot; + enum player_subsystem subsystem; + + /* this is set IF they exist in a world that we have loaded */ + world_instance *active_world; + int world_match[ k_world_max ]; + + /* TODO: Compression with server code */ + char username[ NETWORK_USERNAME_MAX ]; + char items[k_netmsg_playeritem_max][ADDON_UID_MAX]; - 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; - } animdata; + struct interp_buffer { + /* collect the most recent 6 frames of animation data */ + struct interp_frame { + int active; + f64 timestamp; + enum player_subsystem subsystem; + + u8 instance_id; + u16 boundary_hash; + + union interp_animdata { + struct player_skate_animator _skate; + struct player_walk_animator _walk; + struct player_dead_animator _dead; + } + data; + } + frames[ NETWORK_BUFFERFRAMES ]; + + f64 t; } - list[ 32 ]; + interp_data[ NETWORK_MAX_PLAYERS ]; + + struct net_sfx sfx_queue[ NETWORK_SFX_QUEUE_LENGTH ]; m4x3f *final_mtx; + struct player_board_pose board_poses[ NETWORK_MAX_PLAYERS ]; u32 up_bytes; f32 up_kbs, down_kbs; @@ -33,5 +63,8 @@ static netplayers; 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 ); +static void render_remote_players( world_instance *world, camera *cam ); +static void relink_all_remote_player_worlds(void); #endif /* PLAYER_REMOTE_H */