sparks for player and remote blinking
[carveJwlIkooP6JGAAIwe30JlM.git] / player_remote.c
index 07acd9a947254455aea608959c96bfe38e4e659c..9e46321fc35e5ea6da930c0ab4977b6278050ab0 100644 (file)
@@ -445,6 +445,11 @@ static void remote_player_network_imgui( m4x4f pv ){
    }
 }
 
+static void remote_player_effect( struct network_player *player, 
+                                  player_pose *final_pose ){
+   /* effects */
+}
+
 /*
  * write the remote players final_mtx 
  */
@@ -462,6 +467,9 @@ static void pose_remote_player( u32 index,
    struct player_subsystem_interface *sys0 = player_subsystems[f0->subsystem],
                                      *sys1 = NULL;
 
+   struct player_board *board = 
+      addon_cache_item_if_loaded( k_addon_type_board, player->board_view_slot );
+
    player_pose pose0, pose1, posed;
    sys0->pose( &f0->data, &pose0 );
 
@@ -485,15 +493,28 @@ static void pose_remote_player( u32 index,
       }
 
       instance_id = f1->instance_id;
-
       lerp_player_pose( &pose0, &pose1, t, &posed );
+      effect_blink_apply( &player->effect_data.blink, &posed, vg.time_delta );
+
       apply_full_skeleton_pose( sk, &posed, final_mtx );
+
+      if( t < 0.5f ){
+         if( sys0->effects ) 
+            sys0->effects( &f0->data, final_mtx, board, &player->effect_data );
+      }
+      else{
+         if( sys1->effects ) 
+            sys1->effects( &f1->data, final_mtx, board, &player->effect_data );
+      }
+
       memcpy( board_pose, &posed.board, sizeof(*board_pose) );
    }
    else {
       instance_id = f0->instance_id;
-
+      effect_blink_apply( &player->effect_data.blink, &pose0, vg.time_delta );
       apply_full_skeleton_pose( sk, &pose0, final_mtx );
+      if( sys0->effects ) 
+         sys0->effects( &f0->data, final_mtx, board, &player->effect_data );
       memcpy( board_pose, &pose0.board, sizeof(*board_pose) );
    }