summaryrefslogtreecommitdiff
path: root/src/game/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/game.cpp')
-rw-r--r--src/game/game.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp
index ae2cb0f..883df60 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -516,6 +516,8 @@ void state_t::tick(ntime_t time_)
target = (time_ - t0) / TIME_DELTA;
while (frames_since_t0 < target) {
+ ntime_t tmp;
+
// FIXME: Is this non-deterministic enough?
prng.seed(prng.next() ^ time);
@@ -540,15 +542,13 @@ void state_t::tick(ntime_t time_)
fc_game.tick();
- if (nclock() - time_ > TIME_LIMIT) {
- size_t left;
-
- left = target - frames_since_t0;
+ tmp = nclock();
+ if (tmp - time_ > TIME_LIMIT) {
t0 = nclock();
frames_since_t0 = 0;
frames_behind++;
- interface.print("(Lag: " + std::to_string(left) + ")");
+ interface.print("(Lag: " + std::to_string((tmp - time_) / MSEC(1)) + " ms)");
break;
}