@ -108,9 +108,23 @@ static void draw_chevron(UIState *s, float x_in, float y_in, float sz, 
			
		
	
		
			
				
					  nvgRestore ( s - > vg ) ;   
			
		
	
		
			
				
					}  
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					static  void  ui_draw_lane_line ( UIState  * s ,  const  model_path_vertices_data  * pvd ,  NVGcolor  color )  {  
			
		
	
		
			
				
					  const  UIScene  * scene  =  & s - > scene ;   
			
		
	
		
			
				
					static  void  draw_lead ( UIState  * s ,  float  d_rel ,  float  v_rel ,  float  y_rel ) {  
			
		
	
		
			
				
					    // Draw lead car indicator
   
			
		
	
		
			
				
					    float  fillAlpha  =  0 ;   
			
		
	
		
			
				
					    float  speedBuff  =  10. ;   
			
		
	
		
			
				
					    float  leadBuff  =  40. ;   
			
		
	
		
			
				
					    if  ( d_rel  <  leadBuff )  {   
			
		
	
		
			
				
					      fillAlpha  =  255 * ( 1.0 - ( d_rel / leadBuff ) ) ;   
			
		
	
		
			
				
					      if  ( v_rel  <  0 )  {   
			
		
	
		
			
				
					        fillAlpha  + =  255 * ( - 1 * ( v_rel / speedBuff ) ) ;   
			
		
	
		
			
				
					      }   
			
		
	
		
			
				
					      fillAlpha  =  ( int ) ( fmin ( fillAlpha ,  255 ) ) ;   
			
		
	
		
			
				
					    }   
			
		
	
		
			
				
					    draw_chevron ( s ,  d_rel + 2.7 ,  y_rel ,  25 ,   
			
		
	
		
			
				
					                  nvgRGBA ( 201 ,  34 ,  49 ,  fillAlpha ) ,  nvgRGBA ( 218 ,  202 ,  37 ,  255 ) ) ;   
			
		
	
		
			
				
					}  
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					static  void  ui_draw_lane_line ( UIState  * s ,  const  model_path_vertices_data  * pvd ,  NVGcolor  color )  {  
			
		
	
		
			
				
					  nvgSave ( s - > vg ) ;   
			
		
	
		
			
				
					  nvgTranslate ( s - > vg ,  240.0f ,  0.0 ) ;  // rgb-box space
   
			
		
	
		
			
				
					  nvgTranslate ( s - > vg ,  - 1440.0f  /  2 ,  - 1080.0f  /  2 ) ;  // zoom 2x
   
			
		
	
	
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
				
				@ -204,7 +218,7 @@ static void update_all_track_data(UIState *s) { 
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					static  void  ui_draw_track ( UIState  * s ,  bool  is_mpc ,  track_vertices_data  * pvd )  {  
			
		
	
		
			
				
					const  UIScene  * scene  =  & s - > scene ;  
			
		
	
		
			
				
					   const  UIScene  * scene  =  & s - > scene ;  
			
		
	
		
			
				
					  const  PathData  path  =  scene - > model . path ;   
			
		
	
		
			
				
					  const  float  * mpc_x_coords  =  & scene - > mpc_x [ 0 ] ;   
			
		
	
		
			
				
					  const  float  * mpc_y_coords  =  & scene - > mpc_y [ 0 ] ;   
			
		
	
	
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
				
				@ -390,19 +404,10 @@ static void ui_draw_world(UIState *s) { 
			
		
	
		
			
				
					  ui_draw_vision_lanes ( s ) ;   
			
		
	
		
			
				
					
 
			
		
	
		
			
				
					  if  ( scene - > lead_status )  {   
			
		
	
		
			
				
					    // Draw lead car indicator
   
			
		
	
		
			
				
					    float  fillAlpha  =  0 ;   
			
		
	
		
			
				
					    float  speedBuff  =  10. ;   
			
		
	
		
			
				
					    float  leadBuff  =  40. ;   
			
		
	
		
			
				
					    if  ( scene - > lead_d_rel  <  leadBuff )  {   
			
		
	
		
			
				
					      fillAlpha  =  255 * ( 1.0 - ( scene - > lead_d_rel / leadBuff ) ) ;   
			
		
	
		
			
				
					      if  ( scene - > lead_v_rel  <  0 )  {   
			
		
	
		
			
				
					        fillAlpha  + =  255 * ( - 1 * ( scene - > lead_v_rel / speedBuff ) ) ;   
			
		
	
		
			
				
					    draw_lead ( s , scene - > lead_d_rel , scene - > lead_v_rel , scene - > lead_y_rel ) ;   
			
		
	
		
			
				
					  }   
			
		
	
		
			
				
					      fillAlpha  =  ( int ) ( fmin ( fillAlpha ,  255 ) ) ;   
			
		
	
		
			
				
					    }   
			
		
	
		
			
				
					    draw_chevron ( s ,  scene - > lead_d_rel + 2.7 ,  scene - > lead_y_rel ,  25 ,   
			
		
	
		
			
				
					                  nvgRGBA ( 201 ,  34 ,  49 ,  fillAlpha ) ,  nvgRGBA ( 218 ,  202 ,  37 ,  255 ) ) ;   
			
		
	
		
			
				
					  if  ( ( scene - > lead_status2 )  & &  ( fabs ( scene - > lead_d_rel  -  scene - > lead_d_rel2 )  >  3.0 ) )  {   
			
		
	
		
			
				
					    draw_lead ( s , scene - > lead_d_rel2 , scene - > lead_v_rel2 , scene - > lead_y_rel2 ) ;   
			
		
	
		
			
				
					  }   
			
		
	
		
			
				
					}