X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_render.c;h=aa74bbfb6a2f6c4ab7e045348795cc33dd67eb43;hb=8090b8da9ce1397ba47d7e2d91b4f1716f708f25;hp=022556d068a558e75ace441a3ebf314691ea99a6;hpb=df9f72d2912a5424d37dfdb02f76aba8f1ed4df1;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.c b/world_render.c index 022556d..aa74bbf 100644 --- a/world_render.c +++ b/world_render.c @@ -12,20 +12,18 @@ #include "respawn.h" static int ccmd_set_time( int argc, const char *argv[] ){ - if( argc == 1 ){ - world_instance *world = world_current_instance(); + world_instance *world = world_current_instance(); + if( argc == 1 ) world->time = atof( argv[0] ); - } - else { - vg_error( "Usage set_time <0-1.0>\n" ); - } + else + vg_error( "Usage set_time <0-1.0> (current time: %f)\n", world->time ); return 0; } static void async_world_render_init( void *payload, u32 size ) { vg_info( "Allocate uniform buffers\n" ); - for( int i=0; i<4; i++ ){ + for( int i=0; iubo_bind_point = i; @@ -39,7 +37,7 @@ static void async_world_render_init( void *payload, u32 size ) } vg_info( "Allocate frame buffers\n" ); - for( int i=0; i<4; i++ ){ + for( int i=0; iheightmap; @@ -735,12 +733,10 @@ static void render_world_gates( world_instance *world, camera *cam, } } -static void world_prerender( world_instance *world ) -{ - +static void world_prerender( world_instance *world ){ if( mdl_arrcount( &world->ent_light ) ){ f32 rate = vg_maxf(0.1f, fabsf(k_day_length)) * vg_signf(k_day_length); - world->time += vg.time_delta * (1.0/(rate*60.0)); + world->time += vg.time_frame_delta * (1.0/(rate*60.0)); } else{ world->time = 0.834;