diff --git a/config.def.h b/config.def.h index 7826870ffb..fde30b2bc9 100644 --- a/config.def.h +++ b/config.def.h @@ -480,6 +480,9 @@ static const int wasapi_sh_buffer_length = -16; /* auto */ /* Enables displaying the current frames per second. */ static const bool fps_show = false; +/* Show frame count on FPS display */ +static const bool framecount_show = true; + /* Enables use of rewind. This will incur some memory footprint * depending on the save state buffer. */ static const bool rewind_enable = false; diff --git a/configuration.c b/configuration.c index 96dad980ba..9f0261e063 100644 --- a/configuration.c +++ b/configuration.c @@ -1129,6 +1129,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("builtin_mediaplayer_enable", &settings->bools.multimedia_builtin_mediaplayer_enable, false, false /* TODO */, false); SETTING_BOOL("builtin_imageviewer_enable", &settings->bools.multimedia_builtin_imageviewer_enable, true, true, false); SETTING_BOOL("fps_show", &settings->bools.video_fps_show, true, false, false); + SETTING_BOOL("framecount_show", &settings->bools.video_framecount_show, true, true, false); SETTING_BOOL("ui_menubar_enable", &settings->bools.ui_menubar_enable, true, true, false); SETTING_BOOL("suspend_screensaver_enable", &settings->bools.ui_suspend_screensaver_enable, true, true, false); SETTING_BOOL("rewind_enable", &settings->bools.rewind_enable, true, rewind_enable, false); diff --git a/configuration.h b/configuration.h index 4c1280833f..5cb68b115e 100644 --- a/configuration.h +++ b/configuration.h @@ -83,6 +83,7 @@ typedef struct settings bool video_shared_context; bool video_force_srgb_disable; bool video_fps_show; + bool video_framecount_show; bool video_msg_bgcolor_enable; /* Audio */ diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 44d6da220f..3b86092f3e 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -2287,7 +2287,7 @@ void video_driver_frame(const void *data, unsigned width, last_fps = TIME_TO_FPS(curr_time, new_time, FPS_UPDATE_INTERVAL); snprintf(video_info.fps_text, sizeof(video_info.fps_text), - " FPS: %6.1f || ", last_fps); + " FPS: %6.1f", last_fps); strlcat(video_driver_window_title, video_info.fps_text, sizeof(video_driver_window_title)); @@ -2295,30 +2295,46 @@ void video_driver_frame(const void *data, unsigned width, curr_time = new_time; - strlcat(video_driver_window_title, - "Frames: ", - sizeof(video_driver_window_title)); + if (video_info.framecount_show) + { + strlcat(video_driver_window_title, + " || Frames: ", + sizeof(video_driver_window_title)); - snprintf(frames_text, - sizeof(frames_text), - STRING_REP_UINT64, - (uint64_t)video_driver_frame_count); + snprintf(frames_text, + sizeof(frames_text), + STRING_REP_UINT64, + (uint64_t)video_driver_frame_count); - strlcat(video_driver_window_title, - frames_text, - sizeof(video_driver_window_title)); + strlcat(video_driver_window_title, + frames_text, + sizeof(video_driver_window_title)); + } video_driver_window_title_update = true; } if (video_info.fps_show) - snprintf( - video_info.fps_text, - sizeof(video_info.fps_text), - "FPS: %6.1f || %s: " STRING_REP_UINT64, - last_fps, - msg_hash_to_str(MSG_FRAMES), - (uint64_t)video_driver_frame_count); + { + if (video_info.framecount_show) + { + snprintf( + video_info.fps_text, + sizeof(video_info.fps_text), + "FPS: %6.1f || %s: " STRING_REP_UINT64, + last_fps, + msg_hash_to_str(MSG_FRAMES), + (uint64_t)video_driver_frame_count); + } + else + { + snprintf( + video_info.fps_text, + sizeof(video_info.fps_text), + "FPS: %6.1f", + last_fps); + } + } } else { @@ -2463,6 +2479,7 @@ void video_driver_build_info(video_frame_info_t *video_info) video_info->hard_sync = settings->bools.video_hard_sync; video_info->hard_sync_frames = settings->uints.video_hard_sync_frames; video_info->fps_show = settings->bools.video_fps_show; + video_info->framecount_show = settings->bools.video_framecount_show; video_info->scale_integer = settings->bools.video_scale_integer; video_info->aspect_ratio_idx = settings->uints.video_aspect_ratio_idx; video_info->post_filter_record = settings->bools.video_post_filter_record; diff --git a/gfx/video_driver.h b/gfx/video_driver.h index adb7b31c81..b2b67ec973 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -413,6 +413,7 @@ typedef struct video_frame_info bool black_frame_insertion; bool hard_sync; bool fps_show; + bool framecount_show; bool scale_integer; bool post_filter_record; bool windowed_fullscreen; diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 39c02f0b63..4b434a1798 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3177,3 +3177,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_GREEN, "OSDメッセージの緑色値") MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_BLUE, "OSDメッセージの青色値") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAMECOUNT_SHOW, + "フレームレート表示でフレーム数を表示") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index c0d8685a23..f454ba44d6 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1365,3 +1365,5 @@ MSG_HASH(MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_GREEN, "video_msg_color_green") MSG_HASH(MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_BLUE, "video_msg_color_blue") +MSG_HASH(MENU_ENUM_LABEL_FRAMECOUNT_SHOW, + "framecount_show") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index f50206a905..770066767e 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3261,3 +3261,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_GREEN, "Onscreen Notification Green Color") MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_BLUE, "Onscreen Notification Blue Color") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAMECOUNT_SHOW, + "Show frame count on FPS display") diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 82a537de3a..788a216594 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5971,6 +5971,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_FPS_SHOW, PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_FRAMECOUNT_SHOW, + PARSE_ONLY_BOOL, false); menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_SCREEN_RESOLUTION, PARSE_ACTION, false); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index d0c3bf01a1..b725d6ac1c 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -3272,6 +3272,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); + CONFIG_BOOL( + list, list_info, + &settings->bools.video_framecount_show, + MENU_ENUM_LABEL_FRAMECOUNT_SHOW, + MENU_ENUM_LABEL_VALUE_FRAMECOUNT_SHOW, + fps_show, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + END_SUB_GROUP(list, list_info, parent_group); START_SUB_GROUP(list, list_info, "Platform-specific", &group_info, &subgroup_info, parent_group); diff --git a/msg_hash.h b/msg_hash.h index 1be5e2b9b3..b4eecdc70c 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1072,6 +1072,7 @@ enum msg_hash_enums MENU_LABEL(SHADER_PREV), MENU_LABEL(FRAME_ADVANCE), MENU_LABEL(FPS_SHOW), + MENU_LABEL(FRAMECOUNT_SHOW), MENU_LABEL(MOVIE_RECORD_TOGGLE), MENU_ENUM_LABEL_L_X_PLUS, MENU_ENUM_LABEL_L_X_MINUS,