projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
small compression
[carveJwlIkooP6JGAAIwe30JlM.git]
/
player_remote.c
diff --git
a/player_remote.c
b/player_remote.c
index b533d389e5af955ea6bc8dd9b0aa76d7c79cb604..8ab15e0a382de43d5c4b820c04d3b232da0441d2 100644
(file)
--- a/
player_remote.c
+++ b/
player_remote.c
@@
-6,6
+6,8
@@
#include "font.h"
#include "gui.h"
#include "font.h"
#include "gui.h"
+static i32 k_show_own_name = 0;
+
static void player_remote_clear( struct network_player *player ){
addon_cache_unwatch( k_addon_type_player, player->playermodel_view_slot );
addon_cache_unwatch( k_addon_type_board, player->board_view_slot );
static void player_remote_clear( struct network_player *player ){
addon_cache_unwatch( k_addon_type_player, player->playermodel_view_slot );
addon_cache_unwatch( k_addon_type_board, player->board_view_slot );
@@
-22,24
+24,24
@@
static void player_remote_clear( struct network_player *player ){
static void relink_remote_player_worlds( u32 client_id ){
struct network_player *player = &netplayers.list[client_id];
static void relink_remote_player_worlds( u32 client_id ){
struct network_player *player = &netplayers.list[client_id];
- player->hub_match = 0;
- player->client_match = 0;
-
- addon_alias q0,q1;
- addon_uid_to_alias( player->items[k_netmsg_playeritem_world0], &q0 );
- addon_uid_to_alias( player->items[k_netmsg_playeritem_world1], &q1 );
+ addon_alias q[2];
+ addon_uid_to_alias( player->items[k_netmsg_playeritem_world0], &q[0] );
+ addon_uid_to_alias( player->items[k_netmsg_playeritem_world1], &q[1] );
/*
* currently in 10.23, the hub world will always be the same.
* this might but probably wont change in the future
*/
/*
* currently in 10.23, the hub world will always be the same.
* this might but probably wont change in the future
*/
- if( world_static.addon_hub )
- if( addon_alias_eq( &q0, &world_static.addon_hub->alias ) )
- player->hub_match = 1;
+ for( u32 i=0; i<k_world_max; i++ ){
+ addon_reg *reg = world_static.instance_addons[ i ];
+
+ player->world_match[i] = 0;
- if( world_static.addon_client )
- if( addon_alias_eq( &q1, &world_static.addon_client->alias ) )
- player->client_match = 1;
+ if( reg ){
+ if( addon_alias_eq( &q[i], &world_static.instance_addons[i]->alias ) )
+ player->world_match[i] = 1;
+ }
+ }
}
/*
}
/*
@@
-499,16
+501,8
@@
static void pose_remote_player( u32 index,
memcpy( board_pose, &pose0.board, sizeof(*board_pose) );
}
memcpy( board_pose, &pose0.board, sizeof(*board_pose) );
}
- if( instance_id ){
- if( player->client_match ){
- player->active_world = &world_static.instances[ instance_id ];
- }
- }
- else{
- if( player->hub_match ){
- player->active_world = &world_static.instances[ instance_id ];
- }
- }
+ if( player->world_match[ instance_id ] )
+ player->active_world = &world_static.instances[ instance_id ];
}
/*
}
/*
@@
-636,9
+630,11
@@
static void render_remote_players_tags( world_instance *world, camera *cam ){
font3d_bind( &gui.font, k_font_shader_default, 1, NULL, &skaterift.cam );
font3d_setcolour( (v4f){1.0f,1.0f,1.0f,1.0f} );
font3d_bind( &gui.font, k_font_shader_default, 1, NULL, &skaterift.cam );
font3d_setcolour( (v4f){1.0f,1.0f,1.0f,1.0f} );
- render_remote_player_nametag(
- localplayer.final_mtx[0][3],
- steam_username_at_startup );
+ if( k_show_own_name ){
+ render_remote_player_nametag(
+ localplayer.final_mtx[0][3],
+ steam_username_at_startup );
+ }
for( u32 i=0; i<NETWORK_MAX_PLAYERS; i ++ ){
struct network_player *player = &netplayers.list[i];
for( u32 i=0; i<NETWORK_MAX_PLAYERS; i ++ ){
struct network_player *player = &netplayers.list[i];
@@
-655,6
+651,8
@@
static void render_remote_players_tags( world_instance *world, camera *cam ){
}
static void remote_players_init(void){
}
static void remote_players_init(void){
+ vg_console_reg_var( "k_show_own_name", &k_show_own_name,
+ k_var_dtype_i32, 0 );
for( u32 i=0; i<NETWORK_SFX_QUEUE_LENGTH; i ++ ){
netplayers.sfx_queue[i].system = k_player_subsystem_invalid;
}
for( u32 i=0; i<NETWORK_SFX_QUEUE_LENGTH; i ++ ){
netplayers.sfx_queue[i].system = k_player_subsystem_invalid;
}