aboutsummaryrefslogtreecommitdiff
path: root/src/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/render.c')
-rw-r--r--src/render.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/render.c b/src/render.c
index 81d5ba3..97b839f 100644
--- a/src/render.c
+++ b/src/render.c
@@ -352,10 +352,12 @@ void render_draw(Game *game) {
SDL_GL_SwapBuffers();
game->render->frames++;
- if ( t - game->render->t_fps > 1000 ) {
- game->render->fps = (1000*game->render->frames) / (t - game->render->t_fps);
+ /* Calculate FPS every half a second */
+ if ( t - game->render->t_fps > 500 ) {
+ game->render->fps = (500*game->render->frames) / (t - game->render->t_fps);
game->render->t_fps = t;
game->render->frames = 0;
+ game->frame_delay_fiddled = 0;
}
}