projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
the route strips are back
[carveJwlIkooP6JGAAIwe30JlM.git]
/
world_routes.c
diff --git
a/world_routes.c
b/world_routes.c
index d710e5edf82a058d90bb079d8a60e0630e6ddb9d..4deccaa754308cbc8566123243b05ee3c0e32d6e 100644
(file)
--- a/
world_routes.c
+++ b/
world_routes.c
@@
-39,15
+39,15
@@
static void world_routes_clear( world_instance *world )
world_static.last_use = 0.0;
}
world_static.last_use = 0.0;
}
-static void world_routes_time_lap( world_instance *world, ent_route *route )
-{
+static void world_routes_time_lap( world_instance *world, ent_route *route ){
vg_info( "------- time lap %s -------\n",
mdl_pstr(&world->meta,route->pstr_name) );
double start_time = 0.0;
u32 last_version=0;
vg_info( "------- time lap %s -------\n",
mdl_pstr(&world->meta,route->pstr_name) );
double start_time = 0.0;
u32 last_version=0;
- u32 valid_count=0;
+ u32 valid_sections=0;
+ int clean = !localplayer.rewinded_since_last_gate;
for( u32 i=0; i<route->checkpoints_count; i++ ){
u32 cpid = (i+route->active_checkpoint) % route->checkpoints_count;
for( u32 i=0; i<route->checkpoints_count; i++ ){
u32 cpid = (i+route->active_checkpoint) % route->checkpoints_count;
@@
-64,29
+64,45
@@
static void world_routes_time_lap( world_instance *world, ent_route *route )
if( i == 0 )
start_time = rg->timing_time;
else{
if( i == 0 )
start_time = rg->timing_time;
else{
- if( last_version+1 == rg->timing_version ) valid_
count
++;
- else valid_
count
= 0;
+ if( last_version+1 == rg->timing_version ) valid_
sections
++;
+ else valid_
sections
= 0;
}
last_version = rg->timing_version;
}
last_version = rg->timing_version;
- vg_info( "%u %f\n", rg->timing_version, rg->timing_time );
+
+ vg_info( "%u %f [%s]\n", rg->timing_version, rg->timing_time,
+ i? ((rg->flags & k_ent_gate_clean_pass)? "CLEAN": " "):
+ " N/A ");
+
+ if( !(rg->flags & k_ent_gate_clean_pass) )
+ clean = 0;
}
if( world_static.current_run_version == last_version+1 ){
}
if( world_static.current_run_version == last_version+1 ){
- valid_
count
++;
+ valid_
sections
++;
if( route->checkpoints_count == 1 ){
route->timing_base = world_static.time;
}
}
if( route->checkpoints_count == 1 ){
route->timing_base = world_static.time;
}
}
- else valid_
count
= 0;
+ else valid_
sections
= 0;
- vg_info( "%u %f\n", world_static.current_run_version, world_static.time );
+ vg_info( "%u %f [%s]\n",
+ world_static.current_run_version, world_static.time,
+ !localplayer.rewinded_since_last_gate? "CLEAN": " " );
- if( valid_
count
==route->checkpoints_count ){
+ if( valid_
sections
==route->checkpoints_count ){
f64 lap_time = world_static.time - start_time;
f64 lap_time = world_static.time - start_time;
- //world_routes_local_set_record( world, route, lap_time );
+ if( (route->best_laptime == 0.0) || (lap_time < route->best_laptime) ){
+ route->best_laptime = lap_time;
+ route->achievment_status |= 0x1;
+
+ if( clean )
+ route->achievment_status |= 0x2;
+ }
+
+ /* for steam achievements. */
if( route->anon.official_track_id != 0xffffffff ){
struct track_info *ti = &track_infos[ route->anon.official_track_id ];
if( ti->achievement_id ){
if( route->anon.official_track_id != 0xffffffff ){
struct track_info *ti = &track_infos[ route->anon.official_track_id ];
if( ti->achievement_id ){
@@
-105,9
+121,9
@@
static void world_routes_time_lap( world_instance *world, ent_route *route )
lap_time );
}
lap_time );
}
- route->valid_checkpoints = valid_
count
+1;
+ route->valid_checkpoints = valid_
sections
+1;
- vg_info( "valid
: %u\n", valid_count
);
+ vg_info( "valid
sections: %u\n", valid_sections
);
vg_info( "----------------------------\n" );
}
vg_info( "----------------------------\n" );
}
@@
-148,6
+164,13
@@
static void world_routes_activate_entry_gate( world_instance *world,
dest->timing_version = world_static.current_run_version;
dest->timing_time = world_static.time;
dest->timing_version = world_static.current_run_version;
dest->timing_time = world_static.time;
+ if( localplayer.rewinded_since_last_gate ){
+ localplayer.rewinded_since_last_gate = 0;
+ dest->flags &= ~k_ent_gate_clean_pass;
+ }
+ else
+ dest->flags |= k_ent_gate_clean_pass;
+
world_static.current_run_version ++;
}
world_static.current_run_version ++;
}
@@
-541,7
+564,7
@@
static void world_gen_routes_ent_init( world_instance *world ){
}
if( (gate->flags & k_ent_gate_linked) &
}
if( (gate->flags & k_ent_gate_linked) &
- !(gate->flags & k_ent_gate_nonlocal
_DELETED
) ){
+ !(gate->flags & k_ent_gate_nonlocal) ){
gate = mdl_arritm(&world->ent_gate, gate->target );
for( u32 k=0; k<4; k++ ){
gate = mdl_arritm(&world->ent_gate, gate->target );
for( u32 k=0; k<4; k++ ){
@@
-612,8
+635,7
@@
static void world_routes_update( world_instance *world ){
for( u32 i=0; i<mdl_arrcount(&world->ent_route); i++ ){
ent_route *route = mdl_arritm( &world->ent_route, i );
for( u32 i=0; i<mdl_arrcount(&world->ent_route); i++ ){
ent_route *route = mdl_arritm( &world->ent_route, i );
- int target = (route->active_checkpoint == 0xffff? 0: 1) ||
- skaterift.activity == k_skaterift_respawning;
+ int target = route->active_checkpoint == 0xffff? 0: 1;
route->factive = vg_lerpf( route->factive, target,
0.6f*vg.time_frame_delta );
}
route->factive = vg_lerpf( route->factive, target,
0.6f*vg.time_frame_delta );
}
@@
-995,7
+1017,7
@@
static void render_world_routes( world_instance *world,
for( u32 j=0; j<mdl_arrcount(&world->ent_gate); j ++ ){
ent_gate *gate = mdl_arritm( &world->ent_gate, j );
for( u32 j=0; j<mdl_arrcount(&world->ent_gate); j ++ ){
ent_gate *gate = mdl_arritm( &world->ent_gate, j );
- if( !(gate->flags & k_ent_gate_nonlocal
_DELETED
) )
+ if( !(gate->flags & k_ent_gate_nonlocal) )
render_gate_markers( mmdl, i, gate );
}
}
render_gate_markers( mmdl, i, gate );
}
}