# HG changeset patch # User Michael Pavone # Date 1448769915 28800 # Node ID 8cf57c6558ed9ecaf1216ff66ab3848556753bfc # Parent b3b399665356390a9b7029f513d94cfece6ff8ec Dividing by FPS_INTERVAL does not make senese as the division was to convert milliseconds to seconds diff -r b3b399665356 -r 8cf57c6558ed render_sdl.c --- a/render_sdl.c Sat Nov 28 14:49:34 2015 -0800 +++ b/render_sdl.c Sat Nov 28 20:05:15 2015 -0800 @@ -588,14 +588,13 @@ frame_counter++; if ((last_frame - start) > FPS_INTERVAL) { if (start && (last_frame-start)) { +#ifdef __ANDROID__ + info_message("%s - %.1f fps", caption, ((float)frame_counter) / (((float)(last_frame-start)) / 1000.0)); +#else if (!fps_caption) { fps_caption = malloc(strlen(caption) + strlen(" - 100000000.1 fps") + 1); } - -#ifdef __ANDROID__ - info_message("%s - %.1f fps", caption, ((float)frame_counter) / (((float)(last_frame-start)) / (float)FPS_INTERVAL)); -#else - sprintf(fps_caption, "%s - %.1f fps", caption, ((float)frame_counter) / (((float)(last_frame-start)) / (float)FPS_INTERVAL)); + sprintf(fps_caption, "%s - %.1f fps", caption, ((float)frame_counter) / (((float)(last_frame-start)) / 1000.0)); SDL_SetWindowTitle(main_window, fps_caption); #endif }