Append Preset (#14737) (#14757)

WIP version of Append and Prepend preset, Includes UI for Standard Retroarch, but not the QT UI companion

Co-authored-by: HyperspaceMadness <remimcgill@hotmail.com>
This commit is contained in:
LibretroAdmin 2022-12-22 21:36:32 +01:00 committed by GitHub
parent 05c3c0a552
commit f836328c56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 642 additions and 109 deletions

View file

@ -120,6 +120,40 @@ static int action_start_shader_preset(
return 0;
}
static int action_start_shader_preset_prepend(
const char* path, const char* label,
unsigned type, size_t idx, size_t entry_idx)
{
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
bool refresh = false;
struct video_shader* shader = menu_shader_get();
shader->passes = 0;
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
command_event(CMD_EVENT_SHADERS_APPLY_CHANGES, NULL);
#endif
return 0;
}
static int action_start_shader_preset_append(
const char* path, const char* label,
unsigned type, size_t idx, size_t entry_idx)
{
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
bool refresh = false;
struct video_shader* shader = menu_shader_get();
shader->passes = 0;
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
command_event(CMD_EVENT_SHADERS_APPLY_CHANGES, NULL);
#endif
return 0;
}
static int action_start_video_filter_file_load(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
@ -752,6 +786,12 @@ static int menu_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs)
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET:
BIND_ACTION_START(cbs, action_start_shader_preset);
break;
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_APPEND:
BIND_ACTION_START(cbs, action_start_shader_preset_append);
break;
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_PREPEND:
BIND_ACTION_START(cbs, action_start_shader_preset_prepend);
break;
case MENU_ENUM_LABEL_REMAP_FILE_INFO:
BIND_ACTION_START(cbs, action_start_remap_file_info);
break;