X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=inline;f=world_render.c;h=a7ff25ccf3639c1eff192e104e13064c30139937;hb=6ab4435fb19beb6af6c52691793d5ca17a120f69;hp=a33d774cbfbfeeeb1f10c0d156e47515ae015d1b;hpb=f014a592925b224f846d8adfc6559539fae1a096;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.c b/world_render.c index a33d774..a7ff25c 100644 --- a/world_render.c +++ b/world_render.c @@ -520,7 +520,7 @@ VG_STATIC void render_world_gates( world_instance *world, camera *cam, for( u32 i=0; ient_gate); i++ ){ ent_gate *gi = mdl_arritm( &world->ent_gate, i ); - if( gi->type == k_gate_type_unlinked ) + if( !(gi->flags & k_ent_gate_linked) ) continue; float dist = v3_dist2( gi->co[0], cam->transform[3] ); @@ -533,25 +533,20 @@ VG_STATIC void render_world_gates( world_instance *world, camera *cam, } } + world->rendering_gate = gate; if( gate ){ - /* should really be set in fixed update since its used in the physics - * of most systems. too bad! */ - world->rendering_gate = gate; - - if( gate->type == k_gate_type_teleport ){ - render_gate( world, gate, cam, layer_depth ); - } - else if( gate->type == k_gate_type_nonlocel ){ + if( gate->flags & k_ent_gate_nonlocal ){ if( world_loader.state != k_world_loader_none ){ world->rendering_gate = NULL; return; } world_instance *dest_world = &world_static.worlds[ gate->target ]; - render_gate( dest_world, gate, cam, layer_depth ); + render_gate( world, dest_world, gate, cam, layer_depth ); + } + else{ + render_gate( world, world, gate, cam, layer_depth ); } - else - world->rendering_gate = NULL; } }