X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player.c;h=51353b9a7e8492f70f803cd45463a0ce5d93fc9f;hb=249fe329869e43961d4e1d4e44f08c6225e195c7;hp=483df660638629a2cef7de9952095b28e9fbc91f;hpb=eb203257efcfe324217de9e733cc6c1371b99de6;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player.c b/player.c index 483df66..51353b9 100644 --- a/player.c +++ b/player.c @@ -88,7 +88,8 @@ void player__create( player_instance *inst ) "bind use gp-y", "bind use e", - "bind camera c" + "bind camera c", + "bind camera gp-rb" }; for( int i=0; isubsystem == k_player_subsystem_dead ){ - player->subsystem = k_player_subsystem_walk; - //reset_player( 0, NULL ); + __respawn( 0, NULL ); } else{ /* cant do that */ @@ -291,6 +291,9 @@ VG_STATIC void gate_rotate_angles( ent_gate *gate, v3f angles, v3f d ) PLAYER_API void player__pass_gate( player_instance *player, ent_gate *gate ) { + world_routes_fracture( get_active_world(), gate, + player->rb.co, player->rb.v ); + player->gate_waiting = gate; world_routes_activate_entry_gate( get_active_world(), gate ); @@ -321,6 +324,8 @@ void player__pass_gate( player_instance *player, ent_gate *gate ) if( gate->type == k_gate_type_nonlocal ) world_global.active_world = gate->target; + world_global.in_volume = 0; + audio_lock(); audio_oneshot( &audio_gate_pass, 1.0f, 0.0f ); audio_unlock(); @@ -375,6 +380,7 @@ VG_STATIC void player__pre_render( player_instance *player ) player->rewind_total_length = 0.0f; player->rewind_accum = 0.0f; world_global.sky_target_rate = 1.0; + world_global.time = world_global.last_use; } else{ world_global.sky_target_rate = -100.0; @@ -382,10 +388,6 @@ VG_STATIC void player__pre_render( player_instance *player ) float budget = vg.time_delta, overall_length = player->rewind_length; -#if 0 - world_routes_rollback_time( player.rewind_time / overall_length ); -#endif - for( int i=0; (i<10)&&(player->rewind_time>0.0f)&&(budget>0.0f); i++ ){ /* Interpolate frames */ int i0 = floorf( player->rewind_time ), @@ -397,7 +399,7 @@ VG_STATIC void player__pre_render( player_instance *player ) float dist = vg_maxf( v3_dist( fr->pos, fr1->pos ), 0.001f ), subl = vg_fractf( player->rewind_time ) + 0.001f, - sramp= 3.0f-(1.0f/(0.4f+0.4f*player->rewind_time)), + sramp = 3.0f-(1.0f/(0.4f+0.4f*player->rewind_time)), speed = sramp*28.0f + 0.5f*player->rewind_time, mod = speed * (budget / dist), @@ -526,6 +528,7 @@ PLAYER_API void player__spawn( player_instance *player, player->subsystem = k_player_subsystem_walk; player->viewable_world = get_active_world(); + player->gate_waiting = NULL; if( _player_reset[ player->subsystem ] ) _player_reset[ player->subsystem ]( player, rp );