Reimplement disk_options_disk_index_toggle

This commit is contained in:
twinaphex 2014-10-16 07:41:29 +02:00
parent af45a31b58
commit ab78b8a4cd

View File

@ -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,
unsigned action)
{
int step = 0;
switch (action)
{
case MENU_ACTION_LEFT:
step = -1;
rarch_main_command(RARCH_CMD_DISK_PREV);
break;
case MENU_ACTION_RIGHT:
step = 1;
rarch_main_command(RARCH_CMD_DISK_NEXT);
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;
}