diff --git a/src/lephisto.c b/src/lephisto.c index 0e26701..45d5bdd 100644 --- a/src/lephisto.c +++ b/src/lephisto.c @@ -262,9 +262,12 @@ static double fps_dt = 1.; static double dt = 0.; // @brief Controls the FPS. static void fps_control(void) { + unsigned int t; + // dt in ms/1000. - dt = (double)(SDL_GetTicks() - gtime) / 1000.; - gtime = SDL_GetTicks(); + t = SDL_GetTicks(); + dt = (double)(t-gtime)/1000.; + gtime = t; if(paused) SDL_Delay(10); // Drop paused FPS to be nice to the CPU.