+static void world_routes_ui_draw( u32 route )
+{
+ //glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+
+ struct subworld_routes *r = subworld_routes();
+ struct route *pr = &r->routes[route];
+
+ shader_routeui_use();
+ glBindVertexArray( pr->ui.vao );
+
+ for( u32 i=0; i<pr->ui.segment_count; i++ )
+ {
+ u32 j = (pr->ui.segment_start + i) % k_max_ui_segments;
+ struct route_ui_segment *segment = &pr->ui.segments[j];
+
+ u32 c0, c1;
+ world_routes_ui_split_indices( segment->index_start,
+ segment->index_count, &c0, &c1 );
+
+ if( c0 )
+ glDrawElements( GL_TRIANGLES, c0, GL_UNSIGNED_SHORT,
+ (void *)(segment->index_start*sizeof(u16)));
+ if( c1 )
+ glDrawElements( GL_TRIANGLES, c1, GL_UNSIGNED_SHORT, (void *)(0) );
+ }
+
+ //glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+}
+
+/*
+ * Will scan the whole run for two things;
+ * 1: we set a new record for the total, complete loop around the course
+ * 2: the time of each segment will be recorded into the data buffer
+ * (not implemented: TODO)
+ */
+static void world_routes_verify_run( u32 route )
+{
+ struct subworld_routes *r = subworld_routes();
+
+ u32 stack[64];
+ u32 si = world_routes_get_path( r->routes[route].start, stack );
+
+ /*
+ * we only care about gates that ref gates, so shuffle down the array
+ */
+ struct route_timing *timings[64];
+ u32 sj = 0, maxv = 0, begin = 0;
+ for( u32 i=0; i<si; i++ )
+ {
+ if( r->nodes[stack[i]].special_type == k_route_special_type_collector )
+ timings[sj ++] = &r->collectors[r->nodes[stack[i]].special_id].timing;
+ else if( r->nodes[stack[i]].special_type == k_route_special_type_gate )
+ timings[sj ++] = &r->gates[r->nodes[stack[i]].special_id].timing;
+ }
+
+ for( u32 i=0; i<sj; i++ )
+ {
+ if( timings[i]->version > maxv )