mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
Reimplement disk_options_disk_index_toggle
This commit is contained in:
parent
af45a31b58
commit
ab78b8a4cd
@ -1355,30 +1355,16 @@ static int core_setting_toggle(unsigned type, const char *label,
|
|||||||
static int disk_options_disk_index_toggle(unsigned type, const char *label,
|
static int disk_options_disk_index_toggle(unsigned type, const char *label,
|
||||||
unsigned action)
|
unsigned action)
|
||||||
{
|
{
|
||||||
int step = 0;
|
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case MENU_ACTION_LEFT:
|
case MENU_ACTION_LEFT:
|
||||||
step = -1;
|
rarch_main_command(RARCH_CMD_DISK_PREV);
|
||||||
break;
|
break;
|
||||||
case MENU_ACTION_RIGHT:
|
case MENU_ACTION_RIGHT:
|
||||||
step = 1;
|
rarch_main_command(RARCH_CMD_DISK_NEXT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (step)
|
|
||||||
{
|
|
||||||
const struct retro_disk_control_callback *control =
|
|
||||||
(const struct retro_disk_control_callback*)
|
|
||||||
&g_extern.system.disk_control;
|
|
||||||
unsigned num_disks = control->get_num_images();
|
|
||||||
unsigned current = control->get_image_index();
|
|
||||||
unsigned next_index = (current + num_disks + 1 + step)
|
|
||||||
% (num_disks + 1);
|
|
||||||
rarch_disk_control_set_index(next_index);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user