+ float fade_amt = vg_time - pr->ui.fade_timer_start;
+ fade_amt = vg_clampf( fade_amt / 1.0f, 0.0f, 1.0f );
+
+ float fade_block_size = 0.0f,
+ main_block_size = 0.0f;
+
+ for( u32 i=0; i<pr->ui.fade_count; i++ )
+ {
+ u32 j = (pr->ui.fade_start + i) % k_max_ui_segments;
+ struct route_ui_segment *segment = &pr->ui.segments[j];
+
+ fade_block_size += segment->length;
+ }
+
+ cx -= fade_block_size * fade_amt;
+
+ v4f fade_colour;
+ v4_copy( colour, fade_colour );
+ fade_colour[3] *= 1.0f-fade_amt;
+
+ /*
+ * Draw fadeout bar
+ */
+
+ float height = pr->factive*k_bar_height,
+ base = -1.0f + (offset+0.5f)*k_bar_height;
+
+ shader_routeui_uColour( fade_colour );
+ for( u32 i=0; i<pr->ui.fade_count; i++ )
+ {
+ u32 j = (pr->ui.fade_start + i) % k_max_ui_segments;
+ struct route_ui_segment *segment = &pr->ui.segments[j];
+
+ shader_routeui_uOffset( (v4f){ cx*k_bar_scale_x, base,
+ k_bar_scale_x, height } );
+
+ world_routes_ui_draw_segment( segment );
+ cx += segment->length;
+ }
+
+ /*
+ * Draw main bar
+ */
+ shader_routeui_uColour( colour );