Skip to content

Commit

Permalink
Changed --no-time-travel to just affect the displayed time.
Browse files Browse the repository at this point in the history
Previous approach changed the commit timestamp which has other implications
to the simulation such as how merge commits get applied when a file
has been removed.
  • Loading branch information
acaudwell committed Jun 27, 2019
1 parent 93b5210 commit 8e5e052
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/gource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1114,13 +1114,6 @@ void Gource::readLog() {
break;
}

if(gGourceSettings.no_time_travel) {
time_t check_time = commitqueue.empty() ? lasttime : commitqueue.back().timestamp;
if(commit.timestamp < check_time) {
commit.timestamp = check_time;
}
}

commitqueue.push_back(commit);
}

Expand Down Expand Up @@ -1720,12 +1713,19 @@ void Gource::logic(float t, float dt) {

processCommit(commit, t);

// allow for non linear time lines
if(lasttime > commit.timestamp) {
currtime = commit.timestamp;
if(gGourceSettings.no_time_travel) {
if(commit.timestamp > lasttime) {
lasttime = commit.timestamp;
}

} else {
// allow for non linear time lines
if(lasttime > commit.timestamp) {
currtime = commit.timestamp;
}
lasttime = commit.timestamp;
}

lasttime = commit.timestamp;
subseconds = 0.0;

commitqueue.pop_front();
Expand Down

0 comments on commit 8e5e052

Please sign in to comment.