[Change] Small cosmetic change in fps_control.
This commit is contained in:
parent
489b972879
commit
44a37c0a2c
@ -322,6 +322,7 @@ static double cur_dt = 0.;
|
|||||||
*/
|
*/
|
||||||
static void fps_control(void) {
|
static void fps_control(void) {
|
||||||
unsigned int t;
|
unsigned int t;
|
||||||
|
double delay;
|
||||||
|
|
||||||
/* dt in ms/1000. */
|
/* dt in ms/1000. */
|
||||||
t = SDL_GetTicks();
|
t = SDL_GetTicks();
|
||||||
@ -332,7 +333,7 @@ static void fps_control(void) {
|
|||||||
|
|
||||||
/* If the fps is limited.. */
|
/* If the fps is limited.. */
|
||||||
if((max_fps != 0) && (cur_dt < 1./max_fps)) {
|
if((max_fps != 0) && (cur_dt < 1./max_fps)) {
|
||||||
double delay = 1./max_fps - cur_dt;
|
delay = 1./max_fps - cur_dt;
|
||||||
SDL_Delay(delay);
|
SDL_Delay(delay);
|
||||||
fps_dt += delay; /* Make sure it displays the propper FPS. */
|
fps_dt += delay; /* Make sure it displays the propper FPS. */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user