mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-09 04:21:33 +00:00
Cleanups
This commit is contained in:
parent
beeb8dbd7d
commit
405abc4823
@ -4097,6 +4097,38 @@ static void menu_action_setting_disp_set_label_menu_disk_index(
|
||||
snprintf(type_str, type_str_size, "%u", current + 1);
|
||||
}
|
||||
|
||||
static void menu_action_setting_disp_set_label_menu_video_resolution(
|
||||
file_list_t* list,
|
||||
unsigned *w, unsigned type, unsigned i,
|
||||
const char *label,
|
||||
char *type_str, size_t type_str_size,
|
||||
const char *entry_label,
|
||||
const char *path,
|
||||
char *path_buf, size_t path_buf_size)
|
||||
{
|
||||
unsigned width = 0, height = 0;
|
||||
*w = 19;
|
||||
*type_str = '\0';
|
||||
|
||||
(void)width;
|
||||
(void)height;
|
||||
|
||||
#if defined(GEKKO)
|
||||
snprintf(type_str, type_str_size, "%.3ux%.3u%c",
|
||||
menu_gx_resolutions[menu_current_gx_resolution][0],
|
||||
menu_gx_resolutions[menu_current_gx_resolution][1],
|
||||
menu_gx_resolutions[menu_current_gx_resolution][1] > 300 ? 'i' : 'p');
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
width = gfx_ctx_get_resolution_width(
|
||||
g_extern.console.screen.resolutions.list
|
||||
[g_extern.console.screen.resolutions.current.idx]);
|
||||
height = gfx_ctx_get_resolution_height(
|
||||
g_extern.console.screen.resolutions.list
|
||||
[g_extern.console.screen.resolutions.current.idx]);
|
||||
snprintf(type_str, type_str_size, "%ux%u", width, height);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void menu_action_setting_disp_set_label_menu_file_use_directory(
|
||||
file_list_t* list,
|
||||
unsigned *w, unsigned type, unsigned i,
|
||||
@ -4912,6 +4944,10 @@ static void menu_entries_cbs_init_bind_get_string_representation(menu_file_list_
|
||||
cbs->action_get_representation =
|
||||
menu_action_setting_disp_set_label_menu_disk_index;
|
||||
break;
|
||||
case MENU_SETTINGS_VIDEO_RESOLUTION:
|
||||
cbs->action_get_representation =
|
||||
menu_action_setting_disp_set_label_menu_video_resolution;
|
||||
break;
|
||||
default:
|
||||
cbs->action_get_representation = menu_action_setting_disp_set_label;
|
||||
break;
|
||||
|
@ -2789,42 +2789,6 @@ extern unsigned menu_gx_resolutions[][2];
|
||||
extern unsigned menu_current_gx_resolution;
|
||||
#endif
|
||||
|
||||
static int get_fallback_label(char *type_str,
|
||||
size_t type_str_size, unsigned *w, unsigned type,
|
||||
const char *menu_label, const char *label, unsigned idx)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
#if defined(GEKKO)
|
||||
case MENU_SETTINGS_VIDEO_RESOLUTION:
|
||||
snprintf(type_str, type_str_size, "%.3ux%.3u%c",
|
||||
menu_gx_resolutions[menu_current_gx_resolution][0],
|
||||
menu_gx_resolutions[menu_current_gx_resolution][1],
|
||||
menu_gx_resolutions[menu_current_gx_resolution][1] > 300 ? 'i' : 'p');
|
||||
break;
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
case MENU_SETTINGS_VIDEO_RESOLUTION:
|
||||
{
|
||||
unsigned width = gfx_ctx_get_resolution_width(
|
||||
g_extern.console.screen.resolutions.list
|
||||
[g_extern.console.screen.resolutions.current.idx]);
|
||||
unsigned height = gfx_ctx_get_resolution_height(
|
||||
g_extern.console.screen.resolutions.list
|
||||
[g_extern.console.screen.resolutions.current.idx]);
|
||||
snprintf(type_str, type_str_size, "%ux%u", width, height);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void get_string_representation_bind_device(void * data, char *type_str,
|
||||
size_t type_str_size)
|
||||
{
|
||||
@ -2888,20 +2852,13 @@ void setting_data_get_label(void *data, char *type_str,
|
||||
rarch_setting_t *setting_data = NULL;
|
||||
rarch_setting_t *setting = NULL;
|
||||
|
||||
if (!driver.menu || !driver.menu->menu_list)
|
||||
if (!driver.menu || !driver.menu->menu_list || !label)
|
||||
return;
|
||||
|
||||
setting_data = (rarch_setting_t*)driver.menu->list_settings;
|
||||
setting = (rarch_setting_t*)setting_data_find_setting(setting_data,
|
||||
list->list[idx].label);
|
||||
|
||||
if ((get_fallback_label(type_str, type_str_size, w, type, menu_label,
|
||||
label, idx)) == 0)
|
||||
return;
|
||||
|
||||
if (!label)
|
||||
return;
|
||||
|
||||
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
|
||||
if ((!strcmp(menu_label, "Shader Options") ||
|
||||
!strcmp(menu_label, "video_shader_parameters") ||
|
||||
|
Loading…
Reference in New Issue
Block a user