From 297f2b3050de91f9be678f1ccff0cc8e2a45353e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 08:15:57 +0200 Subject: [PATCH 01/16] Cover edge case - if this would return false, this would not be set to false, and as a result, Load Core would not show --- retroarch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retroarch.c b/retroarch.c index 98415ed450..8b335cb67e 100644 --- a/retroarch.c +++ b/retroarch.c @@ -3864,7 +3864,10 @@ static bool event_init_content(void) path_fill_names(); if (!content_init()) + { + runloop_core_running = false; return false; + } command_event_set_savestate_auto_index(); From a93b99b919a690f90f21c3947f549514ef8b28ae Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 08:31:07 +0200 Subject: [PATCH 02/16] Hook up start button to 'Load Core' - will unload a core --- menu/cbs/menu_cbs_ok.c | 2 +- menu/cbs/menu_cbs_start.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index b1e09656f2..551052e020 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -1410,7 +1410,7 @@ static int set_path_generic(const char *label, const char *action_path) return 0; } -static int generic_action_ok_command(enum event_command cmd) +int generic_action_ok_command(enum event_command cmd) { #ifdef HAVE_AUDIOMIXER settings_t *settings = config_get_ptr(); diff --git a/menu/cbs/menu_cbs_start.c b/menu/cbs/menu_cbs_start.c index 8d0ac72df0..2ce147d47f 100644 --- a/menu/cbs/menu_cbs_start.c +++ b/menu/cbs/menu_cbs_start.c @@ -49,6 +49,8 @@ cbs->action_start_ident = #name; #endif +int generic_action_ok_command(enum event_command cmd); + #ifdef HAVE_AUDIOMIXER static int action_start_audio_mixer_stream_volume(unsigned type, const char *label) { @@ -323,6 +325,17 @@ static int action_start_video_resolution(unsigned type, const char *label) return 0; } +static int action_start_load_core(unsigned type, const char *label) +{ + int ret = generic_action_ok_command( + CMD_EVENT_UNLOAD_CORE); + bool refresh = false; + + menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); + menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL); + return 0; +} + static int action_start_lookup_setting(unsigned type, const char *label) { return menu_setting_set(type, MENU_ACTION_START, false); @@ -334,6 +347,9 @@ static int menu_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs) { switch (cbs->enum_idx) { + case MENU_ENUM_LABEL_CORE_LIST: + BIND_ACTION_START(cbs, action_start_load_core); + break; case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET: BIND_ACTION_START(cbs, action_start_shader_preset); break; From 02dccb0396ddf2e3a46cf9451d879248d0011f11 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 08:51:33 +0200 Subject: [PATCH 03/16] (OSX) Buildfix for C89_BUILD --- gfx/drivers_font_renderer/coretext.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gfx/drivers_font_renderer/coretext.c b/gfx/drivers_font_renderer/coretext.c index 93efb1ae2e..c73e5fdc86 100644 --- a/gfx/drivers_font_renderer/coretext.c +++ b/gfx/drivers_font_renderer/coretext.c @@ -31,6 +31,8 @@ #include #endif +#include + #include "../font_driver.h" #define CT_ATLAS_ROWS 16 From b6c92d5a66f46a475c290f9f8e6f4f9a92f9d62c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 09:17:54 +0200 Subject: [PATCH 04/16] Do video driver monitor reset after fastforwarding; helps prevent the building up of big frametime deviations --- retroarch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retroarch.c b/retroarch.c index 8b335cb67e..91bee7db1e 100644 --- a/retroarch.c +++ b/retroarch.c @@ -23964,7 +23964,10 @@ static void update_fastforwarding_state(void) else { if (menu_widgets_inited) + { menu_widgets_fast_forward = false; + video_driver_monitor_reset(); + } } #endif } From f85c0737e453b5480b8a6f6dd962d57f1218932b Mon Sep 17 00:00:00 2001 From: jdgleaver Date: Sat, 24 Aug 2019 14:37:45 +0100 Subject: [PATCH 05/16] (3DS) Build fix --- gfx/common/ctr_common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gfx/common/ctr_common.h b/gfx/common/ctr_common.h index 6f12e2bf0d..161f07c856 100644 --- a/gfx/common/ctr_common.h +++ b/gfx/common/ctr_common.h @@ -16,6 +16,7 @@ #ifndef CTR_COMMON_H__ #define CTR_COMMON_H__ +#include <3ds.h> #include #define COLOR_ABGR(r, g, b, a) (((unsigned)(a) << 24) | ((b) << 16) | ((g) << 8) | ((r) << 0)) From 9b713409592d01f0400962e8105685f617570300 Mon Sep 17 00:00:00 2001 From: LazyBumHorse Date: Fri, 23 Aug 2019 13:45:05 +0200 Subject: [PATCH 06/16] finish up shader menu changes, add 'remove presets' to Qt --- intl/msg_hash_ar.h | 2 +- intl/msg_hash_chs.h | 2 +- intl/msg_hash_cht.h | 2 +- intl/msg_hash_de.h | 2 +- intl/msg_hash_el.h | 2 +- intl/msg_hash_eo.h | 2 +- intl/msg_hash_es.h | 2 +- intl/msg_hash_fr.h | 2 +- intl/msg_hash_it.h | 2 +- intl/msg_hash_ja.h | 2 +- intl/msg_hash_ko.h | 2 +- intl/msg_hash_lbl.h | 2 + intl/msg_hash_nl.h | 2 +- intl/msg_hash_pl.h | 2 +- intl/msg_hash_pt_br.h | 2 +- intl/msg_hash_pt_pt.h | 2 +- intl/msg_hash_ru.h | 2 +- intl/msg_hash_tr.h | 2 +- intl/msg_hash_us.h | 16 ++- intl/msg_hash_vn.h | 2 +- menu/cbs/menu_cbs_ok.c | 6 + menu/drivers/materialui.c | 5 +- menu/menu_displaylist.c | 74 ++++++----- menu/menu_shader.c | 65 ++++++++-- menu/menu_shader.h | 2 + msg_hash.h | 2 + retroarch.c | 2 + ui/drivers/qt/shaderparamsdialog.cpp | 181 ++++++++++++++++++++------- ui/drivers/qt/shaderparamsdialog.h | 16 ++- 29 files changed, 291 insertions(+), 116 deletions(-) diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index 1c99e0dc87..8898c6a917 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -4084,7 +4084,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index a40c51b62a..85ae24d243 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -5102,7 +5102,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 13ace0a207..ded3a27699 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3860,7 +3860,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 2a6d169b21..895b5f21ed 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3989,7 +3989,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_el.h b/intl/msg_hash_el.h index e02473d8af..82e9618e88 100644 --- a/intl/msg_hash_el.h +++ b/intl/msg_hash_el.h @@ -8066,7 +8066,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 4c458e103a..bca85d72b0 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3748,7 +3748,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index a6619e3ac1..9dfc8eb454 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -8218,7 +8218,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 00de2ae376..35790af4b9 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -9006,7 +9006,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index d8c4323181..7ae68763a9 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3969,7 +3969,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index e88a9fc418..c17df1477a 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -9381,7 +9381,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 05660d3a57..9a40759ed8 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -9213,7 +9213,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 833641e9d8..f1d04f49bb 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -843,6 +843,8 @@ MSG_HASH(MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE, "no_playlist_entries_available") MSG_HASH(MENU_ENUM_LABEL_NO_SETTINGS_FOUND, "menu_label_no_settings_found") +MSG_HASH(MENU_ENUM_LABEL_NO_PRESETS_FOUND, + "menu_label_no_presets_found") MSG_HASH(MENU_ENUM_LABEL_NO_SHADER_PARAMETERS, "no_shader_parameters.") MSG_HASH(MENU_ENUM_LABEL_ONLINE, diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index bcdb9b36cc..bab5900d73 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3742,7 +3742,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index ca2bb58f74..cde0ec5d28 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -4533,7 +4533,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index 90443cf109..d59c010633 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -9293,7 +9293,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 0e7a4693ad..386301b74e 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3814,7 +3814,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 76a3323490..5f761ef228 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -4012,7 +4012,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_tr.h b/intl/msg_hash_tr.h index 1029e02e72..66facabd39 100644 --- a/intl/msg_hash_tr.h +++ b/intl/msg_hash_tr.h @@ -9018,7 +9018,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index de704e7557..56ab32ebfb 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -2032,6 +2032,10 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND, "No settings found." ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NO_PRESETS_FOUND, + "No automatic shader presets found." + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_NO_SHADER_PARAMETERS, "No shader parameters." @@ -3874,7 +3878,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_SAVE, - "Save ..." + "Save" ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_SAVE_AS, @@ -6594,7 +6598,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_SAVE, - "Save shader preset as ..." + "Save the current shader preset." ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_SAVE_AS, @@ -8542,6 +8546,10 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_QT_REMOVE, "Remove" ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_QT_REMOVE_PASSES, + "Remove Passes" + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_QT_APPLY, "Apply" @@ -9525,10 +9533,10 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, - "Remove shader presets of a specific type.") + "Remove an automatic shader preset.") MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_GLOBAL, "Remove Global Preset") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index d759edaaa0..8941effdaa 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3904,7 +3904,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE, - "Remove ...") + "Remove") MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE, "Remove shader presets of a specific type.") diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 551052e020..8c0244dba8 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -2739,10 +2739,16 @@ static int generic_action_ok_shader_preset_remove(const char *path, } if (menu_shader_manager_remove_auto_preset(preset_type)) + { + bool refresh = false; + runloop_msg_queue_push( msg_hash_to_str(MSG_SHADER_PRESET_REMOVED_SUCCESSFULLY), 1, 100, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); + + menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); + } else runloop_msg_queue_push( msg_hash_to_str(MSG_ERROR_REMOVING_SHADER_PRESET), diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 9becce72ce..d50286d6ae 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -2495,8 +2495,9 @@ static void materialui_list_insert(void *userdata, string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NO_CORE_INFORMATION_AVAILABLE)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NO_ITEMS)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NO_CORE_OPTIONS_AVAILABLE)) || - (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_INFORMATION))) || - string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NO_SETTINGS_FOUND)) + string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_INFORMATION)) || + string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NO_SETTINGS_FOUND)) || + string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NO_PRESETS_FOUND)) ) { node->texture_switch2_index = MUI_TEXTURE_INFO; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index bcf725c829..f4bdef47f9 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -6291,13 +6291,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, if (settings->bools.video_shader_enable) { - if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SHADER_APPLY_CHANGES), - msg_hash_to_str(MENU_ENUM_LABEL_SHADER_APPLY_CHANGES), - MENU_ENUM_LABEL_SHADER_APPLY_CHANGES, - MENU_SETTING_ACTION, 0, 0)) - count++; - if (frontend_driver_can_watch_for_changes()) { if (menu_entries_append_enum(info->list, @@ -6328,12 +6321,20 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, MENU_SETTING_ACTION, 0, 0)) count++; + if (menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SHADER_APPLY_CHANGES), + msg_hash_to_str(MENU_ENUM_LABEL_SHADER_APPLY_CHANGES), + MENU_ENUM_LABEL_SHADER_APPLY_CHANGES, + MENU_SETTING_ACTION, 0, 0)) + count++; + if (menu_entries_append_enum(info->list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PARAMETERS), msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PARAMETERS), MENU_ENUM_LABEL_VIDEO_SHADER_PARAMETERS, MENU_SETTING_ACTION, 0, 0)) count++; + if (menu_entries_append_enum(info->list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_NUM_PASSES), msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_NUM_PASSES), @@ -8214,33 +8215,44 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list); { #if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL) - if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_GLOBAL), - msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_GLOBAL), - MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_GLOBAL, - MENU_SETTING_ACTION, 0, 0)) - count++; + if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_GLOBAL)) + if (menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_GLOBAL), + msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_GLOBAL), + MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_GLOBAL, + MENU_SETTING_ACTION, 0, 0)) + count++; - if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_CORE), - msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_CORE), - MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_CORE, - MENU_SETTING_ACTION, 0, 0)) - count++; + if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_CORE)) + if (menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_CORE), + msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_CORE), + MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_CORE, + MENU_SETTING_ACTION, 0, 0)) + count++; - if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_PARENT), - msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_PARENT), - MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_PARENT, - MENU_SETTING_ACTION, 0, 0)) - count++; + if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_PARENT)) + if (menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_PARENT), + msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_PARENT), + MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_PARENT, + MENU_SETTING_ACTION, 0, 0)) + count++; - if (menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_GAME), - msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_GAME), - MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, - MENU_SETTING_ACTION, 0, 0)) - count++; + if (menu_shader_manager_auto_preset_exists(SHADER_PRESET_GAME)) + if (menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_GAME), + msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_GAME), + MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, + MENU_SETTING_ACTION, 0, 0)) + count++; + + if (count == 0) + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_PRESETS_FOUND), + msg_hash_to_str(MENU_ENUM_LABEL_NO_PRESETS_FOUND), + MENU_ENUM_LABEL_NO_PRESETS_FOUND, + 0, 0, 0); #endif } diff --git a/menu/menu_shader.c b/menu/menu_shader.c index 399c9fbde6..8756dd6f17 100644 --- a/menu/menu_shader.c +++ b/menu/menu_shader.c @@ -45,6 +45,18 @@ void menu_shader_set_modified(bool modified) menu_driver_shader_modified = modified; } +static enum rarch_shader_type shader_types[] = +{ + RARCH_SHADER_GLSL, RARCH_SHADER_SLANG, RARCH_SHADER_CG +}; + +enum auto_shader_operation +{ + AUTO_SHADER_OP_SAVE = 0, + AUTO_SHADER_OP_REMOVE, + AUTO_SHADER_OP_EXISTS +}; + struct video_shader *menu_shader_get(void) { if (video_shader_any_supported()) @@ -316,8 +328,7 @@ static bool menu_shader_manager_save_preset_internal( return ret; } -/** Saves or deletes an auto-shader, save = false requires no other parameters */ -static bool menu_shader_manager_operate_auto_preset(bool save, +static bool menu_shader_manager_operate_auto_preset(enum auto_shader_operation op, const struct video_shader *shader, enum auto_shader_type type, bool apply) { char tmp[PATH_MAX_LENGTH]; @@ -379,25 +390,20 @@ static bool menu_shader_manager_operate_auto_preset(bool save, return false; } - if (save) + if (op == AUTO_SHADER_OP_SAVE) { if (!path_is_directory(directory)) path_mkdir(directory); return menu_shader_manager_save_preset_internal(shader, file, apply, true); } - else + else if (op == AUTO_SHADER_OP_REMOVE) { + /* remove all supported auto-shaders of given type */ char *end = file + strlen(file); size_t i; bool success = false; - static enum rarch_shader_type shader_types[] = - { - RARCH_SHADER_GLSL, RARCH_SHADER_SLANG, RARCH_SHADER_CG - }; - - /* remove all supported auto-shaders of given type */ for (i = 0; i < ARRAY_SIZE(shader_types); i++) { const char *preset_ext; @@ -414,6 +420,30 @@ static bool menu_shader_manager_operate_auto_preset(bool save, return success; } + else if (op == AUTO_SHADER_OP_EXISTS) + { + /* test if any supported auto-shaders of given type exists */ + char *end = file + strlen(file); + size_t i; + + for (i = 0; i < ARRAY_SIZE(shader_types); i++) + { + const char *preset_ext; + + if (!video_shader_is_supported(shader_types[i])) + continue; + + preset_ext = video_shader_get_preset_extension(shader_types[i]); + strlcpy(end, preset_ext, sizeof(file) - (end-file)); + + if (path_is_valid(file)) + return true; + } + + return false; + } + + return false; } /** @@ -433,7 +463,7 @@ static bool menu_shader_manager_operate_auto_preset(bool save, bool menu_shader_manager_save_auto_preset(const struct video_shader *shader, enum auto_shader_type type, bool apply) { - return menu_shader_manager_operate_auto_preset(true, shader, type, apply); + return menu_shader_manager_operate_auto_preset(AUTO_SHADER_OP_SAVE, shader, type, apply); } /** @@ -459,7 +489,18 @@ bool menu_shader_manager_save_preset(const struct video_shader *shader, **/ bool menu_shader_manager_remove_auto_preset(enum auto_shader_type type) { - return menu_shader_manager_operate_auto_preset(false, NULL, type, false); + return menu_shader_manager_operate_auto_preset(AUTO_SHADER_OP_REMOVE, NULL, type, false); +} + +/** + * menu_shader_manager_auto_preset_exists: + * @type : type of shader preset + * + * Tests if an auto-shader of the given type exists. + **/ +bool menu_shader_manager_auto_preset_exists(enum auto_shader_type type) +{ + return menu_shader_manager_operate_auto_preset(AUTO_SHADER_OP_EXISTS, NULL, type, false); } int menu_shader_manager_clear_num_passes(struct video_shader *shader) diff --git a/menu/menu_shader.h b/menu/menu_shader.h index 5108e3ee53..615433a351 100644 --- a/menu/menu_shader.h +++ b/menu/menu_shader.h @@ -124,6 +124,8 @@ void menu_shader_manager_clear_pass_path(struct video_shader *shader, **/ bool menu_shader_manager_remove_auto_preset(enum auto_shader_type type); +bool menu_shader_manager_auto_preset_exists(enum auto_shader_type type); + void menu_shader_set_modified(bool modified); RETRO_END_DECLS diff --git a/msg_hash.h b/msg_hash.h index ec67ab3b41..e73ee871ce 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1336,6 +1336,7 @@ enum msg_hash_enums MENU_LABEL(LOAD_CONTENT_LIST), MENU_LABEL(LOAD_CONTENT_SPECIAL), MENU_LABEL(NO_SETTINGS_FOUND), + MENU_LABEL(NO_PRESETS_FOUND), MENU_LABEL(NO_NETWORKS_FOUND), MENU_LABEL(NO_PERFORMANCE_COUNTERS), MENU_LABEL(FRAME_THROTTLE_SETTINGS), @@ -2396,6 +2397,7 @@ enum msg_hash_enums MENU_ENUM_LABEL_VALUE_QT_LOAD, MENU_ENUM_LABEL_VALUE_QT_SAVE, MENU_ENUM_LABEL_VALUE_QT_REMOVE, + MENU_ENUM_LABEL_VALUE_QT_REMOVE_PASSES, MENU_ENUM_LABEL_VALUE_QT_APPLY, MENU_ENUM_LABEL_VALUE_QT_SHADER_ADD_PASS, MENU_ENUM_LABEL_VALUE_QT_SHADER_CLEAR_ALL_PASSES, diff --git a/retroarch.c b/retroarch.c index 91bee7db1e..85afcea502 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2222,10 +2222,12 @@ bool retroarch_apply_shader(enum rarch_shader_type type, const char *preset_path configuration_set_bool(settings, settings->bools.video_shader_enable, true); retroarch_set_runtime_shader_preset(preset_path); +#ifdef HAVE_MENU /* reflect in shader manager */ if (menu_shader_manager_set_preset(menu_shader_get(), type, preset_path, false)) if (!string_is_empty(preset_path)) menu_shader_set_modified(false); +#endif /* Display message */ snprintf(msg, sizeof(msg), diff --git a/ui/drivers/qt/shaderparamsdialog.cpp b/ui/drivers/qt/shaderparamsdialog.cpp index a014b83f60..37c9c31779 100644 --- a/ui/drivers/qt/shaderparamsdialog.cpp +++ b/ui/drivers/qt/shaderparamsdialog.cpp @@ -18,6 +18,7 @@ #include "shaderparamsdialog.h" #include "../ui_qt.h" +#include "../../../menu/menu_entries.h" #ifndef CXX_BUILD extern "C" { @@ -51,11 +52,11 @@ extern "C" { enum { - SHADER_PRESET_SAVE_GLOBAL = 0, - SHADER_PRESET_SAVE_CORE, - SHADER_PRESET_SAVE_PARENT, - SHADER_PRESET_SAVE_GAME, - SHADER_PRESET_SAVE_NORMAL + QT_SHADER_PRESET_GLOBAL = 0, + QT_SHADER_PRESET_CORE, + QT_SHADER_PRESET_PARENT, + QT_SHADER_PRESET_GAME, + QT_SHADER_PRESET_NORMAL }; ShaderPass::ShaderPass(struct video_shader_pass *passToCopy) : @@ -688,76 +689,128 @@ void ShaderParamsDialog::onShaderSavePresetAsClicked() pathArray = path.toUtf8(); pathData = pathArray.constData(); - saveShaderPreset(pathData, SHADER_PRESET_SAVE_NORMAL); + operateShaderPreset(true, pathData, QT_SHADER_PRESET_NORMAL); } -void ShaderParamsDialog::saveShaderPreset(const char *path, unsigned action_type) +/** save or remove shader preset */ +void ShaderParamsDialog::operateShaderPreset(bool save, const char *path, unsigned action_type) { bool ret; enum auto_shader_type preset_type; switch (action_type) { - case SHADER_PRESET_SAVE_GLOBAL: + case QT_SHADER_PRESET_GLOBAL: preset_type = SHADER_PRESET_GLOBAL; break; - case SHADER_PRESET_SAVE_CORE: + case QT_SHADER_PRESET_CORE: + preset_type = SHADER_PRESET_CORE; + break; + case QT_SHADER_PRESET_PARENT: preset_type = SHADER_PRESET_PARENT; break; - case SHADER_PRESET_SAVE_PARENT: - preset_type = SHADER_PRESET_PARENT; - break; - case SHADER_PRESET_SAVE_GAME: + case QT_SHADER_PRESET_GAME: preset_type = SHADER_PRESET_GAME; break; - case SHADER_PRESET_SAVE_NORMAL: + case QT_SHADER_PRESET_NORMAL: break; default: return; } - if (action_type == SHADER_PRESET_SAVE_NORMAL) - ret = menu_shader_manager_save_preset(menu_shader_get(), path, true); - else - ret = menu_shader_manager_save_auto_preset(menu_shader_get(), preset_type, true); + if (save) + { + if (action_type == QT_SHADER_PRESET_NORMAL) + ret = menu_shader_manager_save_preset(menu_shader_get(), path, true); + else + ret = menu_shader_manager_save_auto_preset(menu_shader_get(), preset_type, true); - if (ret) - runloop_msg_queue_push( - msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY), - 1, 100, true, NULL, - MESSAGE_QUEUE_ICON_DEFAULT, - MESSAGE_QUEUE_CATEGORY_INFO - ); + if (ret) + runloop_msg_queue_push( + msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY), + 1, 100, true, NULL, + MESSAGE_QUEUE_ICON_DEFAULT, + MESSAGE_QUEUE_CATEGORY_INFO + ); + else + runloop_msg_queue_push( + msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET), + 1, 100, true, NULL, + MESSAGE_QUEUE_ICON_DEFAULT, + MESSAGE_QUEUE_CATEGORY_ERROR + ); + } else - runloop_msg_queue_push( - msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET), - 1, 100, true, NULL, - MESSAGE_QUEUE_ICON_DEFAULT, - MESSAGE_QUEUE_CATEGORY_ERROR - ); + { + if (action_type != QT_SHADER_PRESET_NORMAL && + menu_shader_manager_remove_auto_preset(preset_type)) + { +#ifdef HAVE_MENU + bool refresh = false; +#endif + + runloop_msg_queue_push( + msg_hash_to_str(MSG_SHADER_PRESET_REMOVED_SUCCESSFULLY), + 1, 100, true, NULL, + MESSAGE_QUEUE_ICON_DEFAULT, + MESSAGE_QUEUE_CATEGORY_INFO + ); + +#ifdef HAVE_MENU + menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); +#endif + } + else + runloop_msg_queue_push( + msg_hash_to_str(MSG_ERROR_REMOVING_SHADER_PRESET), + 1, 100, true, NULL, + MESSAGE_QUEUE_ICON_DEFAULT, + MESSAGE_QUEUE_CATEGORY_ERROR + ); + } } void ShaderParamsDialog::onShaderSaveGlobalPresetClicked() { - saveShaderPreset(NULL, SHADER_PRESET_GLOBAL); + operateShaderPreset(true, NULL, QT_SHADER_PRESET_GLOBAL); } void ShaderParamsDialog::onShaderSaveCorePresetClicked() { - saveShaderPreset(NULL, SHADER_PRESET_CORE); + operateShaderPreset(true, NULL, QT_SHADER_PRESET_CORE); } void ShaderParamsDialog::onShaderSaveParentPresetClicked() { - saveShaderPreset(NULL, SHADER_PRESET_PARENT); + operateShaderPreset(true, NULL, QT_SHADER_PRESET_PARENT); } void ShaderParamsDialog::onShaderSaveGamePresetClicked() { - saveShaderPreset(NULL, SHADER_PRESET_GAME); + operateShaderPreset(true, NULL, QT_SHADER_PRESET_GAME); } -void ShaderParamsDialog::onShaderClearAllPassesClicked() +void ShaderParamsDialog::onShaderRemoveGlobalPresetClicked() +{ + operateShaderPreset(false, NULL, QT_SHADER_PRESET_GLOBAL); +} + +void ShaderParamsDialog::onShaderRemoveCorePresetClicked() +{ + operateShaderPreset(false, NULL, QT_SHADER_PRESET_CORE); +} + +void ShaderParamsDialog::onShaderRemoveParentPresetClicked() +{ + operateShaderPreset(false, NULL, QT_SHADER_PRESET_PARENT); +} + +void ShaderParamsDialog::onShaderRemoveGamePresetClicked() +{ + operateShaderPreset(false, NULL, QT_SHADER_PRESET_GAME); +} + +void ShaderParamsDialog::onShaderRemoveAllPassesClicked() { struct video_shader *menu_shader = NULL; struct video_shader *video_shader = NULL; @@ -776,19 +829,13 @@ void ShaderParamsDialog::onShaderClearAllPassesClicked() void ShaderParamsDialog::onShaderRemovePassClicked() { - int i; QVariant passVariant; QAction *action = qobject_cast(sender()); - struct video_shader *menu_shader = NULL; - struct video_shader *video_shader = NULL; int pass = 0; bool ok = false; - getShaders(&menu_shader, &video_shader); - - if (!menu_shader || menu_shader->passes == 0 || !action) + if (!action) return; - passVariant = action->data(); if (!passVariant.isValid()) @@ -799,6 +846,20 @@ void ShaderParamsDialog::onShaderRemovePassClicked() if (!ok) return; + onShaderRemovePass(pass); +} + +void ShaderParamsDialog::onShaderRemovePass(int pass) +{ + int i; + struct video_shader *menu_shader = NULL; + struct video_shader *video_shader = NULL; + + getShaders(&menu_shader, &video_shader); + + if (!menu_shader || menu_shader->passes == 0) + return; + if (pass < 0 || pass > static_cast(menu_shader->passes)) return; @@ -818,6 +879,18 @@ void ShaderParamsDialog::onShaderApplyClicked() command_event(CMD_EVENT_SHADERS_APPLY_CHANGES, NULL); } +void ShaderParamsDialog::updateRemovePresetButtonsState() +{ + if (removeGlobalPresetAction) + removeGlobalPresetAction->setEnabled(menu_shader_manager_auto_preset_exists(SHADER_PRESET_GLOBAL)); + if (removeCorePresetAction) + removeCorePresetAction->setEnabled(menu_shader_manager_auto_preset_exists(SHADER_PRESET_CORE)); + if (removeParentPresetAction) + removeParentPresetAction->setEnabled(menu_shader_manager_auto_preset_exists(SHADER_PRESET_PARENT)); + if (removeGamePresetAction) + removeGamePresetAction->setEnabled(menu_shader_manager_auto_preset_exists(SHADER_PRESET_GAME)); +} + void ShaderParamsDialog::reload() { buildLayout(); @@ -828,11 +901,13 @@ void ShaderParamsDialog::buildLayout() QPushButton *loadButton = NULL; QPushButton *saveButton = NULL; QPushButton *removeButton = NULL; + QPushButton *removePassButton = NULL; QPushButton *applyButton = NULL; QHBoxLayout *topButtonLayout = NULL; QMenu *loadMenu = NULL; QMenu *saveMenu = NULL; QMenu *removeMenu = NULL; + QMenu *removePassMenu = NULL; struct video_shader *menu_shader = NULL; struct video_shader *video_shader = NULL; struct video_shader *avail_shader = NULL; @@ -905,6 +980,7 @@ void ShaderParamsDialog::buildLayout() loadButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_LOAD), this); saveButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_SAVE), this); removeButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_REMOVE), this); + removePassButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_REMOVE_PASSES), this); applyButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_APPLY), this); loadMenu = new QMenu(loadButton); @@ -923,6 +999,16 @@ void ShaderParamsDialog::buildLayout() saveButton->setMenu(saveMenu); removeMenu = new QMenu(removeButton); + removeGlobalPresetAction = removeMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_GLOBAL), this, SLOT(onShaderRemoveGlobalPresetClicked())); + removeCorePresetAction = removeMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_CORE), this, SLOT(onShaderRemoveCorePresetClicked())); + removeParentPresetAction = removeMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_PARENT), this, SLOT(onShaderRemoveParentPresetClicked())); + removeGamePresetAction = removeMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE_GAME), this, SLOT(onShaderRemoveGamePresetClicked())); + + removeButton->setMenu(removeMenu); + + connect(removeMenu, SIGNAL(aboutToShow()), this, SLOT(updateRemovePresetButtonsState())); + + removePassMenu = new QMenu(removeButton); /* When there are no passes, at least on first startup, it seems video_shader erroneously shows 1 pass, with an empty source file. * So we use menu_shader instead for that. @@ -933,15 +1019,15 @@ void ShaderParamsDialog::buildLayout() { QFileInfo fileInfo(menu_shader->pass[i].source.path); QString shaderBasename = fileInfo.completeBaseName(); - QAction *action = removeMenu->addAction(shaderBasename, this, SLOT(onShaderRemovePassClicked())); + QAction *action = removePassMenu->addAction(shaderBasename, this, SLOT(onShaderRemovePassClicked())); action->setData(i); } } - removeMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_SHADER_CLEAR_ALL_PASSES), this, SLOT(onShaderClearAllPassesClicked())); + removePassMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_SHADER_CLEAR_ALL_PASSES), this, SLOT(onShaderRemoveAllPassesClicked())); - removeButton->setMenu(removeMenu); + removePassButton->setMenu(removePassMenu); connect(applyButton, SIGNAL(clicked()), this, SLOT(onShaderApplyClicked())); @@ -949,6 +1035,7 @@ void ShaderParamsDialog::buildLayout() topButtonLayout->addWidget(loadButton); topButtonLayout->addWidget(saveButton); topButtonLayout->addWidget(removeButton); + topButtonLayout->addWidget(removePassButton); topButtonLayout->addWidget(applyButton); m_layout->addLayout(topButtonLayout); @@ -1337,6 +1424,7 @@ void ShaderParamsDialog::onShaderParamSliderValueChanged(int) if (param) { newValue = MainWindow::lerp(0, 100, param->minimum, param->maximum, slider->value()); + newValue = round(newValue / param->step) * param->step; param->current = newValue; } } @@ -1357,6 +1445,7 @@ void ShaderParamsDialog::onShaderParamSliderValueChanged(int) if (param) { newValue = MainWindow::lerp(0, 100, param->minimum, param->maximum, slider->value()); + newValue = round(newValue / param->step) * param->step; param->current = newValue; } } diff --git a/ui/drivers/qt/shaderparamsdialog.h b/ui/drivers/qt/shaderparamsdialog.h index 49ccdf692a..2357db026e 100644 --- a/ui/drivers/qt/shaderparamsdialog.h +++ b/ui/drivers/qt/shaderparamsdialog.h @@ -54,6 +54,9 @@ private slots: void onShaderPassMoveUpClicked(); void onShaderResetPass(int pass); void onShaderResetAllPasses(); + void onShaderRemovePass(int pass); + void onShaderRemoveAllPassesClicked(); + void onShaderRemovePassClicked(); void onShaderResetParameter(QString parameter); void onShaderLoadPresetClicked(); void onShaderAddPassClicked(); @@ -62,19 +65,26 @@ private slots: void onShaderSaveParentPresetClicked(); void onShaderSaveGamePresetClicked(); void onShaderSaveGlobalPresetClicked(); - void onShaderClearAllPassesClicked(); - void onShaderRemovePassClicked(); + void onShaderRemoveCorePresetClicked(); + void onShaderRemoveParentPresetClicked(); + void onShaderRemoveGamePresetClicked(); + void onShaderRemoveGlobalPresetClicked(); void onShaderApplyClicked(); + void updateRemovePresetButtonsState(); void clearLayout(); void buildLayout(); private: QString getFilterLabel(unsigned filter); void addShaderParam(struct video_shader_parameter *param, QFormLayout *form); void getShaders(struct video_shader **menu_shader, struct video_shader **video_shader); - void saveShaderPreset(const char *path, unsigned action_type); + void operateShaderPreset(bool save, const char *path, unsigned action_type); QPointer m_layout; QPointer m_scrollArea; + QAction *removeGlobalPresetAction; + QAction *removeCorePresetAction; + QAction *removeParentPresetAction; + QAction *removeGamePresetAction; protected: void closeEvent(QCloseEvent *event); void resizeEvent(QResizeEvent *event); From 86410cc3b039b36a1e1aa55ac7e554f7340c06ba Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 16:56:32 +0200 Subject: [PATCH 07/16] (CoreText) Buildfix --- gfx/drivers_font_renderer/coretext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/drivers_font_renderer/coretext.c b/gfx/drivers_font_renderer/coretext.c index c73e5fdc86..69568628a7 100644 --- a/gfx/drivers_font_renderer/coretext.c +++ b/gfx/drivers_font_renderer/coretext.c @@ -264,7 +264,7 @@ static void *font_renderer_ct_init(const char *font_path, float font_size) ct_font_renderer_t *handle = (ct_font_renderer_t*) calloc(1, sizeof(*handle)); - if (!handle || !string_is_valid(font_path)) + if (!handle || !path_is_valid(font_path)) { err = 1; goto error; From f8fb2bf3dcd659f602456c46ea429df1e576817d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 17:22:52 +0200 Subject: [PATCH 08/16] Reset A/V counter when loading/saving a state - will be made configurable through settings --- retroarch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retroarch.c b/retroarch.c index 85afcea502..8fa22ef409 100644 --- a/retroarch.c +++ b/retroarch.c @@ -4388,6 +4388,7 @@ static bool command_event_main_state(unsigned cmd) { case CMD_EVENT_SAVE_STATE: content_save_state(state_path, true, false); + video_driver_monitor_reset(); ret = true; push_msg = false; break; @@ -4402,6 +4403,7 @@ static bool command_event_main_state(unsigned cmd) #ifdef HAVE_NETWORKING netplay_driver_ctl(RARCH_NETPLAY_CTL_LOAD_SAVESTATE, NULL); #endif + video_driver_monitor_reset(); } push_msg = false; break; From 94e2d646bea998b4a3ca2145527fafdf5dfe19dc Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 18:18:24 +0200 Subject: [PATCH 09/16] Add Frame Time Counter settings --- configuration.c | 4 ++ configuration.h | 5 +++ intl/msg_hash_ar.h | 4 ++ intl/msg_hash_chs.h | 4 ++ intl/msg_hash_cht.h | 4 ++ intl/msg_hash_de.h | 4 ++ intl/msg_hash_el.h | 4 ++ intl/msg_hash_eo.h | 4 ++ intl/msg_hash_es.h | 4 ++ intl/msg_hash_fr.h | 4 ++ intl/msg_hash_it.h | 4 ++ intl/msg_hash_ja.h | 4 ++ intl/msg_hash_ko.h | 4 ++ intl/msg_hash_lbl.h | 10 +++++ intl/msg_hash_nl.h | 4 ++ intl/msg_hash_pl.h | 4 ++ intl/msg_hash_pt_br.h | 4 ++ intl/msg_hash_pt_pt.h | 4 ++ intl/msg_hash_ru.h | 4 ++ intl/msg_hash_tr.h | 4 ++ intl/msg_hash_us.h | 16 ++++++++ intl/msg_hash_vn.h | 4 ++ menu/cbs/menu_cbs_deferred_push.c | 9 +++++ menu/cbs/menu_cbs_ok.c | 7 ++++ menu/cbs/menu_cbs_sublabel.c | 16 ++++++++ menu/cbs/menu_cbs_title.c | 6 +++ menu/drivers/materialui.c | 1 + menu/drivers/ozone/ozone_texture.c | 1 + menu/drivers/xmb.c | 1 + menu/menu_cbs.h | 1 + menu/menu_displaylist.c | 20 +++++++++ menu/menu_displaylist.h | 1 + menu/menu_setting.c | 65 ++++++++++++++++++++++++++++++ msg_hash.h | 5 +++ retroarch.c | 20 +++++++-- 35 files changed, 256 insertions(+), 4 deletions(-) diff --git a/configuration.c b/configuration.c index e5686a8ec8..b5bb4572de 100644 --- a/configuration.c +++ b/configuration.c @@ -1325,6 +1325,10 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, struct config_bool_setting *tmp = (struct config_bool_setting*)calloc(1, (*size + 1) * sizeof(struct config_bool_setting)); unsigned count = 0; + SETTING_BOOL("frame_time_counter_reset_after_fastforwarding", &settings->bools.frame_time_counter_reset_after_fastforwarding, true, false, false); + SETTING_BOOL("frame_time_counter_reset_after_load_state", &settings->bools.frame_time_counter_reset_after_load_state, true, false, false); + SETTING_BOOL("frame_time_counter_reset_after_save_state", &settings->bools.frame_time_counter_reset_after_save_state, true, false, false); + SETTING_BOOL("crt_switch_resolution_use_custom_refresh_rate", &settings->bools.crt_switch_custom_refresh_enable, true, false, false); SETTING_BOOL("crt_switch_resolution_use_custom_refresh_rate", &settings->bools.crt_switch_custom_refresh_enable, true, false, false); SETTING_BOOL("automatically_add_content_to_playlist", &settings->bools.automatically_add_content_to_playlist, true, DEFAULT_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST, false); SETTING_BOOL("ui_companion_start_on_boot", &settings->bools.ui_companion_start_on_boot, true, ui_companion_start_on_boot, false); diff --git a/configuration.h b/configuration.h index 8b5473d0c8..44a1a6de64 100644 --- a/configuration.h +++ b/configuration.h @@ -139,6 +139,11 @@ typedef struct settings bool input_small_keyboard_enable; bool input_keyboard_gamepad_enable; + /* Frame time counter */ + bool frame_time_counter_reset_after_fastforwarding; + bool frame_time_counter_reset_after_load_state; + bool frame_time_counter_reset_after_save_state; + /* Menu */ bool filter_by_current_core; bool menu_enable_widgets; diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index 8898c6a917..eef7a41e0f 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -4112,3 +4112,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 85ae24d243..20fb1948db 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -5130,3 +5130,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index ded3a27699..1ff3dae723 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3888,3 +3888,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 895b5f21ed..7b57c0b589 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -4017,3 +4017,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_el.h b/intl/msg_hash_el.h index 82e9618e88..c3b6311e05 100644 --- a/intl/msg_hash_el.h +++ b/intl/msg_hash_el.h @@ -8094,3 +8094,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index bca85d72b0..48b34b4563 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3776,3 +3776,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index 9dfc8eb454..79aad4a559 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -8246,3 +8246,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 35790af4b9..ab23f89d59 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -9034,3 +9034,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 7ae68763a9..933dcc5a97 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3997,3 +3997,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index c17df1477a..f7ad1f1c30 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -9409,3 +9409,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 9a40759ed8..14d307bce9 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -9241,3 +9241,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index f1d04f49bb..74095a08ab 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -265,6 +265,8 @@ MSG_HASH(MENU_ENUM_LABEL_DATABASE_MANAGER, "database_manager") MSG_HASH(MENU_ENUM_LABEL_DATABASE_MANAGER_LIST, "database_manager_list") +MSG_HASH(MENU_ENUM_LABEL_DEFERRED_FRAME_TIME_COUNTER_SETTINGS_LIST, + "deferred_frame_time_counter_settings_list") MSG_HASH(MENU_ENUM_LABEL_DEFERRED_VIDEO_SHADER_PRESET_REMOVE_LIST, "deferred_video_shader_preset_remove_list") MSG_HASH(MENU_ENUM_LABEL_DEFERRED_VIDEO_SHADER_PRESET_SAVE_LIST, @@ -1093,6 +1095,8 @@ MSG_HASH(MENU_ENUM_LABEL_REWIND_BUFFER_SIZE_STEP, "rewind_buffer_size_step") MSG_HASH(MENU_ENUM_LABEL_REWIND_SETTINGS, "rewind_settings") +MSG_HASH(MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS, + "frame_time_counter_settings") MSG_HASH(MENU_ENUM_LABEL_VRR_RUNLOOP_ENABLE, "vrr_runloop_enable") MSG_HASH(MENU_ENUM_LABEL_CHEAT_SETTINGS, @@ -2063,3 +2067,9 @@ MSG_HASH(MENU_ENUM_LABEL_SETTINGS_SHOW_USER, "settings_show_user") MSG_HASH(MENU_ENUM_LABEL_SETTINGS_SHOW_DIRECTORY, "settings_show_directory") +MSG_HASH(MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_FASTFORWARDING, + "frame_time_counter_reset_after_fastforwarding") +MSG_HASH(MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_LOAD_STATE, + "frame_time_counter_reset_after_load_state") +MSG_HASH(MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE, + "frame_time_counter_reset_after_save_state") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index bab5900d73..a7203a51b0 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3770,3 +3770,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index cde0ec5d28..bf116114d7 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -4561,3 +4561,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index d59c010633..412ce27a3c 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -9321,3 +9321,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 386301b74e..47b3e40cf1 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3842,3 +3842,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 5f761ef228..c507b06f88 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -4040,3 +4040,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_tr.h b/intl/msg_hash_tr.h index 66facabd39..18c188309b 100644 --- a/intl/msg_hash_tr.h +++ b/intl/msg_hash_tr.h @@ -9046,3 +9046,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 56ab32ebfb..d136ce9bc7 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -9567,3 +9567,19 @@ MSG_HASH( MSG_HASH( MSG_ERROR_REMOVING_SHADER_PRESET, "Error removing shader preset.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_RESET_AFTER_FASTFORWARDING, + "Reset After Fastforward") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_RESET_AFTER_FASTFORWARDING, + "Reset the frame time counter after fastforwarding.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_RESET_AFTER_LOAD_STATE, + "Reset After Load State") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_RESET_AFTER_LOAD_STATE, + "Reset the frame time counter after loading a state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE, + "Reset After Save State") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE, + "Reset the frame time counter after saving a state.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 8941effdaa..34dd93a057 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3932,3 +3932,7 @@ MSG_HASH( MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_SHADER_PRESET_REMOVE_GAME, "Remove the Game Preset, used only for the specific game in question.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + "Frame Time Counter") +MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, + "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") diff --git a/menu/cbs/menu_cbs_deferred_push.c b/menu/cbs/menu_cbs_deferred_push.c index fab062a660..44e265e21a 100644 --- a/menu/cbs/menu_cbs_deferred_push.c +++ b/menu/cbs/menu_cbs_deferred_push.c @@ -152,6 +152,7 @@ generic_deferred_push(deferred_push_mixer_stream_settings_list, DISPLAYLIST_ generic_deferred_push(deferred_push_logging_settings_list, DISPLAYLIST_LOGGING_SETTINGS_LIST) generic_deferred_push(deferred_push_frame_throttle_settings_list, DISPLAYLIST_FRAME_THROTTLE_SETTINGS_LIST) generic_deferred_push(deferred_push_rewind_settings_list, DISPLAYLIST_REWIND_SETTINGS_LIST) +generic_deferred_push(deferred_push_frame_time_counter_settings_list, DISPLAYLIST_FRAME_TIME_COUNTER_SETTINGS_LIST) generic_deferred_push(deferred_push_cheat_details_settings_list, DISPLAYLIST_CHEAT_DETAILS_SETTINGS_LIST) generic_deferred_push(deferred_push_cheat_search_settings_list, DISPLAYLIST_CHEAT_SEARCH_SETTINGS_LIST) generic_deferred_push(deferred_push_onscreen_display_settings_list, DISPLAYLIST_ONSCREEN_DISPLAY_SETTINGS_LIST) @@ -742,6 +743,11 @@ static int menu_cbs_init_bind_deferred_push_compare_label( BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_frame_throttle_settings_list); return 0; } + else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_FRAME_TIME_COUNTER_SETTINGS_LIST))) + { + BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_frame_time_counter_settings_list); + return 0; + } else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_REWIND_SETTINGS_LIST))) { BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_rewind_settings_list); @@ -1409,6 +1415,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label( case MENU_ENUM_LABEL_DEFERRED_FRAME_THROTTLE_SETTINGS_LIST: BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_frame_throttle_settings_list); break; + case MENU_ENUM_LABEL_DEFERRED_FRAME_TIME_COUNTER_SETTINGS_LIST: + BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_frame_time_counter_settings_list); + break; case MENU_ENUM_LABEL_DEFERRED_REWIND_SETTINGS_LIST: BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_rewind_settings_list); break; diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 8c0244dba8..d6cf3c8e7e 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -206,6 +206,8 @@ static enum msg_hash_enums action_ok_dl_to_enum(unsigned lbl) return MENU_ENUM_LABEL_DEFERRED_LOGGING_SETTINGS_LIST; case ACTION_OK_DL_FRAME_THROTTLE_SETTINGS_LIST: return MENU_ENUM_LABEL_DEFERRED_FRAME_THROTTLE_SETTINGS_LIST; + case ACTION_OK_DL_FRAME_TIME_COUNTER_SETTINGS_LIST: + return MENU_ENUM_LABEL_DEFERRED_FRAME_TIME_COUNTER_SETTINGS_LIST; case ACTION_OK_DL_REWIND_SETTINGS_LIST: return MENU_ENUM_LABEL_DEFERRED_REWIND_SETTINGS_LIST; case ACTION_OK_DL_CHEAT_DETAILS_SETTINGS_LIST: @@ -1003,6 +1005,7 @@ int generic_action_ok_displaylist_push(const char *path, case ACTION_OK_DL_SAVING_SETTINGS_LIST: case ACTION_OK_DL_LOGGING_SETTINGS_LIST: case ACTION_OK_DL_FRAME_THROTTLE_SETTINGS_LIST: + case ACTION_OK_DL_FRAME_TIME_COUNTER_SETTINGS_LIST: case ACTION_OK_DL_REWIND_SETTINGS_LIST: case ACTION_OK_DL_ONSCREEN_DISPLAY_SETTINGS_LIST: case ACTION_OK_DL_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST: @@ -4626,6 +4629,7 @@ default_action_ok_func(action_ok_compressed_archive_push, ACTION_OK_DL_COMPRESSE default_action_ok_func(action_ok_compressed_archive_push_detect_core, ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH_DETECT_CORE) default_action_ok_func(action_ok_logging_list, ACTION_OK_DL_LOGGING_SETTINGS_LIST) default_action_ok_func(action_ok_frame_throttle_list, ACTION_OK_DL_FRAME_THROTTLE_SETTINGS_LIST) +default_action_ok_func(action_ok_frame_time_counter_list, ACTION_OK_DL_FRAME_TIME_COUNTER_SETTINGS_LIST) default_action_ok_func(action_ok_rewind_list, ACTION_OK_DL_REWIND_SETTINGS_LIST) default_action_ok_func(action_ok_cheat, ACTION_OK_DL_CHEAT_DETAILS_SETTINGS_LIST) default_action_ok_func(action_ok_cheat_start_or_cont, ACTION_OK_DL_CHEAT_SEARCH_SETTINGS_LIST) @@ -6547,6 +6551,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_FRAME_THROTTLE_SETTINGS: BIND_ACTION_OK(cbs, action_ok_frame_throttle_list); break; + case MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS: + BIND_ACTION_OK(cbs, action_ok_frame_time_counter_list); + break; case MENU_ENUM_LABEL_REWIND_SETTINGS: BIND_ACTION_OK(cbs, action_ok_rewind_list); break; diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 0481356cd5..81c6615a4d 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -145,6 +145,10 @@ default_sublabel_macro(action_bind_sublabel_network_on_demand_thumbnails, MENU_ default_sublabel_macro(action_bind_sublabel_user_settings_list, MENU_ENUM_SUBLABEL_USER_SETTINGS) default_sublabel_macro(action_bind_sublabel_recording_settings_list, MENU_ENUM_SUBLABEL_RECORDING_SETTINGS) default_sublabel_macro(action_bind_sublabel_frame_throttle_settings_list, MENU_ENUM_SUBLABEL_FRAME_THROTTLE_SETTINGS) +default_sublabel_macro(action_bind_sublabel_frame_time_counter_settings_list, MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS) +default_sublabel_macro(action_bind_sublabel_frame_time_counter_reset_after_fastforwarding, MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_RESET_AFTER_FASTFORWARDING) +default_sublabel_macro(action_bind_sublabel_frame_time_counter_reset_after_load_state, MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_RESET_AFTER_LOAD_STATE) +default_sublabel_macro(action_bind_sublabel_frame_time_counter_reset_after_save_state, MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE) default_sublabel_macro(action_bind_sublabel_onscreen_display_settings_list,MENU_ENUM_SUBLABEL_ONSCREEN_DISPLAY_SETTINGS) default_sublabel_macro(action_bind_sublabel_core_settings_list, MENU_ENUM_SUBLABEL_CORE_SETTINGS) default_sublabel_macro(action_bind_sublabel_information_list_list, MENU_ENUM_SUBLABEL_INFORMATION_LIST_LIST) @@ -1468,6 +1472,15 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_SETTINGS_SHOW_FRAME_THROTTLE: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_settings_show_frame_throttle); break; + case MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_FASTFORWARDING: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_frame_time_counter_reset_after_fastforwarding); + break; + case MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_LOAD_STATE: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_frame_time_counter_reset_after_load_state); + break; + case MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_frame_time_counter_reset_after_save_state); + break; case MENU_ENUM_LABEL_SETTINGS_SHOW_RECORDING: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_settings_show_recording); break; @@ -2691,6 +2704,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_FRAME_THROTTLE_SETTINGS: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_frame_throttle_settings_list); break; + case MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_frame_time_counter_settings_list); + break; case MENU_ENUM_LABEL_ONSCREEN_DISPLAY_SETTINGS: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_onscreen_display_settings_list); break; diff --git a/menu/cbs/menu_cbs_title.c b/menu/cbs/menu_cbs_title.c index c671f27c80..17a70dd16b 100644 --- a/menu/cbs/menu_cbs_title.c +++ b/menu/cbs/menu_cbs_title.c @@ -168,6 +168,7 @@ default_title_macro(action_get_dump_disc_list, MENU_ENUM_LABEL_ default_title_macro(action_get_saving_settings_list, MENU_ENUM_LABEL_VALUE_SAVING_SETTINGS) default_title_macro(action_get_logging_settings_list, MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS) default_title_macro(action_get_frame_throttle_settings_list, MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_SETTINGS) +default_title_macro(action_get_frame_time_counter_settings_list, MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS) default_title_macro(action_get_rewind_settings_list, MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS) default_title_macro(action_get_cheat_details_settings_list, MENU_ENUM_LABEL_VALUE_CHEAT_DETAILS_SETTINGS) default_title_macro(action_get_cheat_search_settings_list, MENU_ENUM_LABEL_VALUE_CHEAT_SEARCH_SETTINGS) @@ -445,6 +446,11 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs, BIND_ACTION_GET_TITLE(cbs, action_get_logging_settings_list); return 0; } + else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_FRAME_TIME_COUNTER_SETTINGS_LIST))) + { + BIND_ACTION_GET_TITLE(cbs, action_get_frame_time_counter_settings_list); + return 0; + } else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_FRAME_THROTTLE_SETTINGS_LIST))) { BIND_ACTION_GET_TITLE(cbs, action_get_frame_throttle_settings_list); diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index d50286d6ae..a9e61b944d 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -2778,6 +2778,7 @@ static void materialui_list_insert(void *userdata, string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ONSCREEN_NOTIFICATIONS_SETTINGS)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ACCOUNTS_LIST)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_REWIND_SETTINGS)) || + string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ACCOUNTS_RETRO_ACHIEVEMENTS)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CORE_UPDATER_LIST)) || string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_THUMBNAILS_UPDATER_LIST)) || diff --git a/menu/drivers/ozone/ozone_texture.c b/menu/drivers/ozone/ozone_texture.c index fc3dc7a5f3..e8f47c189e 100644 --- a/menu/drivers/ozone/ozone_texture.c +++ b/menu/drivers/ozone/ozone_texture.c @@ -278,6 +278,7 @@ menu_texture_item ozone_entries_icon_get_texture(ozone_handle_t *ozone, case MENU_ENUM_LABEL_RESTART_RETROARCH: case MENU_ENUM_LABEL_VRR_RUNLOOP_ENABLE: case MENU_ENUM_LABEL_AUTOSAVE_INTERVAL: + case MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS: return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_RELOAD]; case MENU_ENUM_LABEL_SHUTDOWN: return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_SHUTDOWN]; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 87a14b5d8d..2b858e78c1 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -2366,6 +2366,7 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, case MENU_ENUM_LABEL_RESTART_RETROARCH: case MENU_ENUM_LABEL_VRR_RUNLOOP_ENABLE: case MENU_ENUM_LABEL_AUTOSAVE_INTERVAL: + case MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS: return xmb->textures.list[XMB_TEXTURE_RELOAD]; case MENU_ENUM_LABEL_RENAME_ENTRY: return xmb->textures.list[XMB_TEXTURE_RENAME]; diff --git a/menu/menu_cbs.h b/menu/menu_cbs.h index 92b36da4c3..31ab3ef2f7 100644 --- a/menu/menu_cbs.h +++ b/menu/menu_cbs.h @@ -87,6 +87,7 @@ enum ACTION_OK_DL_SAVING_SETTINGS_LIST, ACTION_OK_DL_LOGGING_SETTINGS_LIST, ACTION_OK_DL_FRAME_THROTTLE_SETTINGS_LIST, + ACTION_OK_DL_FRAME_TIME_COUNTER_SETTINGS_LIST, ACTION_OK_DL_REWIND_SETTINGS_LIST, ACTION_OK_DL_CHEAT_DETAILS_SETTINGS_LIST, ACTION_OK_DL_CHEAT_SEARCH_SETTINGS_LIST, diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index f4bdef47f9..0be1cce8f1 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5375,6 +5375,24 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct } } break; + case DISPLAYLIST_FRAME_TIME_COUNTER_SETTINGS_LIST: + { + menu_displaylist_build_info_selective_t build_list[] = { + {MENU_ENUM_LABEL_VIDEO_REFRESH_RATE_AUTO, PARSE_ONLY_FLOAT, true}, + {MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_FASTFORWARDING, PARSE_ONLY_BOOL, true}, + {MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_LOAD_STATE, PARSE_ONLY_BOOL, true}, + {MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE, PARSE_ONLY_BOOL, true}, + }; + + for (i = 0; i < ARRAY_SIZE(build_list); i++) + { + if (menu_displaylist_parse_settings_enum(list, + build_list[i].enum_idx, build_list[i].parse_type, + false) == 0) + count++; + } + } + break; case DISPLAYLIST_REWIND_SETTINGS_LIST: { menu_displaylist_build_info_t build_list[] = { @@ -5397,6 +5415,7 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct { menu_displaylist_build_info_t build_list[] = { {MENU_ENUM_LABEL_REWIND_SETTINGS, PARSE_ACTION }, + {MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS, PARSE_ACTION}, {MENU_ENUM_LABEL_FASTFORWARD_RATIO, PARSE_ONLY_FLOAT}, {MENU_ENUM_LABEL_SLOWMOTION_RATIO, PARSE_ONLY_FLOAT}, {MENU_ENUM_LABEL_VRR_RUNLOOP_ENABLE, PARSE_ONLY_BOOL }, @@ -7204,6 +7223,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, case DISPLAYLIST_MENU_SETTINGS_LIST: case DISPLAYLIST_ADD_CONTENT_LIST: case DISPLAYLIST_INPUT_SETTINGS_LIST: + case DISPLAYLIST_FRAME_TIME_COUNTER_SETTINGS_LIST: menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list); count = menu_displaylist_build_list(info->list, type); diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h index 8ee8e381ba..b86f9d87cf 100644 --- a/menu/menu_displaylist.h +++ b/menu/menu_displaylist.h @@ -139,6 +139,7 @@ enum menu_displaylist_ctl_state DISPLAYLIST_SAVING_SETTINGS_LIST, DISPLAYLIST_LOGGING_SETTINGS_LIST, DISPLAYLIST_FRAME_THROTTLE_SETTINGS_LIST, + DISPLAYLIST_FRAME_TIME_COUNTER_SETTINGS_LIST, DISPLAYLIST_REWIND_SETTINGS_LIST, DISPLAYLIST_CHEAT_DETAILS_SETTINGS_LIST, DISPLAYLIST_CHEAT_SEARCH_SETTINGS_LIST, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 965e9c7b60..d4c25a6591 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -132,6 +132,7 @@ enum settings_list_type SETTINGS_LIST_INPUT_HOTKEY, SETTINGS_LIST_RECORDING, SETTINGS_LIST_FRAME_THROTTLING, + SETTINGS_LIST_FRAME_TIME_COUNTER, SETTINGS_LIST_FONT, SETTINGS_LIST_OVERLAY, #ifdef HAVE_VIDEO_LAYOUT @@ -7297,6 +7298,14 @@ static bool setting_append_list( &group_info, &subgroup_info, parent_group); + + CONFIG_ACTION( + list, list_info, + MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS, + MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, + &group_info, + &subgroup_info, + parent_group); SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_LAKKA_ADVANCED); CONFIG_ACTION( @@ -8093,6 +8102,61 @@ static bool setting_append_list( END_GROUP(list, list_info, parent_group); } + break; + case SETTINGS_LIST_FRAME_TIME_COUNTER: + START_GROUP(list, list_info, &group_info, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS), parent_group); + + parent_group = msg_hash_to_str(MENU_ENUM_LABEL_FRAME_TIME_COUNTER_SETTINGS); + + START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info, parent_group); + + CONFIG_BOOL( + list, list_info, + &settings->bools.frame_time_counter_reset_after_fastforwarding, + MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_FASTFORWARDING, + MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_RESET_AFTER_FASTFORWARDING, + true, + 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); + + CONFIG_BOOL( + list, list_info, + &settings->bools.frame_time_counter_reset_after_load_state, + MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_LOAD_STATE, + MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_RESET_AFTER_LOAD_STATE, + true, + 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); + + CONFIG_BOOL( + list, list_info, + &settings->bools.frame_time_counter_reset_after_save_state, + MENU_ENUM_LABEL_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE, + MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE, + true, + 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); + END_GROUP(list, list_info, parent_group); break; case SETTINGS_LIST_REWIND: START_GROUP(list, list_info, &group_info, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS), parent_group); @@ -15837,6 +15901,7 @@ static rarch_setting_t *menu_setting_new_internal(rarch_setting_info_t *list_inf SETTINGS_LIST_INPUT_HOTKEY, SETTINGS_LIST_RECORDING, SETTINGS_LIST_FRAME_THROTTLING, + SETTINGS_LIST_FRAME_TIME_COUNTER, SETTINGS_LIST_FONT, SETTINGS_LIST_OVERLAY, #ifdef HAVE_VIDEO_LAYOUT diff --git a/msg_hash.h b/msg_hash.h index e73ee871ce..3ae7fdcff0 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1245,6 +1245,7 @@ enum msg_hash_enums MENU_ENUM_LABEL_DEFERRED_SAVING_SETTINGS_LIST, MENU_ENUM_LABEL_DEFERRED_FRAME_THROTTLE_SETTINGS_LIST, MENU_ENUM_LABEL_DEFERRED_REWIND_SETTINGS_LIST, + MENU_ENUM_LABEL_DEFERRED_FRAME_TIME_COUNTER_SETTINGS_LIST, MENU_ENUM_LABEL_DEFERRED_AI_SERVICE_SETTINGS_LIST, MENU_ENUM_LABEL_DEFERRED_CHEAT_DETAILS_SETTINGS_LIST, MENU_ENUM_LABEL_DEFERRED_CHEAT_SEARCH_SETTINGS_LIST, @@ -1867,6 +1868,10 @@ enum msg_hash_enums MENU_LABEL(RECORDING_SETTINGS), MENU_LABEL(OVERLAY_SETTINGS), MENU_LABEL(REWIND_SETTINGS), + MENU_LABEL(FRAME_TIME_COUNTER_SETTINGS), + MENU_LABEL(FRAME_TIME_COUNTER_RESET_AFTER_FASTFORWARDING), + MENU_LABEL(FRAME_TIME_COUNTER_RESET_AFTER_LOAD_STATE), + MENU_LABEL(FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE), MENU_LABEL(CHEAT_SETTINGS), MENU_LABEL(CHEAT_DETAILS_SETTINGS), MENU_LABEL(CHEAT_SEARCH_SETTINGS), diff --git a/retroarch.c b/retroarch.c index 8fa22ef409..44aad87795 100644 --- a/retroarch.c +++ b/retroarch.c @@ -4388,7 +4388,11 @@ static bool command_event_main_state(unsigned cmd) { case CMD_EVENT_SAVE_STATE: content_save_state(state_path, true, false); - video_driver_monitor_reset(); + { + settings_t *settings = configuration_settings; + if (settings->bools.frame_time_counter_reset_after_save_state) + video_driver_frame_time_count = 0; + } ret = true; push_msg = false; break; @@ -4403,7 +4407,11 @@ static bool command_event_main_state(unsigned cmd) #ifdef HAVE_NETWORKING netplay_driver_ctl(RARCH_NETPLAY_CTL_LOAD_SAVESTATE, NULL); #endif - video_driver_monitor_reset(); + { + settings_t *settings = configuration_settings; + if (settings->bools.frame_time_counter_reset_after_load_state) + video_driver_frame_time_count = 0; + } } push_msg = false; break; @@ -20482,7 +20490,7 @@ static void drivers_init(int flags) struct retro_hw_render_callback *hwr = video_driver_get_hw_context_internal(); - video_driver_monitor_reset(); + video_driver_frame_time_count = 0; video_driver_lock_new(); video_driver_filter_free(); @@ -23970,7 +23978,11 @@ static void update_fastforwarding_state(void) if (menu_widgets_inited) { menu_widgets_fast_forward = false; - video_driver_monitor_reset(); + { + settings_t *settings = configuration_settings; + if (settings->bools.frame_time_counter_reset_after_fastforwarding) + video_driver_frame_time_count = 0; + } } } #endif From 215f8f783846bbe2023309d0e60d1a0a72a39e09 Mon Sep 17 00:00:00 2001 From: LazyBumHorse Date: Sat, 24 Aug 2019 18:33:05 +0200 Subject: [PATCH 10/16] disable get_default_shader_dir() for now --- menu/cbs/menu_cbs_ok.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 8c0244dba8..72822691a2 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -316,6 +316,8 @@ static const char *get_default_shader_dir(void) { settings_t *settings = config_get_ptr(); const char *def_shader_dir = settings->paths.directory_video_shader; + return def_shader_dir; +#if 0 bool slang_supported = video_shader_is_supported(RARCH_SHADER_SLANG); bool glsl_supported = video_shader_is_supported(RARCH_SHADER_GLSL); bool cg_supported = video_shader_is_supported(RARCH_SHADER_CG); @@ -352,6 +354,7 @@ static const char *get_default_shader_dir(void) } return def_shader_dir; +#endif } #endif From 4f5f32f5aa5bb919b9f3c7057a1c5126ec3deb33 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 18:37:57 +0200 Subject: [PATCH 11/16] Add sublabel for menu widgets --- intl/msg_hash_ar.h | 2 ++ intl/msg_hash_chs.h | 2 ++ intl/msg_hash_cht.h | 2 ++ intl/msg_hash_de.h | 2 ++ intl/msg_hash_el.h | 2 ++ intl/msg_hash_eo.h | 2 ++ intl/msg_hash_es.h | 2 ++ intl/msg_hash_fr.h | 2 ++ intl/msg_hash_it.h | 2 ++ intl/msg_hash_ja.h | 2 ++ intl/msg_hash_ko.h | 2 ++ intl/msg_hash_nl.h | 2 ++ intl/msg_hash_pl.h | 2 ++ intl/msg_hash_pt_br.h | 2 ++ intl/msg_hash_pt_pt.h | 2 ++ intl/msg_hash_ru.h | 2 ++ intl/msg_hash_tr.h | 2 ++ intl/msg_hash_us.h | 2 ++ intl/msg_hash_vn.h | 2 ++ menu/cbs/menu_cbs_sublabel.c | 4 ++++ 20 files changed, 42 insertions(+) diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index eef7a41e0f..e303497e2c 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -4116,3 +4116,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 20fb1948db..126ee99bdd 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -5134,3 +5134,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 1ff3dae723..bbf27ff32d 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3892,3 +3892,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 7b57c0b589..1a21f5b29f 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -4021,3 +4021,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_el.h b/intl/msg_hash_el.h index c3b6311e05..72ed2cfe0f 100644 --- a/intl/msg_hash_el.h +++ b/intl/msg_hash_el.h @@ -8098,3 +8098,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 48b34b4563..8cb5caefb0 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3780,3 +3780,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index 79aad4a559..c5ca918e2a 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -8250,3 +8250,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index ab23f89d59..6d1f044e15 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -9038,3 +9038,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 933dcc5a97..9585775e71 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -4001,3 +4001,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index f7ad1f1c30..d90abf9c25 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -9413,3 +9413,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 14d307bce9..91d4e38a25 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -9245,3 +9245,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index a7203a51b0..b5e3f66148 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3774,3 +3774,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index bf116114d7..d3c52d5482 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -4565,3 +4565,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index 412ce27a3c..a99b5fb54c 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -9325,3 +9325,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 47b3e40cf1..6343264d37 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3846,3 +3846,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index c507b06f88..8c8ee89e52 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -4044,3 +4044,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_tr.h b/intl/msg_hash_tr.h index 18c188309b..c0308fad28 100644 --- a/intl/msg_hash_tr.h +++ b/intl/msg_hash_tr.h @@ -9050,3 +9050,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index d136ce9bc7..c41b4326ef 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -9583,3 +9583,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE, "Reset After Save State") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE, "Reset the frame time counter after saving a state.") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 34dd93a057..e2641541eb 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3936,3 +3936,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_TIME_COUNTER_SETTINGS, "Frame Time Counter") MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_SETTINGS, "Adjust settings influencing the frame time counter (only active when threaded video is disabled).") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, + "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 81c6615a4d..d5a1385901 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -269,6 +269,7 @@ default_sublabel_macro(action_bind_sublabel_network_information, MENU_ default_sublabel_macro(action_bind_sublabel_system_information, MENU_ENUM_SUBLABEL_SYSTEM_INFORMATION) default_sublabel_macro(action_bind_sublabel_quit_retroarch, MENU_ENUM_SUBLABEL_QUIT_RETROARCH) default_sublabel_macro(action_bind_sublabel_restart_retroarch, MENU_ENUM_SUBLABEL_RESTART_RETROARCH) +default_sublabel_macro(action_bind_sublabel_menu_widgets, MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE) default_sublabel_macro(action_bind_sublabel_video_window_width, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_WIDTH) default_sublabel_macro(action_bind_sublabel_video_window_height, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_HEIGHT) default_sublabel_macro(action_bind_sublabel_video_fullscreen_x, MENU_ENUM_SUBLABEL_VIDEO_FULLSCREEN_X) @@ -2297,6 +2298,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_QUIT_RETROARCH: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quit_retroarch); break; + case MENU_ENUM_LABEL_MENU_WIDGETS_ENABLE: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_widgets); + break; case MENU_ENUM_LABEL_RESTART_RETROARCH: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_restart_retroarch); break; From f80d77c06cc4d9a688909795f439bf50c489d7bc Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 18:47:25 +0200 Subject: [PATCH 12/16] Add sublabels for XMB menu animations --- intl/msg_hash_us.h | 6 ++++++ menu/cbs/menu_cbs_sublabel.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index c41b4326ef..14ef4ea7ba 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -9585,3 +9585,9 @@ MSG_HASH(MENU_ENUM_SUBLABEL_FRAME_TIME_COUNTER_RESET_AFTER_SAVE_STATE, "Reset the frame time counter after saving a state.") MSG_HASH(MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE, "Use modern decorated animations, notifications, indicators and controls instead of the old text only system.") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_XMB_ANIMATION_HORIZONTAL_HIGHLIGHT, + "The animation that triggers when scrolling between tabs.") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_XMB_ANIMATION_MOVE_UP_DOWN, + "The animation that triggers when moving up or down.") +MSG_HASH(MENU_ENUM_SUBLABEL_MENU_XMB_ANIMATION_OPENING_MAIN_MENU, + "The animation that triggers when opening a submenu.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index d5a1385901..62952c3986 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -481,6 +481,9 @@ default_sublabel_macro(action_bind_sublabel_menu_use_preferred_system_color_them default_sublabel_macro(action_bind_sublabel_menu_wallpaper_opacity, MENU_ENUM_SUBLABEL_MENU_WALLPAPER_OPACITY) default_sublabel_macro(action_bind_sublabel_menu_framebuffer_opacity, MENU_ENUM_SUBLABEL_MENU_FRAMEBUFFER_OPACITY) default_sublabel_macro(action_bind_sublabel_menu_horizontal_animation, MENU_ENUM_SUBLABEL_MENU_HORIZONTAL_ANIMATION) +default_sublabel_macro(action_bind_sublabel_menu_xmb_animation_horizontal_higlight, MENU_ENUM_SUBLABEL_MENU_XMB_ANIMATION_HORIZONTAL_HIGHLIGHT) +default_sublabel_macro(action_bind_sublabel_menu_xmb_animation_move_up_down, MENU_ENUM_SUBLABEL_MENU_XMB_ANIMATION_MOVE_UP_DOWN) +default_sublabel_macro(action_bind_sublabel_menu_xmb_animation_opening_main_menu, MENU_ENUM_SUBLABEL_MENU_XMB_ANIMATION_OPENING_MAIN_MENU) default_sublabel_macro(action_bind_sublabel_menu_ribbon_enable, MENU_ENUM_SUBLABEL_XMB_RIBBON_ENABLE) default_sublabel_macro(action_bind_sublabel_menu_font, MENU_ENUM_SUBLABEL_XMB_FONT) default_sublabel_macro(action_bind_sublabel_settings_show_drivers, MENU_ENUM_SUBLABEL_SETTINGS_SHOW_DRIVERS) @@ -1669,6 +1672,15 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_MENU_HORIZONTAL_ANIMATION: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_horizontal_animation); break; + case MENU_ENUM_LABEL_MENU_XMB_ANIMATION_HORIZONTAL_HIGHLIGHT: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_xmb_animation_horizontal_higlight); + break; + case MENU_ENUM_LABEL_MENU_XMB_ANIMATION_MOVE_UP_DOWN: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_xmb_animation_move_up_down); + break; + case MENU_ENUM_LABEL_MENU_XMB_ANIMATION_OPENING_MAIN_MENU: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_xmb_animation_opening_main_menu); + break; case MENU_ENUM_LABEL_MENU_WALLPAPER_OPACITY: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_wallpaper_opacity); break; From 42f2d0ffa487be615bbf85f99970fa23f4a9481b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 19:25:03 +0200 Subject: [PATCH 13/16] Add private environment callback - only used by Flycast (RetroArch-specific, for threaded rendering) --- retroarch.c | 73 ++++++++++++++++++++++++++++++++++++++++------------- retroarch.h | 14 ++++++++++ 2 files changed, 70 insertions(+), 17 deletions(-) diff --git a/retroarch.c b/retroarch.c index 44aad87795..a9ea9fdd7f 100644 --- a/retroarch.c +++ b/retroarch.c @@ -824,6 +824,16 @@ static settings_t *configuration_settings = NULL; static enum rarch_core_type current_core_type = CORE_TYPE_PLAIN; static enum rarch_core_type explicit_current_core_type = CORE_TYPE_PLAIN; +/* + * Override poll type behavior, is set by the core. + * + * 0 - Don't Care + * 1 - Early + * 2 - Normal + * 3 - Late + */ +static unsigned core_poll_type_override = 0; + static bool has_set_username = false; #ifdef HAVE_THREAD_STORAGE @@ -7736,15 +7746,6 @@ static bool rarch_environment_cb(unsigned cmd, void *data) break; } - case RETRO_ENVIRONMENT_SET_SAVE_STATE_IN_BACKGROUND: - { - bool state = *(const bool*)data; - RARCH_LOG("Environ SET_SAVE_STATE_IN_BACKGROUND: %s.\n", state ? "yes" : "no"); - - set_save_state_in_background(state); - - break; - } case RETRO_ENVIRONMENT_GET_LIBRETRO_PATH: { @@ -8294,10 +8295,6 @@ static bool rarch_environment_cb(unsigned cmd, void *data) *(bool *)data = runloop_fastmotion; break; - case RETRO_ENVIRONMENT_GET_CLEAR_ALL_THREAD_WAITS_CB: - *(retro_environment_t *)data = rarch_clear_all_thread_waits; - break; - case RETRO_ENVIRONMENT_GET_INPUT_BITMASKS: /* Just falldown, the function will return true */ break; @@ -8321,6 +8318,35 @@ static bool rarch_environment_cb(unsigned cmd, void *data) break; } + /* Private environment callbacks. + * + * Should all be properly addressed in version 2. + * */ + + case RETRO_ENVIRONMENT_POLL_TYPE_OVERRIDE: + { + const unsigned *poll_type_data = (const unsigned*)data; + + if (poll_type_data) + core_poll_type_override = *poll_type_data; + } + break; + + case RETRO_ENVIRONMENT_GET_CLEAR_ALL_THREAD_WAITS_CB: + *(retro_environment_t *)data = rarch_clear_all_thread_waits; + break; + + case RETRO_ENVIRONMENT_SET_SAVE_STATE_IN_BACKGROUND: + { + bool state = *(const bool*)data; + RARCH_LOG("Environ SET_SAVE_STATE_IN_BACKGROUND: %s.\n", state ? "yes" : "no"); + + set_save_state_in_background(state); + + } + break; + + default: RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd); return false; @@ -8776,6 +8802,8 @@ static void secondary_core_destroy(void) /* unload game from core */ if (secondary_core.retro_unload_game) secondary_core.retro_unload_game(); + core_poll_type_override = 0; + /* deinit */ if (secondary_core.retro_deinit) secondary_core.retro_deinit(); @@ -21098,6 +21126,7 @@ static void unload_hook(void) secondary_core_destroy(); if (current_core.retro_unload_game) current_core.retro_unload_game(); + core_poll_type_override = 0; } static void runahead_deinit_hook(void) @@ -26026,14 +26055,20 @@ static int16_t core_input_state_poll_late(unsigned port, static retro_input_state_t core_input_state_poll_return_cb(void) { - if (current_core.poll_type == POLL_TYPE_LATE) + unsigned new_poll_type = (core_poll_type_override > 0) + ? (core_poll_type_override - 1) + : current_core.poll_type; + if (new_poll_type == POLL_TYPE_LATE) return core_input_state_poll_late; return core_input_state_poll; } static void core_input_state_poll_maybe(void) { - if (current_core.poll_type == POLL_TYPE_NORMAL) + unsigned new_poll_type = (core_poll_type_override > 0) + ? (core_poll_type_override - 1) + : current_core.poll_type; + if (new_poll_type == POLL_TYPE_NORMAL) input_driver_poll(); } @@ -26273,6 +26308,7 @@ static bool core_unload_game(void) if (current_core.game_loaded) { current_core.retro_unload_game(); + core_poll_type_override = 0; current_core.game_loaded = false; } @@ -26283,8 +26319,11 @@ static bool core_unload_game(void) bool core_run(void) { - bool early_polling = current_core.poll_type == POLL_TYPE_EARLY; - bool late_polling = current_core.poll_type == POLL_TYPE_LATE; + unsigned new_poll_type = (core_poll_type_override != 0) + ? (core_poll_type_override - 1) + : current_core.poll_type; + bool early_polling = new_poll_type == POLL_TYPE_EARLY; + bool late_polling = new_poll_type == POLL_TYPE_LATE; #ifdef HAVE_NETWORKING bool netplay_preframe = netplay_driver_ctl( RARCH_NETPLAY_CTL_PRE_FRAME, NULL); diff --git a/retroarch.h b/retroarch.h index 6ae49dc696..c239b9d806 100644 --- a/retroarch.h +++ b/retroarch.h @@ -64,6 +64,20 @@ RETRO_BEGIN_DECLS * between the core and the frontend to gracefully stop all threads. */ +#define RETRO_ENVIRONMENT_POLL_TYPE_OVERRIDE (4 | RETRO_ENVIRONMENT_RETROARCH_START_BLOCK) + /* unsigned * -- + * Tells the frontend to override the poll type behavior. + * Allows the frontend to influence the polling behavior of the + * frontend. + * + * Will be unset when retro_unload_game is called. + * + * 0 - Don't Care, no changes, frontend still determines polling type behavior. + * 1 - Early + * 2 - Normal + * 3 - Late + */ + enum rarch_ctl_state { RARCH_CTL_NONE = 0, From fd0232ba7104137256f03d7dc5b85d1ad7ed01ec Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 19:40:24 +0200 Subject: [PATCH 14/16] Add titles for shader preset save/remove --- menu/cbs/menu_cbs_title.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/menu/cbs/menu_cbs_title.c b/menu/cbs/menu_cbs_title.c index 17a70dd16b..72476f8f2b 100644 --- a/menu/cbs/menu_cbs_title.c +++ b/menu/cbs/menu_cbs_title.c @@ -270,6 +270,8 @@ default_title_copy_macro(action_get_title_cheevos_list, MENU_ENUM_LABE default_title_copy_macro(action_get_title_video_shader_parameters,MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PARAMETERS) default_title_copy_macro(action_get_title_video_shader_preset_parameters,MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_PARAMETERS) default_title_copy_macro(action_get_title_video_shader_preset_save,MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_SAVE) +default_title_copy_macro(action_get_title_video_shader_preset_remove,MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_REMOVE) +default_title_copy_macro(action_get_title_video_shader_preset_save_list,MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_SAVE) #if defined(HAVE_LAKKA_SWITCH) || defined(HAVE_LIBNX) default_title_macro(action_get_title_switch_cpu_profile, MENU_ENUM_LABEL_VALUE_SWITCH_CPU_PROFILE) @@ -1402,6 +1404,18 @@ int menu_cbs_init_bind_title(menu_file_list_cbs_t *cbs, return 0; } #endif + if (string_is_equal(label, + msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_SHADER_PRESET_SAVE_LIST))) + { + BIND_ACTION_GET_TITLE(cbs, action_get_title_video_shader_preset_save_list); + return 0; + } + if (string_is_equal(label, + msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_SHADER_PRESET_REMOVE_LIST))) + { + BIND_ACTION_GET_TITLE(cbs, action_get_title_video_shader_preset_remove); + return 0; + } if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST))) { From 8780541de9f9150ef93bbec43428906d9d5bfe30 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 20:03:09 +0200 Subject: [PATCH 15/16] (Win32) Add deferred menu context reset - menu should properly rescale now when we do a Win32 window resize --- gfx/common/win32_common.c | 7 ++++++- retroarch.c | 18 ++++++++++++++++-- retroarch.h | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index f370950553..05d7f539f4 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -1133,7 +1133,8 @@ void win32_check_window(bool *quit, bool *resize, unsigned *width, unsigned *height) { #if !defined(_XBOX) - if (video_driver_is_threaded()) + bool video_is_threaded = video_driver_is_threaded(); + if (video_is_threaded) ui_companion_win32.application->process_events(); *quit = g_win32_quit; @@ -1143,6 +1144,10 @@ void win32_check_window(bool *quit, bool *resize, *width = g_win32_resize_width; *height = g_win32_resize_height; g_win32_resized = false; + +#ifdef HAVE_MENU + rarch_ctl(RARCH_CTL_SET_DEFERRED_MENU_CONTEXT_RESET, NULL); +#endif } #endif } diff --git a/retroarch.c b/retroarch.c index a9ea9fdd7f..72a5a09307 100644 --- a/retroarch.c +++ b/retroarch.c @@ -849,6 +849,9 @@ static retro_keyboard_event_t runloop_key_event = NULL; static retro_keyboard_event_t runloop_frontend_key_event = NULL; static core_option_manager_t *runloop_core_options = NULL; static msg_queue_t *runloop_msg_queue = NULL; +#ifdef HAVE_MENU +static bool runloop_set_deferred_menu_context_reset = false; +#endif static unsigned runloop_pending_windowed_scale = 0; static unsigned runloop_max_frames = 0; @@ -20591,9 +20594,7 @@ static void drivers_init(int flags) && video_driver_has_widgets()) { if (!menu_widgets_inited) - { menu_widgets_inited = menu_widgets_init(video_is_threaded); - } if (menu_widgets_inited) menu_widgets_context_reset(video_is_threaded, @@ -22991,6 +22992,11 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) { switch(state) { + case RARCH_CTL_SET_DEFERRED_MENU_CONTEXT_RESET: +#ifdef HAVE_MENU + runloop_set_deferred_menu_context_reset = true; +#endif + break; case RARCH_CTL_CORE_IS_RUNNING: return runloop_core_running; case RARCH_CTL_BSV_MOVIE_IS_INITED: @@ -24324,6 +24330,14 @@ static enum runloop_state runloop_check_state(void) if (menu_data) { + if (runloop_set_deferred_menu_context_reset) + { + if (menu_data->driver_ctx && menu_data->driver_ctx->context_reset) + menu_data->driver_ctx->context_reset(menu_data->userdata, video_driver_is_threaded_internal()); + video_driver_frame_count = 0; + runloop_set_deferred_menu_context_reset = false; + } + if (BIT64_GET(menu_data->state, MENU_STATE_RENDER_FRAMEBUFFER) != BIT64_GET(menu_data->state, MENU_STATE_RENDER_MESSAGEBOX)) BIT64_SET(menu_data->state, MENU_STATE_RENDER_FRAMEBUFFER); diff --git a/retroarch.h b/retroarch.h index c239b9d806..39b42f5db8 100644 --- a/retroarch.h +++ b/retroarch.h @@ -175,6 +175,7 @@ enum rarch_ctl_state RARCH_CTL_CORE_OPTIONS_DEINIT, RARCH_CTL_CORE_OPTIONS_DISPLAY, RARCH_CTL_CORE_IS_RUNNING, + RARCH_CTL_SET_DEFERRED_MENU_CONTEXT_RESET, /* BSV Movie */ RARCH_CTL_BSV_MOVIE_IS_INITED From aa95b721dd847386688f88ec97df779d83fa7b0c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 24 Aug 2019 20:13:33 +0200 Subject: [PATCH 16/16] Reset frame time counter after doing menu context reset --- menu/drivers/materialui.c | 1 + menu/drivers/ozone/ozone.c | 1 + menu/drivers/rgui.c | 1 + menu/drivers/stripes.c | 1 + menu/drivers/xmb.c | 1 + 5 files changed, 5 insertions(+) diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index a9e61b944d..47c8d43667 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -1949,6 +1949,7 @@ static void materialui_context_reset(void *data, bool is_threaded) task_push_image_load(settings->paths.path_menu_wallpaper, video_driver_supports_rgba(), 0, menu_display_handle_wallpaper_upload, NULL); + video_driver_monitor_reset(); } static int materialui_environ(enum menu_environ_cb type, void *data, void *userdata) diff --git a/menu/drivers/ozone/ozone.c b/menu/drivers/ozone/ozone.c index 92e0dcd378..5a77b67051 100644 --- a/menu/drivers/ozone/ozone.c +++ b/menu/drivers/ozone/ozone.c @@ -673,6 +673,7 @@ static void ozone_context_reset(void *data, bool is_threaded) ozone_restart_cursor_animation(ozone); } + video_driver_monitor_reset(); } static void ozone_collapse_end(void *userdata) diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 36a5ae5289..a1c47e116c 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -4959,6 +4959,7 @@ static void rgui_context_reset(void *data, bool is_threaded) if (rgui->widgets_supported) menu_display_allocate_white_texture(); + video_driver_monitor_reset(); } static void rgui_context_destroy(void *data) diff --git a/menu/drivers/stripes.c b/menu/drivers/stripes.c index 91f4215e76..883699a2ce 100644 --- a/menu/drivers/stripes.c +++ b/menu/drivers/stripes.c @@ -3734,6 +3734,7 @@ static void stripes_context_reset(void *data, bool is_threaded) free(iconpath); } + video_driver_monitor_reset(); } static void stripes_navigation_clear(void *data, bool pending_push) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 2b858e78c1..ed90246758 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -5272,6 +5272,7 @@ static void xmb_context_reset(void *data, bool is_threaded) if (xmb) xmb_context_reset_internal(xmb, is_threaded, true); + video_driver_monitor_reset(); } static void xmb_navigation_clear(void *data, bool pending_push)