mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
Create DISPLAYLIST_OPTIONS_VIDEO
This commit is contained in:
parent
504b3222ef
commit
6a851ab291
@ -752,6 +752,56 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int menu_displaylist_parse_all_settings(menu_displaylist_info_t *info)
|
||||||
|
{
|
||||||
|
rarch_setting_t *setting = NULL;
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
settings_list_free(menu->list_settings);
|
||||||
|
menu->list_settings = setting_new(SL_FLAG_ALL_SETTINGS);
|
||||||
|
|
||||||
|
setting = menu_setting_find("Driver Settings");
|
||||||
|
|
||||||
|
if (settings->menu.collapse_subgroups_enable)
|
||||||
|
{
|
||||||
|
for (; setting->type != ST_NONE; setting++)
|
||||||
|
{
|
||||||
|
if (setting->type == ST_GROUP)
|
||||||
|
menu_list_push(info->list, setting->short_description,
|
||||||
|
setting->name, menu_setting_set_flags(setting), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (; setting->type != ST_NONE; setting++)
|
||||||
|
{
|
||||||
|
char group_label[PATH_MAX_LENGTH];
|
||||||
|
char subgroup_label[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
|
if (setting->type == ST_GROUP)
|
||||||
|
strlcpy(group_label, setting->name, sizeof(group_label));
|
||||||
|
else if (setting->type == ST_SUB_GROUP)
|
||||||
|
{
|
||||||
|
char new_label[PATH_MAX_LENGTH], new_path[PATH_MAX_LENGTH];
|
||||||
|
strlcpy(subgroup_label, setting->name, sizeof(group_label));
|
||||||
|
strlcpy(new_label, group_label, sizeof(new_label));
|
||||||
|
strlcat(new_label, "|", sizeof(new_label));
|
||||||
|
strlcat(new_label, subgroup_label, sizeof(new_label));
|
||||||
|
|
||||||
|
strlcpy(new_path, group_label, sizeof(new_path));
|
||||||
|
strlcat(new_path, " - ", sizeof(new_path));
|
||||||
|
strlcat(new_path, setting->short_description, sizeof(new_path));
|
||||||
|
|
||||||
|
menu_list_push(info->list, new_path,
|
||||||
|
new_label, MENU_SETTING_SUBGROUP, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -776,12 +826,35 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
|||||||
ret = menu_entries_push_list(menu, info->list,
|
ret = menu_entries_push_list(menu, info->list,
|
||||||
info->path, info->label, info->type, info->flags);
|
info->path, info->label, info->type, info->flags);
|
||||||
break;
|
break;
|
||||||
|
case DISPLAYLIST_SETTINGS_ALL:
|
||||||
|
menu_list_clear(info->list);
|
||||||
|
|
||||||
|
ret = menu_displaylist_parse_all_settings(info);
|
||||||
|
|
||||||
|
need_push = true;
|
||||||
|
break;
|
||||||
case DISPLAYLIST_HORIZONTAL:
|
case DISPLAYLIST_HORIZONTAL:
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS:
|
case DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS:
|
||||||
menu_list_clear(info->list);
|
menu_list_clear(info->list);
|
||||||
ret = menu_displaylist_parse_horizontal_content_actions(info);
|
ret = menu_displaylist_parse_horizontal_content_actions(info);
|
||||||
need_refresh = true;
|
need_refresh = true;
|
||||||
|
need_push = true;
|
||||||
|
break;
|
||||||
|
case DISPLAYLIST_OPTIONS_VIDEO:
|
||||||
|
menu_list_clear(info->list);
|
||||||
|
|
||||||
|
#if defined(GEKKO) || defined(__CELLOS_LV2__)
|
||||||
|
menu_list_push(info->list, "Screen Resolution", "",
|
||||||
|
MENU_SETTINGS_VIDEO_RESOLUTION, 0);
|
||||||
|
#endif
|
||||||
|
menu_list_push(info->list, "Custom Ratio", "",
|
||||||
|
MENU_SETTINGS_CUSTOM_VIEWPORT, 0);
|
||||||
|
#ifndef HAVE_FILTERS_BUILTIN
|
||||||
|
menu_list_push(info->list, "Video Filter", "video_filter",
|
||||||
|
0, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
need_push = true;
|
need_push = true;
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_DEFAULT:
|
case DISPLAYLIST_DEFAULT:
|
||||||
|
@ -31,6 +31,7 @@ enum
|
|||||||
DISPLAYLIST_NONE = 0,
|
DISPLAYLIST_NONE = 0,
|
||||||
DISPLAYLIST_MAIN_MENU,
|
DISPLAYLIST_MAIN_MENU,
|
||||||
DISPLAYLIST_SETTINGS,
|
DISPLAYLIST_SETTINGS,
|
||||||
|
DISPLAYLIST_SETTINGS_ALL,
|
||||||
DISPLAYLIST_HORIZONTAL,
|
DISPLAYLIST_HORIZONTAL,
|
||||||
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS,
|
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS,
|
||||||
DISPLAYLIST_HISTORY,
|
DISPLAYLIST_HISTORY,
|
||||||
@ -61,6 +62,7 @@ enum
|
|||||||
DISPLAYLIST_OVERLAYS,
|
DISPLAYLIST_OVERLAYS,
|
||||||
DISPLAYLIST_SHADER_PARAMETERS,
|
DISPLAYLIST_SHADER_PARAMETERS,
|
||||||
DISPLAYLIST_SHADER_PARAMETERS_PRESET,
|
DISPLAYLIST_SHADER_PARAMETERS_PRESET,
|
||||||
|
DISPLAYLIST_OPTIONS_VIDEO,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct menu_displaylist_info
|
typedef struct menu_displaylist_info
|
||||||
|
@ -1070,67 +1070,16 @@ static int deferred_push_video_shader_parameters(void *data, void *userdata,
|
|||||||
static int deferred_push_settings(void *data, void *userdata,
|
static int deferred_push_settings(void *data, void *userdata,
|
||||||
const char *path, const char *label, unsigned type)
|
const char *path, const char *label, unsigned type)
|
||||||
{
|
{
|
||||||
rarch_setting_t *setting = NULL;
|
menu_displaylist_info_t info = {0};
|
||||||
file_list_t *list = NULL;
|
|
||||||
file_list_t *menu_list = NULL;
|
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
if (!menu)
|
info.list = (file_list_t*)data;
|
||||||
return -1;
|
info.menu_list = (file_list_t*)userdata;
|
||||||
|
info.type = type;
|
||||||
|
strlcpy(info.path, path, sizeof(info.path));
|
||||||
|
strlcpy(info.label, label, sizeof(info.label));
|
||||||
|
|
||||||
list = (file_list_t*)data;
|
return menu_displaylist_push_list(&info, DISPLAYLIST_SETTINGS_ALL);
|
||||||
menu_list = (file_list_t*)userdata;
|
|
||||||
|
|
||||||
if (!list || !menu_list)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
settings_list_free(menu->list_settings);
|
|
||||||
menu->list_settings = setting_new(SL_FLAG_ALL_SETTINGS);
|
|
||||||
|
|
||||||
setting = menu_setting_find("Driver Settings");
|
|
||||||
|
|
||||||
menu_list_clear(list);
|
|
||||||
|
|
||||||
if (settings->menu.collapse_subgroups_enable)
|
|
||||||
{
|
|
||||||
for (; setting->type != ST_NONE; setting++)
|
|
||||||
{
|
|
||||||
if (setting->type == ST_GROUP)
|
|
||||||
menu_list_push(list, setting->short_description,
|
|
||||||
setting->name, menu_setting_set_flags(setting), 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (; setting->type != ST_NONE; setting++)
|
|
||||||
{
|
|
||||||
char group_label[PATH_MAX_LENGTH];
|
|
||||||
char subgroup_label[PATH_MAX_LENGTH];
|
|
||||||
|
|
||||||
if (setting->type == ST_GROUP)
|
|
||||||
strlcpy(group_label, setting->name, sizeof(group_label));
|
|
||||||
else if (setting->type == ST_SUB_GROUP)
|
|
||||||
{
|
|
||||||
char new_label[PATH_MAX_LENGTH], new_path[PATH_MAX_LENGTH];
|
|
||||||
strlcpy(subgroup_label, setting->name, sizeof(group_label));
|
|
||||||
strlcpy(new_label, group_label, sizeof(new_label));
|
|
||||||
strlcat(new_label, "|", sizeof(new_label));
|
|
||||||
strlcat(new_label, subgroup_label, sizeof(new_label));
|
|
||||||
|
|
||||||
strlcpy(new_path, group_label, sizeof(new_path));
|
|
||||||
strlcat(new_path, " - ", sizeof(new_path));
|
|
||||||
strlcat(new_path, setting->short_description, sizeof(new_path));
|
|
||||||
|
|
||||||
menu_list_push(list, new_path,
|
|
||||||
new_label, MENU_SETTING_SUBGROUP, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
menu_driver_populate_entries(path, label, type);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int deferred_push_settings_subgroup(void *data, void *userdata,
|
static int deferred_push_settings_subgroup(void *data, void *userdata,
|
||||||
@ -1227,34 +1176,15 @@ static int deferred_push_category(void *data, void *userdata,
|
|||||||
static int deferred_push_video_options(void *data, void *userdata,
|
static int deferred_push_video_options(void *data, void *userdata,
|
||||||
const char *path, const char *label, unsigned type)
|
const char *path, const char *label, unsigned type)
|
||||||
{
|
{
|
||||||
file_list_t *list = NULL;
|
menu_displaylist_info_t info = {0};
|
||||||
file_list_t *menu_list = NULL;
|
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
|
||||||
|
|
||||||
if (!menu)
|
info.list = (file_list_t*)data;
|
||||||
return -1;
|
info.menu_list = (file_list_t*)userdata;
|
||||||
|
info.type = type;
|
||||||
|
strlcpy(info.path, path, sizeof(info.path));
|
||||||
|
strlcpy(info.label, label, sizeof(info.label));
|
||||||
|
|
||||||
list = (file_list_t*)data;
|
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS_VIDEO);
|
||||||
menu_list = (file_list_t*)userdata;
|
|
||||||
|
|
||||||
if (!list || !menu_list)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
menu_list_clear(list);
|
|
||||||
#if defined(GEKKO) || defined(__CELLOS_LV2__)
|
|
||||||
menu_list_push(list, "Screen Resolution", "",
|
|
||||||
MENU_SETTINGS_VIDEO_RESOLUTION, 0);
|
|
||||||
#endif
|
|
||||||
menu_list_push(list, "Custom Ratio", "",
|
|
||||||
MENU_SETTINGS_CUSTOM_VIEWPORT, 0);
|
|
||||||
#ifndef HAVE_FILTERS_BUILTIN
|
|
||||||
menu_list_push(list, "Video Filter", "video_filter",
|
|
||||||
0, 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
menu_driver_populate_entries(path, label, type);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int deferred_push_shader_options(void *data, void *userdata,
|
static int deferred_push_shader_options(void *data, void *userdata,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user