projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rewinds
[carveJwlIkooP6JGAAIwe30JlM.git]
/
world_routes.h
diff --git
a/world_routes.h
b/world_routes.h
index 7920588e27e9672717669b890f7557d343d13b9a..3de9278b5a13079cef0df65717b29058a00e9e93 100644
(file)
--- a/
world_routes.h
+++ b/
world_routes.h
@@
-1,3
+1,7
@@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ */
+
#ifndef ROUTES_H
#define ROUTES_H
#ifndef ROUTES_H
#define ROUTES_H
@@
-17,7
+21,7
@@
enum route_special_type
static void world_routes_interact(void)
{
static void world_routes_interact(void)
{
- world.routes.last_interaction = vg
_
time;
+ world.routes.last_interaction = vg
.
time;
}
static void debug_sbpath( struct route_node *rna, struct route_node *rnb,
}
static void debug_sbpath( struct route_node *rna, struct route_node *rnb,
@@
-406,7
+410,7
@@
static void world_routes_ui_draw( u32 route, v4f colour, float offset )
shader_routeui_use();
glBindVertexArray( pr->ui.vao );
shader_routeui_use();
glBindVertexArray( pr->ui.vao );
- float fade_amt = vg
_
time - pr->ui.fade_timer_start;
+ 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,
fade_amt = vg_clampf( fade_amt / 1.0f, 0.0f, 1.0f );
float fade_block_size = 0.0f,
@@
-426,7
+430,8
@@
static void world_routes_ui_draw( u32 route, v4f colour, float offset )
v4_copy( colour, fade_colour );
fade_colour[3] *= 1.0f-fade_amt;
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),
+ /* 1 minute timer */
+ float timer_delta = (vg.time - world.routes.last_interaction) * (1.0/30.0),
timer_scale = 1.0f - vg_minf( timer_delta, 1.0f );
/*
timer_scale = 1.0f - vg_minf( timer_delta, 1.0f );
/*
@@
-491,7
+496,15
@@
static void world_routes_local_set_record( u32 route, double lap_time )
temp.time = time_centiseconds;
highscores_push_record( &temp );
temp.time = time_centiseconds;
highscores_push_record( &temp );
- track_infos[ pr->track_id ].push = 1;
+
+ struct track_info *pti = &track_infos[ pr->track_id ];
+ pti->push = 1;
+
+ if( pti->achievement_id )
+ {
+ steam_set_achievement( pti->achievement_id );
+ steam_store_achievements();
+ }
}
else
{
}
else
{
@@
-576,7
+589,7
@@
static void world_routes_verify_run( u32 route )
pr->ui.fade_start = pr->ui.segment_start;
pr->ui.fade_count = 0;
pr->ui.fade_start = pr->ui.segment_start;
pr->ui.fade_count = 0;
- pr->ui.fade_timer_start = vg
_
time;
+ pr->ui.fade_timer_start = vg
.
time;
int orig_seg_count = pr->ui.segment_count;
int orig_seg_count = pr->ui.segment_count;
@@
-599,7
+612,7
@@
static void world_routes_verify_run( u32 route )
pr->ui.fade_count ++;
}
pr->ui.fade_count ++;
}
- r->routes[route].latest_pass = vg
_
time;
+ r->routes[route].latest_pass = vg
.
time;
}
/*
}
/*
@@
-618,7
+631,7
@@
static void world_routes_activate_gate( u32 id )
r->active_gate = id;
rg->timing.version = r->current_run_version;
r->active_gate = id;
rg->timing.version = r->current_run_version;
- rg->timing.time = vg
_
time;
+ rg->timing.time = vg
.
time;
for( u32 i=0; i<r->route_count; i++ )
{
struct route *route = &r->routes[i];
for( u32 i=0; i<r->route_count; i++ )
{
struct route *route = &r->routes[i];
@@
-640,7
+653,7
@@
static void world_routes_activate_gate( u32 id )
{
route->ui.fade_start = route->ui.segment_start;
route->ui.fade_count = route->ui.segment_count;
{
route->ui.fade_start = route->ui.segment_start;
route->ui.fade_count = route->ui.segment_count;
- route->ui.fade_timer_start = vg
_
time;
+ route->ui.fade_timer_start = vg
.
time;
world_routes_ui_clear(i);
vg_success( "CLEARING -> %u %u \n", route->ui.fade_start,
world_routes_ui_clear(i);
vg_success( "CLEARING -> %u %u \n", route->ui.fade_start,
@@
-651,7
+664,7
@@
static void world_routes_activate_gate( u32 id )
r->current_run_version ++;
rc->timing.version = r->current_run_version;
r->current_run_version ++;
rc->timing.version = r->current_run_version;
- rc->timing.time = vg
_
time;
+ rc->timing.time = vg
.
time;
r->current_run_version ++;
}
r->current_run_version ++;
}
@@
-668,7
+681,7
@@
static void world_routes_notify_reset(void)
struct route *route = &r->routes[i];
if( route->active )
struct route *route = &r->routes[i];
if( route->active )
- world_routes_ui_notch( i, vg
_
time - route->latest_pass );
+ world_routes_ui_notch( i, vg
.
time - route->latest_pass );
}
}
}
}
@@
-1011,6
+1024,7
@@
static void world_routes_loadfrom( mdl_header *mdl )
1, sizeof( struct route ) );
struct route *route = &r->routes[r->route_count];
1, sizeof( struct route ) );
struct route *route = &r->routes[r->route_count];
+ memset( route, 0, sizeof(struct route) );
v3_copy( inf->colour, route->colour );
route->colour[3] = 1.0f;
v3_copy( inf->colour, route->colour );
route->colour[3] = 1.0f;
@@
-1115,11
+1129,12
@@
static void world_routes_update(void)
for( int i=0; i<r->route_count; i++ )
{
struct route *route = &r->routes[i];
for( int i=0; i<r->route_count; i++ )
{
struct route *route = &r->routes[i];
- route->factive = vg_lerpf( route->factive, route->active, 0.01f );
+ route->factive = vg_lerpf( route->factive, route->active,
+ 0.6f*vg.time_delta );
if( route->active )
{
if( route->active )
{
- world_routes_ui_updatetime( i, vg
_
time - route->latest_pass );
+ world_routes_ui_updatetime( i, vg
.
time - route->latest_pass );
}
}
}
}
}
}