diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -213,17 +213,19 @@ int main(int argc, char *argv[]) { /* Main loop */ finished = 0; game->time = 0.0; - game->tlast = SDL_GetTicks(); + game->tlast = utils_highresms(); + game->t_fps = game->tlast; while ( !finished ) { int mx, my; Uint8 buttons; int mouse_thrust = 0; - int dt; + double us, dt; /* Tick size is measured, ... */ - dt = SDL_GetTicks() - game->tlast; - game->tlast = SDL_GetTicks(); + us = utils_highresms(); + dt = us - game->tlast; + game->tlast = us; /* ... but timer advances only when game is not paused */ if ( !game->paused ) { game->time += dt; @@ -280,7 +282,7 @@ int main(int argc, char *argv[]) { if ( mouse_thrust ) game->thrusting = 0; if ( gameopts.status_line ) { - printf("%10lli %4i %+7.5f %+7.5f %+7.5f %2i %2i %2i %3i fps (r:%6lli p:%6lli) \r", + printf("%+13.3f %+5.3f %+7.5f %+7.5f %+7.5f %2i %2i %2i %3i fps (r:%6lli p:%6lli) \r", game->time, dt, game->lander->vx, game->lander->vy, game->lander->vz, game->cur_room_x, game->cur_room_y, game->cur_room_z, game->fps, |