Create menu_driver_{decrement|increment}_navigation

This commit is contained in:
twinaphex 2017-04-23 21:17:01 +02:00
parent e0483f73bc
commit c38f86e14a
3 changed files with 19 additions and 12 deletions

View File

@ -446,6 +446,18 @@ bool menu_driver_list_clear(void *data)
return true; return true;
} }
void menu_driver_increment_navigation(void)
{
if (menu_driver_ctx->navigation_increment)
menu_driver_ctx->navigation_increment(menu_userdata);
}
void menu_driver_decrement_navigation(void)
{
if (menu_driver_ctx->navigation_decrement)
menu_driver_ctx->navigation_decrement(menu_userdata);
}
bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data) bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
{ {
switch (state) switch (state)
@ -655,14 +667,6 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
case RARCH_MENU_CTL_UNSET_LOAD_NO_CONTENT: case RARCH_MENU_CTL_UNSET_LOAD_NO_CONTENT:
menu_driver_load_no_content = false; menu_driver_load_no_content = false;
break; break;
case RARCH_MENU_CTL_NAVIGATION_INCREMENT:
if (menu_driver_ctx->navigation_increment)
menu_driver_ctx->navigation_increment(menu_userdata);
break;
case RARCH_MENU_CTL_NAVIGATION_DECREMENT:
if (menu_driver_ctx->navigation_decrement)
menu_driver_ctx->navigation_decrement(menu_userdata);
break;
case RARCH_MENU_CTL_NAVIGATION_SET: case RARCH_MENU_CTL_NAVIGATION_SET:
{ {
bool *scroll = (bool*)data; bool *scroll = (bool*)data;

View File

@ -82,8 +82,6 @@ enum rarch_menu_ctl_state
{ {
RARCH_MENU_CTL_NONE = 0, RARCH_MENU_CTL_NONE = 0,
RARCH_MENU_CTL_REFRESH, RARCH_MENU_CTL_REFRESH,
RARCH_MENU_CTL_NAVIGATION_INCREMENT,
RARCH_MENU_CTL_NAVIGATION_DECREMENT,
RARCH_MENU_CTL_NAVIGATION_SET, RARCH_MENU_CTL_NAVIGATION_SET,
RARCH_MENU_CTL_NAVIGATION_CLEAR, RARCH_MENU_CTL_NAVIGATION_CLEAR,
RARCH_MENU_CTL_NAVIGATION_SET_LAST, RARCH_MENU_CTL_NAVIGATION_SET_LAST,
@ -401,6 +399,10 @@ bool menu_driver_iterate(menu_ctx_iterate_t *iterate);
bool menu_driver_list_clear(void *data); bool menu_driver_list_clear(void *data);
void menu_driver_increment_navigation(void);
void menu_driver_decrement_navigation(void);
extern menu_ctx_driver_t menu_ctx_xui; extern menu_ctx_driver_t menu_ctx_xui;
extern menu_ctx_driver_t menu_ctx_rgui; extern menu_ctx_driver_t menu_ctx_rgui;
extern menu_ctx_driver_t menu_ctx_mui; extern menu_ctx_driver_t menu_ctx_mui;

View File

@ -104,7 +104,7 @@ bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data)
} }
} }
menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_INCREMENT, NULL); menu_driver_increment_navigation();
} }
break; break;
case MENU_NAVIGATION_CTL_DECREMENT: case MENU_NAVIGATION_CTL_DECREMENT:
@ -134,7 +134,8 @@ bool menu_navigation_ctl(enum menu_navigation_ctl_state state, void *data)
menu_navigation_set_selection(idx); menu_navigation_set_selection(idx);
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET, &scroll); menu_navigation_ctl(MENU_NAVIGATION_CTL_SET, &scroll);
menu_navigation_ctl(MENU_NAVIGATION_CTL_DECREMENT, NULL); menu_navigation_ctl(MENU_NAVIGATION_CTL_DECREMENT, NULL);
menu_driver_ctl(RARCH_MENU_CTL_NAVIGATION_DECREMENT, NULL);
menu_driver_decrement_navigation();
} }
break; break;