From: hgn Date: Mon, 31 Oct 2022 03:12:21 +0000 (+0000) Subject: couple fix X-Git-Url: https://skaterift.com/git/?a=commitdiff_plain;h=166bd43e677bb4406197407a381b27058582c548;p=carveJwlIkooP6JGAAIwe30JlM.git couple fix --- diff --git a/menu.h b/menu.h index b407f4a..d5eb90f 100644 --- a/menu.h +++ b/menu.h @@ -7,6 +7,7 @@ #include "player.h" #include "shaders/menu.h" +#include "vg/vg_steam_friends.h" VG_STATIC mdl_context menu_model; VG_STATIC glmesh menu_glmesh; @@ -104,6 +105,19 @@ VG_STATIC void menu_btn_skater( int event ) menu_page = 0x2; } + +VG_STATIC void steam_on_game_overlay( CallbackMsg_t *msg ) +{ + GameOverlayActivated_t *inf = (GameOverlayActivated_t *)msg->m_pubParam; + vg_info( "Steam game overlay activated; pausing\n" ); + + if( inf->m_bActive ) + { + cl_menu = 1; + menu_page = 1; + } +} + VG_STATIC void menu_init(void) { vg_linear_clear( vg_mem.scratch ); @@ -130,6 +144,10 @@ VG_STATIC void menu_init(void) } shader_menu_register(); + +#ifdef SR_NETWORKED + steam_register_callback( k_iGameOverlayActivated, steam_on_game_overlay ); +#endif } VG_STATIC void menu_run_directional(void) diff --git a/models_src/mp_demo.mdl b/models_src/mp_demo.mdl new file mode 100644 index 0000000..8412f8b Binary files /dev/null and b/models_src/mp_demo.mdl differ diff --git a/models_src/mp_dev.mdl b/models_src/mp_dev.mdl index 60ed5ff..e81a013 100644 Binary files a/models_src/mp_dev.mdl and b/models_src/mp_dev.mdl differ diff --git a/textures_src/gradients.png b/textures_src/gradients.png index 9ccdf00..719ccfd 100644 Binary files a/textures_src/gradients.png and b/textures_src/gradients.png differ diff --git a/world.h b/world.h index 5f297d0..a92591e 100644 --- a/world.h +++ b/world.h @@ -563,36 +563,40 @@ VG_STATIC void world_update( v3f pos ) world_routes_debug(); #endif - int closest = 0; - float min_dist = INFINITY; - - for( int i=0; i 0 ) { - float d = v3_dist2( world.routes[i].scoreboard_transform[3], pos ); + int closest = 0; + float min_dist = INFINITY; - if( d < min_dist ) + for( int i=0; itrack_id; + struct route *route = &world.routes[closest]; - if( id != 0xffffffff ) - { - struct netmsg_board *local_board = &scoreboard_client_data.boards[id]; + u32 id = route->track_id; - for( int i=0; i<13; i++ ) + if( id != 0xffffffff ) { - sfd_encode( i, &local_board->data[27*i] ); + struct netmsg_board *local_board = + &scoreboard_client_data.boards[id]; + + for( int i=0; i<13; i++ ) + { + sfd_encode( i, &local_board->data[27*i] ); + } } } }