Skip to content

Commit

Permalink
Now a ceiling is performed and an additional 0.5 seconds is added.
Browse files Browse the repository at this point in the history
  • Loading branch information
blegas78 committed May 26, 2021
1 parent 958f5c8 commit 2cb9a73
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions TLOU2/tlou2-60fps/tlou2/script.asl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ update
//vars.timerModel.CurrentState.SetGameTime(vars.timerModel.CurrentState.CurrentTime.GameTime + new TimeSpan( 0, 0, 0, 1, 0) );

// This performs an effective ceil() on seconds:
var millisecondsToAdd = 1000 - vars.timerModel.CurrentState.CurrentTime.GameTime.Milliseconds;
var millisecondsToAdd = 1500 - vars.timerModel.CurrentState.CurrentTime.GameTime.Milliseconds;
//if(millisecondsToAdd < 1000) {
// vars.ticksForTimeCorrection += millisecondsToAdd-9;
vars.timerModel.CurrentState.SetGameTime(vars.timerModel.CurrentState.CurrentTime.GameTime + new TimeSpan( 0, 0, 0, 0, millisecondsToAdd) );
Expand Down Expand Up @@ -203,11 +203,11 @@ update
// Note on imprecision: rounding the milliseconds from 11.001001 to 11 results in an error of 1.82 seconds over 5 hours
if( !vars.currentlyLoading && vars.timerModel.CurrentState.CurrentTime.GameTime.TotalMilliseconds >= vars.ticksForTimeCorrection) {
// 60-fps:
vars.ticksForTimeCorrection += 960;
vars.timerModel.CurrentState.SetGameTime(vars.timerModel.CurrentState.CurrentTime.GameTime + new TimeSpan( 0, 0, 0, 0, -41) );
// vars.ticksForTimeCorrection += 960;
// vars.timerModel.CurrentState.SetGameTime(vars.timerModel.CurrentState.CurrentTime.GameTime + new TimeSpan( 0, 0, 0, 0, -41) );
// 29.97fps:
// vars.ticksForTimeCorrection += 990;
// vars.timerModel.CurrentState.SetGameTime(vars.timerModel.CurrentState.CurrentTime.GameTime + new TimeSpan( 0, 0, 0, 0, -11) );
vars.ticksForTimeCorrection += 990;
vars.timerModel.CurrentState.SetGameTime(vars.timerModel.CurrentState.CurrentTime.GameTime + new TimeSpan( 0, 0, 0, 0, -11) );
}
// At start of IGT, reset the comparison for time correction:
if(vars.timerModel.CurrentState.CurrentTime.GameTime.TotalMilliseconds < 400) {
Expand Down

0 comments on commit 2cb9a73

Please sign in to comment.