Mercurial > repos > blastem
comparison render_sdl.c @ 906:8cf57c6558ed
Dividing by FPS_INTERVAL does not make senese as the division was to convert milliseconds to seconds
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 28 Nov 2015 20:05:15 -0800 |
parents | b3b399665356 |
children | b5d35222047e |
comparison
equal
deleted
inserted
replaced
905:b3b399665356 | 906:8cf57c6558ed |
---|---|
586 render_context(context); | 586 render_context(context); |
587 | 587 |
588 frame_counter++; | 588 frame_counter++; |
589 if ((last_frame - start) > FPS_INTERVAL) { | 589 if ((last_frame - start) > FPS_INTERVAL) { |
590 if (start && (last_frame-start)) { | 590 if (start && (last_frame-start)) { |
591 #ifdef __ANDROID__ | |
592 info_message("%s - %.1f fps", caption, ((float)frame_counter) / (((float)(last_frame-start)) / 1000.0)); | |
593 #else | |
591 if (!fps_caption) { | 594 if (!fps_caption) { |
592 fps_caption = malloc(strlen(caption) + strlen(" - 100000000.1 fps") + 1); | 595 fps_caption = malloc(strlen(caption) + strlen(" - 100000000.1 fps") + 1); |
593 } | 596 } |
594 | 597 sprintf(fps_caption, "%s - %.1f fps", caption, ((float)frame_counter) / (((float)(last_frame-start)) / 1000.0)); |
595 #ifdef __ANDROID__ | |
596 info_message("%s - %.1f fps", caption, ((float)frame_counter) / (((float)(last_frame-start)) / (float)FPS_INTERVAL)); | |
597 #else | |
598 sprintf(fps_caption, "%s - %.1f fps", caption, ((float)frame_counter) / (((float)(last_frame-start)) / (float)FPS_INTERVAL)); | |
599 SDL_SetWindowTitle(main_window, fps_caption); | 598 SDL_SetWindowTitle(main_window, fps_caption); |
600 #endif | 599 #endif |
601 } | 600 } |
602 start = last_frame; | 601 start = last_frame; |
603 frame_counter = 0; | 602 frame_counter = 0; |