Fix initial FPS display.

This commit is contained in:
Themaister 2013-02-10 14:20:42 +01:00
parent 3b5eedeab5
commit d8a4bb6d12
1 changed files with 21 additions and 21 deletions

View File

@ -38,6 +38,27 @@ bool gfx_get_fps(char *buf, size_t size, bool always_write)
(MEASURE_FRAME_TIME_SAMPLES_COUNT - 1);
g_extern.measure_data.frame_time_samples[write_index] = new_time - fps_time;
fps_time = new_time;
if ((g_extern.frame_count % FPS_UPDATE_INTERVAL) == 0)
{
last_fps = time_to_fps(time, new_time, FPS_UPDATE_INTERVAL);
time = new_time;
#ifdef RARCH_CONSOLE
snprintf(buf, size, "FPS: %6.1f || Frames: %d", last_fps, g_extern.frame_count);
#else
snprintf(buf, size, "%s || FPS: %6.1f || Frames: %d", g_extern.title_buf, last_fps, g_extern.frame_count);
#endif
ret = true;
}
else if (always_write)
{
#ifdef RARCH_CONSOLE
snprintf(buf, size, "FPS: %6.1f || Frames: %d", last_fps, g_extern.frame_count);
#else
snprintf(buf, size, "%s || FPS: %6.1f || Frames: %d", g_extern.title_buf, last_fps, g_extern.frame_count);
#endif
}
}
else
{
@ -46,27 +67,6 @@ bool gfx_get_fps(char *buf, size_t size, bool always_write)
ret = true;
}
if ((g_extern.frame_count % FPS_UPDATE_INTERVAL) == 0)
{
last_fps = time_to_fps(time, new_time, FPS_UPDATE_INTERVAL);
time = new_time;
#ifdef RARCH_CONSOLE
snprintf(buf, size, "FPS: %6.1f || Frames: %d", last_fps, g_extern.frame_count);
#else
snprintf(buf, size, "%s || FPS: %6.1f || Frames: %d", g_extern.title_buf, last_fps, g_extern.frame_count);
#endif
ret = true;
}
else if (always_write)
{
#ifdef RARCH_CONSOLE
snprintf(buf, size, "FPS: %6.1f || Frames: %d", last_fps, g_extern.frame_count);
#else
snprintf(buf, size, "%s || FPS: %6.1f || Frames: %d", g_extern.title_buf, last_fps, g_extern.frame_count);
#endif
}
return ret;
}