Merge pull request #5547 from bparker06/framecount_show

add option to remove frame count from FPS display
This commit is contained in:
Twinaphex 2017-10-14 17:45:20 +02:00 committed by GitHub
commit 74ac642752
11 changed files with 66 additions and 18 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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 */

View File

@ -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;

View File

@ -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;

View File

@ -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,
"フレームレート表示でフレーム数を表示")

View File

@ -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")

View File

@ -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")

View File

@ -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);

View File

@ -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);

View File

@ -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,