mirror of
https://github.com/libretro/RetroArch
synced 2025-04-02 07:20:34 +00:00
Show FPS in title bar only when 'Display Framerate' is enabled
This commit is contained in:
parent
b72f7001de
commit
c82505ed9e
@ -998,12 +998,29 @@ bool video_monitor_get_fps(char *buf, size_t size,
|
|||||||
|
|
||||||
if ((video_driver_frame_count % FPS_UPDATE_INTERVAL) == 0)
|
if ((video_driver_frame_count % FPS_UPDATE_INTERVAL) == 0)
|
||||||
{
|
{
|
||||||
|
char frames_text[64];
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
last_fps = TIME_TO_FPS(curr_time, new_time, FPS_UPDATE_INTERVAL);
|
last_fps = TIME_TO_FPS(curr_time, new_time, FPS_UPDATE_INTERVAL);
|
||||||
curr_time = new_time;
|
curr_time = new_time;
|
||||||
|
|
||||||
snprintf(buf, size, "%s || FPS: %6.1f || Frames: " U64_SIGN,
|
strlcpy(buf, video_driver_title_buf, size);
|
||||||
video_driver_title_buf, last_fps,
|
strlcat(buf, " || ", size);
|
||||||
|
|
||||||
|
if (settings->fps_show)
|
||||||
|
{
|
||||||
|
char fps_text[64];
|
||||||
|
snprintf(fps_text, sizeof(fps_text), " FPS: %6.1f", last_fps);
|
||||||
|
strlcat(buf, fps_text, size);
|
||||||
|
strlcat(buf, " || ", size);
|
||||||
|
}
|
||||||
|
|
||||||
|
strlcat(buf, "Frames: ", size);
|
||||||
|
|
||||||
|
snprintf(frames_text, sizeof(frames_text), U64_SIGN,
|
||||||
(unsigned long long)video_driver_frame_count);
|
(unsigned long long)video_driver_frame_count);
|
||||||
|
|
||||||
|
strlcat(buf, frames_text, size);
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user