X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world.h;h=cf721e8402c097d95bcc5a5ba274acb9c43f0a5a;hb=cedb92d590f4578a246a09a96c0fa0eda109d3c7;hp=3734dbf353963295c2b75eb8ec25aa4436509436;hpb=4a883ac1b2506032f9dddab342712de46f2ca734;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world.h b/world.h index 3734dbf..cf721e8 100644 --- a/world.h +++ b/world.h @@ -18,6 +18,9 @@ static int ray_world( v3f pos, v3f dir, ray_hit *hit ); #include "traffic.h" /*TODO: -> world_traffic.h */ #include "world_routes.h" #include "world_sfd.h" +#include "world_audio.h" +#include "network.h" +#include "network_msg.h" #include "shaders/terrain.h" #include "shaders/sky.h" @@ -43,11 +46,6 @@ static struct gworld struct subworld_routes routes; struct subworld_sfd sfd; - /* ... - struct subworld_spawns system_spawns; - struct subworld_physics system_physics; - */ - /* Paths */ traffic_node traffic[128]; u32 traffic_count; @@ -85,6 +83,9 @@ static struct gworld * instance_cache; u32 instance_cache_count, instance_cache_cap; + + v3f render_gate_pos; + int active_route_board; } world; @@ -540,12 +541,50 @@ static void world_init(void) /* Other systems */ world_sfd_init(); + world_audio_init(); } static void world_update(void) { world_routes_update(); world_routes_debug(); + + int closest = 0; + float min_dist = INFINITY; + + for( int i=0; itrack_id; + + if( id != 0xffffffff ) + { + struct netmsg_board *local_board = &scoreboard_client_data.boards[id]; + + for( int i=0; i<13; i++ ) + { + sfd_encode( &sfd->tester, i, &local_board->data[27*i] ); + } + } + } + sfd_update( &world.sfd.tester ); #if 0 @@ -716,7 +755,7 @@ static void render_sky(m4x3f camera) glDepthMask( GL_TRUE ); } -static void render_world_gates( m4x4f projection, m4x3f camera ) +static void render_world_gates( m4x4f projection, v3f playerco, m4x3f camera ) { float closest = INFINITY; int id = 0; @@ -733,7 +772,11 @@ static void render_world_gates( m4x4f projection, m4x3f camera ) } } - render_gate( &world.routes.gates[id].gate, camera ); + render_gate( &world.routes.gates[id].gate, playerco, camera ); + v3_lerp( world.render_gate_pos, + world.routes.gates[id].gate.co[0], + 1.0f, + world.render_gate_pos ); } static void render_world( m4x4f projection, m4x3f camera ) @@ -744,15 +787,23 @@ static void render_world( m4x4f projection, m4x3f camera ) render_world_alphatest( projection, camera[3] ); render_terrain( projection, camera[3] ); - m4x3f identity_matrix; - m4x3_identity( identity_matrix ); - identity_matrix[3][1] = 125.0f; + int closest = 0; + float min_dist = INFINITY; + + for( int i=0; i