mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 08:30:16 +00:00
Cleanups
This commit is contained in:
parent
fe4622fd3b
commit
ffac0c119e
@ -948,20 +948,17 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
|||||||
case MENU_NAVIGATION_CTL_INCREMENT:
|
case MENU_NAVIGATION_CTL_INCREMENT:
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
unsigned *scroll_speed = (unsigned*)data;
|
unsigned scroll_speed = *((unsigned*)data);
|
||||||
size_t menu_list_size = menu_entries_get_size();
|
size_t menu_list_size = menu_entries_get_size();
|
||||||
bool wraparound_enable = settings->bools.menu_navigation_wraparound_enable;
|
bool wraparound_enable = settings->bools.menu_navigation_wraparound_enable;
|
||||||
|
|
||||||
if (!scroll_speed)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (menu_driver_selection_ptr >= menu_list_size - 1
|
if (menu_driver_selection_ptr >= menu_list_size - 1
|
||||||
&& !wraparound_enable)
|
&& !wraparound_enable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ((menu_driver_selection_ptr + (*scroll_speed)) < menu_list_size)
|
if ((menu_driver_selection_ptr + scroll_speed) < menu_list_size)
|
||||||
{
|
{
|
||||||
size_t idx = menu_driver_selection_ptr + (*scroll_speed);
|
size_t idx = menu_driver_selection_ptr + scroll_speed;
|
||||||
|
|
||||||
menu_navigation_set_selection(idx);
|
menu_navigation_set_selection(idx);
|
||||||
menu_driver_navigation_set(true);
|
menu_driver_navigation_set(true);
|
||||||
@ -985,18 +982,15 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
|||||||
{
|
{
|
||||||
size_t idx = 0;
|
size_t idx = 0;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
unsigned *scroll_speed = (unsigned*)data;
|
unsigned scroll_speed = *((unsigned*)data);
|
||||||
size_t menu_list_size = menu_entries_get_size();
|
size_t menu_list_size = menu_entries_get_size();
|
||||||
bool wraparound_enable = settings->bools.menu_navigation_wraparound_enable;
|
bool wraparound_enable = settings->bools.menu_navigation_wraparound_enable;
|
||||||
|
|
||||||
if (!scroll_speed)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (menu_driver_selection_ptr == 0 && !wraparound_enable)
|
if (menu_driver_selection_ptr == 0 && !wraparound_enable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (menu_driver_selection_ptr >= *scroll_speed)
|
if (menu_driver_selection_ptr >= scroll_speed)
|
||||||
idx = menu_driver_selection_ptr - *scroll_speed;
|
idx = menu_driver_selection_ptr - scroll_speed;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
idx = menu_list_size - 1;
|
idx = menu_list_size - 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user