diff options
author | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-08-07 23:13:09 +0000 |
---|---|---|
committer | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-08-07 23:13:09 +0000 |
commit | 1b2d080a3ee0d929aefe88673cd19466f635a946 (patch) | |
tree | 117b00a18d22e8cc98906a9d225e413f282646c4 | |
parent | a61907193f8a9a46ed566eb3c01541a61d557875 (diff) |
Take seconds into account in physics timing
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@235 84d2e878-0bd5-11dd-ad15-13eda11d74c5
-rw-r--r-- | src/physics.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/physics.c b/src/physics.c index 91505b9..7b6b2b7 100644 --- a/src/physics.c +++ b/src/physics.c @@ -407,11 +407,13 @@ void physics_step(Game *game, Uint32 t) { Uint32 dt; struct timeval tv; suseconds_t us; + time_t sec; dt = t - game->tlast; gettimeofday(&tv, NULL); us = tv.tv_usec; + sec = tv.tv_sec; /* Handle things specific to the lander craft */ if ( game->thrusting ) { @@ -464,8 +466,9 @@ void physics_step(Game *game, Uint32 t) { gettimeofday(&tv, NULL); us = tv.tv_usec - us; + sec = tv.tv_sec - sec; - game->time_physics = us; + game->time_physics = us + sec*1e6; } |