X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_remote.c;h=0336624efa421dcdb71b311bcdbf8ba60cc11a7e;hb=d1860effe17d86ef47b7c879668eb97ef8c3ab51;hp=50249328d2fddc0812f95e6f0c557f0e21862e7d;hpb=08c07d4801fa8c134976d3c7c757179eeccd71d1;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_remote.c b/player_remote.c index 5024932..0336624 100644 --- a/player_remote.c +++ b/player_remote.c @@ -5,6 +5,7 @@ #include "addon.h" #include "font.h" #include "gui.h" +#include "ent_miniworld.h" static i32 k_show_own_name = 0; @@ -175,7 +176,24 @@ static void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ){ .buffer_len = datasize, .bytes = 0, }; - + + /* animation + * -------------------------------------------------------------*/ + + dest->timestamp = frame->timestamp; + dest->boundary_hash = frame->boundary_hash; + + struct network_player *player = &netplayers.list[ frame->client ]; + struct player_subsystem_interface *sys = + player_subsystems[ frame->subsystem ]; + + if( sys->network_animator_exchange ){ + memset( &dest->data, 0, sys->animator_size ); + sys->network_animator_exchange( &ctx, &dest->data ); + } + else { + bitpack_bytes( &ctx, sys->animator_size, sys->animator_data ); + } /* sfx * -------------------------------------------------------------*/ @@ -209,24 +227,6 @@ static void player_remote_rx_200_300( SteamNetworkingMessage_t *msg ){ dst->subframe = remaining; } } - - /* animation - * -------------------------------------------------------------*/ - - dest->timestamp = frame->timestamp; - dest->boundary_hash = frame->boundary_hash; - - struct network_player *player = &netplayers.list[ frame->client ]; - struct player_subsystem_interface *sys = - player_subsystems[ frame->subsystem ]; - - if( sys->network_animator_exchange ){ - memset( &dest->data, 0, sys->animator_size ); - sys->network_animator_exchange( &ctx, &dest->data ); - } - else { - bitpack_bytes( &ctx, sys->animator_size, sys->animator_data ); - } player->subsystem = frame->subsystem; player->down_bytes += msg->m_cbSize; @@ -314,13 +314,6 @@ static void remote_player_send_playerframe(void){ .bytes = 0 }; - /* sfx - * ---------------------------------------------*/ - - frame->sound_effects = localplayer.sfx_buffer_count; - for( u32 i=0; ianimator_size, sys->animator_data ); + /* sfx + * ---------------------------------------------*/ + + frame->sound_effects = localplayer.sfx_buffer_count; + for( u32 i=0; iactive_world != world ){ + if( !player->active_world ) continue; + + /* their in our active subworld */ + if( player->active_world != world ){ + m4x3_mulv( global_miniworld.mmdl, co, co ); + co[1] -= 2.0f; /* HACK lol */ } f32 d2 = v3_dist2( co, localplayer.rb.co ); @@ -878,19 +883,17 @@ static void remote_players_imgui_world( world_instance *world, m4x4f pv, player->opacity = vg_lerpf( player->opacity, opacity, vg.time_frame_delta * 2.0f ); - remote_player_world_gui( - pv, netplayers.final_mtx[localplayer.skeleton.bone_count*i][3], - player ); + remote_player_world_gui( pv, co, player ); vg_ui.colour[3] = player->opacity; - ui_flush( k_ui_shader_colour ); + ui_flush( k_ui_shader_colour, vg.window_x, vg.window_y ); } } vg_ui.colour[3] = 1.0f; remote_player_world_gui( pv, localplayer.rb.co, NULL ); - ui_flush( k_ui_shader_colour ); + ui_flush( k_ui_shader_colour, vg.window_x, vg.window_y ); } static void chat_escape(void){ @@ -921,16 +924,16 @@ static void remote_players_chat_imgui(void){ UI_TEXTBOX_AUTOFOCUS, &callbacks ); } else { - /* TODO: we gotta fix this input fighting crap. */ if( netplayers.chatting == -1 ){ netplayers.chatting = 0; + srinput.state = k_input_state_resume; } else { if( (skaterift.activity == k_skaterift_default) && button_down( k_srbind_chat ) ){ netplayers.chatting = 1; netplayers.chat_buffer[0] = '\0'; - srinput.enabled = 0; + srinput.state = k_input_state_pause; } } }