#include "shaders/fscolour.h"
#include "shaders/alphatest.h"
-enum { k_max_ui_segments = 32 };
-enum { k_route_ui_max_verts = 2000 };
-enum { k_route_ui_max_indices = 3000 };
+enum { k_max_ui_segments = 8 };
+enum { k_max_ui_splits_per_segment = 16 };
+
+enum { k_max_ui_elements = k_max_ui_segments*k_max_ui_splits_per_segment };
+enum { k_max_element_verts = 10 };
+enum { k_max_element_indices = 20 };
+
+enum { k_route_ui_max_verts = k_max_ui_elements*k_max_element_verts };
+enum { k_route_ui_max_indices = k_max_ui_elements*k_max_element_indices };
static struct gworld
{
{
float length;
u32 vertex_start, vertex_count,
- index_start, index_count;
+ index_start, index_count, notches;
}
segments[k_max_ui_segments];
}
*routes;
+ double last_interaction;
+
u32 route_count,
route_cap;
k_route_special_type_collector = 2
};
+static void world_routes_interact(void)
+{
+ world.routes.last_interaction = vg_time;
+}
+
static void debug_sbpath( struct route_node *rna, struct route_node *rnb,
u32 colour, float xoffset )
{
segment->vertex_count = 4;
segment->index_start = pr->ui.indices_head;
segment->index_count = 6;
+ segment->notches = 0;
world_routes_ui_set_indices( pr, indices, 6 );
}
if( (time - pr->ui.last_notch) > 1.0 )
{
+ struct route_ui_segment *segment = world_routes_ui_curseg(pr);
+ if( segment->notches == k_max_ui_splits_per_segment )
+ return;
+
+ segment->notches ++;
+
v2f verts[8];
float const k_notch_width = 1.0f;
pr->ui.last_notch = time;
- struct route_ui_segment *segment = world_routes_ui_curseg(pr);
segment->vertex_count += 6;
segment->index_count += 18;
}
v4_copy( colour, fade_colour );
fade_colour[3] *= 1.0f-fade_amt;
+ float timer_delta = (vg_time - world.routes.last_interaction) * (1.0/60.0),
+ timer_scale = 1.0f - vg_minf( timer_delta, 1.0f );
+
/*
* Draw fadeout bar
*/
- float height = pr->factive*k_bar_height,
- base = -1.0f + (offset+0.5f)*k_bar_height;
+ float height = pr->factive*k_bar_height * timer_scale,
+ base = -1.0f + (offset+0.5f)*k_bar_height * timer_scale;
shader_routeui_uColour( fade_colour );
for( u32 i=0; i<pr->ui.fade_count; i++ )
*/
static void world_routes_activate_gate( u32 id )
{
+ world_routes_interact();
+
struct subworld_routes *r = &world.routes;
struct route_gate *rg = &r->gates[id];
struct route_node *pnode = &r->nodes[rg->node_id],
static void world_routes_notify_reset(void)
{
struct subworld_routes *r = &world.routes;
+ world_routes_interact();
for( int i=0; i<r->route_count; i++ )
{