mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 02:43:03 +00:00
Simplify video_driver_frame
This commit is contained in:
parent
18803479ac
commit
4fb95db80b
@ -2419,32 +2419,27 @@ void video_driver_frame(const void *data, unsigned width,
|
|||||||
|
|
||||||
if ((video_driver_frame_count % FPS_UPDATE_INTERVAL) == 0)
|
if ((video_driver_frame_count % FPS_UPDATE_INTERVAL) == 0)
|
||||||
{
|
{
|
||||||
char frames_text[64];
|
|
||||||
last_fps = TIME_TO_FPS(curr_time, new_time, FPS_UPDATE_INTERVAL);
|
last_fps = TIME_TO_FPS(curr_time, new_time, FPS_UPDATE_INTERVAL);
|
||||||
|
|
||||||
if (video_info.fps_show || video_info.framecount_show)
|
strlcpy(video_driver_window_title, title, sizeof(video_driver_window_title));
|
||||||
|
|
||||||
|
if (video_info.fps_show)
|
||||||
{
|
{
|
||||||
if (video_info.fps_show)
|
snprintf(video_info.fps_text, sizeof(video_info.fps_text),
|
||||||
{
|
" || FPS: %6.1f ", last_fps);
|
||||||
snprintf(video_info.fps_text, sizeof(video_info.fps_text),
|
strlcat(video_driver_window_title,
|
||||||
" || FPS: %6.1f ", last_fps);
|
video_info.fps_text, sizeof(video_driver_window_title));
|
||||||
}
|
|
||||||
if (video_info.framecount_show)
|
|
||||||
{
|
|
||||||
snprintf(frames_text,
|
|
||||||
sizeof(frames_text),
|
|
||||||
" || Frames: %" PRIu64,
|
|
||||||
(uint64_t)video_driver_frame_count);
|
|
||||||
}
|
|
||||||
snprintf(video_driver_window_title, sizeof(video_driver_window_title),
|
|
||||||
"%s%s%s", title,
|
|
||||||
video_info.fps_show ? video_info.fps_text : "",
|
|
||||||
video_info.framecount_show ? frames_text : "");
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (video_info.framecount_show)
|
||||||
{
|
{
|
||||||
if (!string_is_equal(video_driver_window_title, title))
|
char frames_text[64];
|
||||||
strlcpy(video_driver_window_title, title, sizeof(video_driver_window_title));
|
snprintf(frames_text,
|
||||||
|
sizeof(frames_text),
|
||||||
|
" || Frames: %" PRIu64,
|
||||||
|
(uint64_t)video_driver_frame_count);
|
||||||
|
strlcat(video_driver_window_title,
|
||||||
|
frames_text, sizeof(video_driver_window_title));
|
||||||
}
|
}
|
||||||
|
|
||||||
curr_time = new_time;
|
curr_time = new_time;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user