{
vg_info( "Allocate uniform buffers\n" );
for( int i=0; i<4; i++ ){
- world_instance *world = &world_static.worlds[i];
+ world_instance *world = &world_static.instances[i];
world->ubo_bind_point = i;
glGenBuffers( 1, &world->ubo_lighting );
vg_info( "Allocate frame buffers\n" );
for( int i=0; i<4; i++ ){
- world_instance *world = &world_static.worlds[i];
+ world_instance *world = &world_static.instances[i];
struct framebuffer *fb = &world->heightmap;
fb->display_name = NULL;
for( u32 i=0; i<mdl_arrcount(&world->ent_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] );
}
}
+ 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->flags & k_ent_gate_locked ) return;
- if( gate->type == k_gate_type_teleport ){
- render_gate( world, gate, cam, layer_depth );
- }
- else if( gate->type == k_gate_type_nonlocel ){
- if( world_loader.state != k_world_loader_none ){
+ if( gate->flags & k_ent_gate_nonlocal ){
+ if( world_static.load_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 );
+ world_instance *dest_world = &world_static.instances[ gate->target ];
+ render_gate( world, dest_world, gate, cam, layer_depth );
+ }
+ else{
+ render_gate( world, world, gate, cam, layer_depth );
}
- else
- world->rendering_gate = NULL;
}
}