(Menu) Refactor CUSTOM_VIEWPORT_2 enum

This commit is contained in:
twinaphex 2014-09-01 00:37:21 +02:00
parent 5aff93ab25
commit 3756afb3d8
5 changed files with 10 additions and 10 deletions

View File

@ -1529,7 +1529,7 @@ static int menu_viewport_iterate(unsigned action)
case MENU_ACTION_CANCEL:
file_list_pop(driver.menu->menu_stack, &driver.menu->selection_ptr);
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT_2)
if (!strcmp(label, "custom_viewport_2"))
{
file_list_push(driver.menu->menu_stack, "", "",
MENU_SETTINGS_CUSTOM_VIEWPORT,
@ -1542,9 +1542,8 @@ static int menu_viewport_iterate(unsigned action)
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT
&& !g_settings.video.scale_integer)
{
file_list_push(driver.menu->menu_stack, "", "",
MENU_SETTINGS_CUSTOM_VIEWPORT_2,
driver.menu->selection_ptr);
file_list_push(driver.menu->menu_stack, "",
"custom_viewport_2", 0, driver.menu->selection_ptr);
}
break;
@ -1604,7 +1603,7 @@ static int menu_viewport_iterate(unsigned action)
{
if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT)
base_msg = "Set Upper-Left Corner";
else if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT_2)
else if (!strcmp(label, "custom_viewport_2"))
base_msg = "Set Bottom-Right Corner";
snprintf(msg, sizeof(msg), "%s (%d, %d : %4ux%4u)",
@ -2032,7 +2031,7 @@ static int menu_common_iterate(unsigned action)
return menu_info_screen_iterate(action);
else if (menu_common_type_is(menu_type) == MENU_SETTINGS)
return menu_settings_iterate(action);
else if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT || menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT_2)
else if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT || !strcmp(menu_label, "custom_viewport_2"))
return menu_viewport_iterate(action);
else if (menu_type == MENU_SETTINGS_CUSTOM_BIND)
return menu_custom_bind_iterate(driver.menu, action);

View File

@ -358,7 +358,7 @@ static void rgui_render(void)
else if (menu_type == MENU_SETTINGS_PATH_OPTIONS ||
menu_type == MENU_SETTINGS_OPTIONS ||
menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT ||
menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT_2 ||
!strcmp(label, "custom_viewport_2") ||
!strcmp(label, "help") ||
menu_type == MENU_SETTINGS)
snprintf(title, sizeof(title), "MENU %s", dir);

View File

@ -217,7 +217,8 @@ static void rmenu_render(void)
else if ((menu_type == MENU_SETTINGS_INPUT_OPTIONS) ||
(menu_type == MENU_SETTINGS_PATH_OPTIONS) ||
(menu_type == MENU_SETTINGS_OPTIONS) ||
(menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT || menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT_2) ||
(menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT ||
!strcmp(label, "custom_viewport_2")) ||
menu_type == MENU_SETTINGS_CUSTOM_BIND ||
!strcmp(label, "help") ||
menu_type == MENU_SETTINGS)

View File

@ -452,7 +452,8 @@ static void rmenu_xui_render(void)
else if ((menu_type == MENU_SETTINGS_INPUT_OPTIONS) ||
(menu_type == MENU_SETTINGS_PATH_OPTIONS) ||
(menu_type == MENU_SETTINGS_OPTIONS) ||
(menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT || menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT_2) ||
(menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT ||
!strcmp(label, "custom_viewport_2")) ||
menu_type == MENU_SETTINGS_CUSTOM_BIND ||
!strcmp(label, "help") ||
menu_type == MENU_SETTINGS)

View File

@ -87,7 +87,6 @@ typedef enum
MENU_SETTINGS_VIDEO_OPTIONS,
MENU_SETTINGS_VIDEO_RESOLUTION,
MENU_SETTINGS_CUSTOM_VIEWPORT,
MENU_SETTINGS_CUSTOM_VIEWPORT_2,
MENU_SETTINGS_VIDEO_SOFTFILTER,
MENU_SETTINGS_VIDEO_OPTIONS_LAST,
MENU_SETTINGS_FONT_OPTIONS,