- else{
- world_global.sky_target_rate = -100.0;
-
- 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 ),
- i1 = VG_MIN( i0+1, player->rewind_length-1 );
-
- struct rewind_frame *fr = &player->rewind_buffer[i0],
- *fr1 = &player->rewind_buffer[i1];
-
- 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)),
- speed = sramp*28.0f + 0.5f*player->rewind_time,
- mod = speed * (budget / dist),
-
- advl = vg_minf( mod, subl ),
- advt = (advl / mod) * budget;
-
- player->dist_accum += speed * advt;
- player->rewind_time -= advl;
- budget -= advt;
- }
-
- player->rewind_time = vg_maxf( 0.0f, player->rewind_time );
-
- float current_time = vg.time - player->rewind_start,
- remaining = player->rewind_predicted_time - current_time;
-
- if( player->rewind_sound_wait ){
- if( player->rewind_predicted_time >= 6.5f ){
- if( remaining <= 6.5f ){
- audio_lock();
- audio_oneshot( &audio_rewind[3], 1.0f, 0.0f );
- audio_unlock();
- player->rewind_sound_wait = 0;
- }
- }
- else if( player->rewind_predicted_time >= 2.5f ){
- if( remaining <= 2.5f ){
- audio_lock();
- audio_oneshot( &audio_rewind[2], 1.0f, 0.0f );
- audio_unlock();
- player->rewind_sound_wait = 0;
- }
- }
- else if( player->rewind_predicted_time >= 1.5f ){
- if( remaining <= 1.5f ){
- audio_lock();
- audio_oneshot( &audio_rewind[1], 1.0f, 0.0f );
- audio_unlock();
- player->rewind_sound_wait = 0;
- }
- }
+ }
+};
+
+static void player__networked_sfx( u8 system, u8 priority, u8 id,
+ v3f pos, f32 volume ){
+ struct net_sfx null, *sfx = &null;
+
+ if( localplayer.sfx_buffer_count < vg_list_size(localplayer.sfx_buffer) )
+ sfx = &localplayer.sfx_buffer[ localplayer.sfx_buffer_count ++ ];
+ else {
+ for( u32 i=0; i<vg_list_size(localplayer.sfx_buffer); i++ ){
+ struct net_sfx *a = &localplayer.sfx_buffer[i];
+ if( a->priority < priority ){
+ sfx = a;
+ break;