aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 49c0bd9..9456b56 100644
--- a/src/main.c
+++ b/src/main.c
@@ -292,8 +292,10 @@ int main(int argc, char *argv[]) {
game->frames = 0;
}
- /* Wait for how long it takes to render the frame at the most recent measurement. */
- if ( !gameopts.no_framerate_limit ) usleep(game->time_to_render/1000);
+ /* Wait for how long it takes the graphics card to catch up, at the most recent measurement. */
+ if ( game->time_physics < game->time_render ) {
+ if ( !gameopts.no_framerate_limit ) usleep(game->time_render-game->time_physics);
+ }
}