X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_gate.c;h=a61bc162811e9462572201cef0488a396240934c;hb=99df437e740aa12d6e578d15bcf14140f648a6d1;hp=7a5360a6e2b09a9bcd517ee3cfe2781bf3552257;hpb=342fcbf6fda017bdd38d56ce0fa7c9e59e589f3b;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_gate.c b/world_gate.c index 7a5360a..a61bc16 100644 --- a/world_gate.c +++ b/world_gate.c @@ -105,29 +105,29 @@ VG_STATIC int render_gate( world_instance *world_inside, } /* update gate camera */ - gate_camera.fov = cam->fov; - gate_camera.nearz = 0.1f; - gate_camera.farz = 2000.0f; + world_gates.cam.fov = cam->fov; + world_gates.cam.nearz = 0.1f; + world_gates.cam.farz = 2000.0f; - m4x3_mul( gate->transport, cam->transform, gate_camera.transform ); - camera_update_view( &gate_camera ); - camera_update_projection( &gate_camera ); + m4x3_mul( gate->transport, cam->transform, world_gates.cam.transform ); + camera_update_view( &world_gates.cam ); + camera_update_projection( &world_gates.cam ); /* Add special clipping plane to projection */ v4f surface; q_mulv( gate->q[1], (v3f){0.0f,0.0f,-1.0f}, surface ); surface[3] = v3_dot( surface, gate->co[1] ); - m4x3_mulp( gate_camera.transform_inverse, surface, surface ); + m4x3_mulp( world_gates.cam.transform_inverse, surface, surface ); surface[3] = -fabsf(surface[3]); if( dist < -0.5f ) - m4x4_clip_projection( gate_camera.mtx.p, surface ); + m4x4_clip_projection( world_gates.cam.mtx.p, surface ); /* Ready to draw with new camrea */ - camera_finalize( &gate_camera ); + camera_finalize( &world_gates.cam ); - vg_line_pt3( gate_camera.transform[3], 0.3f, 0xff00ff00 ); + vg_line_point( world_gates.cam.transform[3], 0.3f, 0xff00ff00 ); { shader_model_gate_use(); shader_model_gate_uPv( cam->mtx.pv ); @@ -152,17 +152,17 @@ VG_STATIC int render_gate( world_instance *world_inside, glStencilMask( 0x00 ); } - render_world( world_inside, &gate_camera, layer_depth ); + render_world( world_inside, &world_gates.cam, layer_depth ); { glDisable( GL_STENCIL_TEST ); - render_water_texture( world_inside, &gate_camera, layer_depth ); + render_water_texture( world_inside, &world_gates.cam, layer_depth ); render_fb_bind( gpipeline.fb_main, 1 ); glEnable( GL_STENCIL_TEST ); - render_water_surface( world_inside, &gate_camera ); + render_water_surface( world_inside, &world_gates.cam ); glStencilMask( 0xFF ); glStencilFunc( GL_ALWAYS, 1, 0xFF ); @@ -246,8 +246,7 @@ VG_STATIC ent_gate *world_intersect_gates( world_instance *world, continue; if( gate->type == k_gate_type_nonlocel ){ - if( skaterift.async_op == k_async_op_world_loading || - skaterift.async_op == k_async_op_world_preloading ){ + if( world_loader.state != k_world_loader_none ){ continue; } }