mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-27 03:56:06 +00:00
(Menu) Start adding preliminary 'Shader Options' to 'Frontend Settings'
(still WIP - not fully working)
This commit is contained in:
parent
66f902215e
commit
1f634b290e
@ -196,6 +196,8 @@ static void menu_action_setting_disp_set_label_shader_pass(
|
|||||||
strlcpy(s, menu_hash_to_str(MENU_VALUE_NOT_AVAILABLE), len);
|
strlcpy(s, menu_hash_to_str(MENU_VALUE_NOT_AVAILABLE), len);
|
||||||
|
|
||||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
|
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
|
||||||
|
if (!menu || !menu->shader)
|
||||||
|
return;
|
||||||
if (*menu->shader->pass[pass].source.path)
|
if (*menu->shader->pass[pass].source.path)
|
||||||
fill_pathname_base(s,
|
fill_pathname_base(s,
|
||||||
menu->shader->pass[pass].source.path, len);
|
menu->shader->pass[pass].source.path, len);
|
||||||
@ -913,6 +915,7 @@ static int menu_cbs_init_bind_get_string_representation_compare_label(
|
|||||||
case MENU_LABEL_TAKE_SCREENSHOT:
|
case MENU_LABEL_TAKE_SCREENSHOT:
|
||||||
case MENU_LABEL_CORE_INPUT_REMAPPING_OPTIONS:
|
case MENU_LABEL_CORE_INPUT_REMAPPING_OPTIONS:
|
||||||
case MENU_LABEL_CORE_INFORMATION:
|
case MENU_LABEL_CORE_INFORMATION:
|
||||||
|
case MENU_LABEL_SYSTEM_INFORMATION:
|
||||||
cbs->action_get_value =
|
cbs->action_get_value =
|
||||||
menu_action_setting_disp_set_label_menu_more;
|
menu_action_setting_disp_set_label_menu_more;
|
||||||
break;
|
break;
|
||||||
|
@ -4754,6 +4754,117 @@ static bool setting_append_list_video_options(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool setting_append_list_video_shader_options(
|
||||||
|
rarch_setting_t **list,
|
||||||
|
rarch_setting_info_t *list_info,
|
||||||
|
const char *parent_group)
|
||||||
|
{
|
||||||
|
unsigned i;
|
||||||
|
rarch_setting_group_info_t group_info = {0};
|
||||||
|
rarch_setting_group_info_t subgroup_info = {0};
|
||||||
|
struct video_shader *shader = NULL;
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
if (!menu)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
shader = menu->shader;
|
||||||
|
|
||||||
|
if (!shader)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
(void)global;
|
||||||
|
(void)subgroup_info;
|
||||||
|
|
||||||
|
START_GROUP(group_info, menu_hash_to_str(MENU_LABEL_VALUE_SHADER_OPTIONS), parent_group);
|
||||||
|
|
||||||
|
parent_group = menu_hash_to_str(MENU_LABEL_VALUE_SETTINGS);
|
||||||
|
|
||||||
|
START_SUB_GROUP(list, list_info, "State", group_info.name, subgroup_info, parent_group);
|
||||||
|
|
||||||
|
CONFIG_ACTION(
|
||||||
|
menu_hash_to_str(MENU_LABEL_SHADER_APPLY_CHANGES),
|
||||||
|
menu_hash_to_str(MENU_LABEL_VALUE_SHADER_APPLY_CHANGES),
|
||||||
|
group_info.name,
|
||||||
|
subgroup_info.name,
|
||||||
|
parent_group);
|
||||||
|
|
||||||
|
CONFIG_PATH(
|
||||||
|
settings->video.font_path,
|
||||||
|
menu_hash_to_str(MENU_LABEL_VIDEO_SHADER_PRESET),
|
||||||
|
menu_hash_to_str(MENU_LABEL_VALUE_VIDEO_SHADER_PRESET),
|
||||||
|
"",
|
||||||
|
group_info.name,
|
||||||
|
subgroup_info.name,
|
||||||
|
parent_group,
|
||||||
|
general_write_handler,
|
||||||
|
general_read_handler);
|
||||||
|
|
||||||
|
CONFIG_ACTION(
|
||||||
|
menu_hash_to_str(MENU_LABEL_VIDEO_SHADER_PRESET_SAVE_AS),
|
||||||
|
menu_hash_to_str(MENU_LABEL_VALUE_VIDEO_SHADER_PRESET_SAVE_AS),
|
||||||
|
group_info.name,
|
||||||
|
subgroup_info.name,
|
||||||
|
parent_group);
|
||||||
|
|
||||||
|
CONFIG_ACTION(
|
||||||
|
menu_hash_to_str(MENU_LABEL_VIDEO_SHADER_PARAMETERS),
|
||||||
|
menu_hash_to_str(MENU_LABEL_VALUE_VIDEO_SHADER_PARAMETERS),
|
||||||
|
group_info.name,
|
||||||
|
subgroup_info.name,
|
||||||
|
parent_group);
|
||||||
|
|
||||||
|
CONFIG_ACTION(
|
||||||
|
menu_hash_to_str(MENU_LABEL_VIDEO_SHADER_PRESET_PARAMETERS),
|
||||||
|
menu_hash_to_str(MENU_LABEL_VALUE_VIDEO_SHADER_PRESET_PARAMETERS),
|
||||||
|
group_info.name,
|
||||||
|
subgroup_info.name,
|
||||||
|
parent_group);
|
||||||
|
|
||||||
|
CONFIG_ACTION(
|
||||||
|
menu_hash_to_str(MENU_LABEL_VIDEO_SHADER_NUM_PASSES),
|
||||||
|
menu_hash_to_str(MENU_LABEL_VALUE_VIDEO_SHADER_NUM_PASSES),
|
||||||
|
group_info.name,
|
||||||
|
subgroup_info.name,
|
||||||
|
parent_group);
|
||||||
|
|
||||||
|
for (i = 0; i < shader->passes; i++)
|
||||||
|
{
|
||||||
|
char buf[64] = {0};
|
||||||
|
|
||||||
|
snprintf(buf, sizeof(buf), "%s #%u", menu_hash_to_str(MENU_VALUE_SHADER), i);
|
||||||
|
|
||||||
|
CONFIG_ACTION(
|
||||||
|
menu_hash_to_str(MENU_LABEL_VIDEO_SHADER_PASS),
|
||||||
|
buf,
|
||||||
|
group_info.name,
|
||||||
|
subgroup_info.name,
|
||||||
|
parent_group);
|
||||||
|
#if 0
|
||||||
|
|
||||||
|
menu_list_push(info->list, buf,
|
||||||
|
MENU_SETTINGS_SHADER_PASS_0 + i, 0, 0);
|
||||||
|
|
||||||
|
snprintf(buf, sizeof(buf), "%s #%u Filter", menu_hash_to_str(MENU_VALUE_SHADER), i);
|
||||||
|
menu_list_push(info->list, buf,
|
||||||
|
menu_hash_to_str(MENU_LABEL_VIDEO_SHADER_FILTER_PASS),
|
||||||
|
MENU_SETTINGS_SHADER_PASS_FILTER_0 + i, 0, 0);
|
||||||
|
|
||||||
|
snprintf(buf, sizeof(buf), "%s #%u Scale", menu_hash_to_str(MENU_VALUE_SHADER), i);
|
||||||
|
menu_list_push(info->list, buf,
|
||||||
|
menu_hash_to_str(MENU_LABEL_VIDEO_SHADER_SCALE_PASS),
|
||||||
|
MENU_SETTINGS_SHADER_PASS_SCALE_0 + i, 0, 0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
END_SUB_GROUP(list, list_info, parent_group);
|
||||||
|
END_GROUP(list, list_info, parent_group);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static bool setting_append_list_font_options(
|
static bool setting_append_list_font_options(
|
||||||
rarch_setting_t **list,
|
rarch_setting_t **list,
|
||||||
rarch_setting_info_t *list_info,
|
rarch_setting_info_t *list_info,
|
||||||
@ -7025,6 +7136,9 @@ rarch_setting_t *menu_setting_new(unsigned mask)
|
|||||||
{
|
{
|
||||||
if (!setting_append_list_video_options(&list, list_info, root))
|
if (!setting_append_list_video_options(&list, list_info, root))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
if (!setting_append_list_video_shader_options(&list, list_info, root))
|
||||||
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & SL_FLAG_AUDIO_OPTIONS)
|
if (mask & SL_FLAG_AUDIO_OPTIONS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user