mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 13:43:32 +00:00
(Menu) Toggle functions should trigger video state change since
a label is likely to be updated because of it
This commit is contained in:
parent
beb68d559d
commit
581bc22e19
@ -484,6 +484,11 @@ struct runloop
|
||||
{
|
||||
bool dirty;
|
||||
} framebuf;
|
||||
|
||||
struct
|
||||
{
|
||||
bool active;
|
||||
} action;
|
||||
} menu;
|
||||
} current;
|
||||
} video;
|
||||
|
@ -39,10 +39,12 @@ static int shader_action_parameter_toggle(unsigned type, const char *label,
|
||||
{
|
||||
case MENU_ACTION_LEFT:
|
||||
param->current -= param->step;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
|
||||
case MENU_ACTION_RIGHT:
|
||||
param->current += param->step;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -74,10 +76,12 @@ static int shader_action_parameter_preset_toggle(unsigned type, const char *labe
|
||||
{
|
||||
case MENU_ACTION_LEFT:
|
||||
param->current -= param->step;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
|
||||
case MENU_ACTION_RIGHT:
|
||||
param->current += param->step;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -105,6 +109,7 @@ static int action_toggle_cheat(unsigned type, const char *label,
|
||||
case MENU_ACTION_RIGHT:
|
||||
cheat->cheats[idx].state = !cheat->cheats[idx].state;
|
||||
cheat_manager_update(cheat, idx);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -122,11 +127,17 @@ static int action_toggle_input_desc(unsigned type, const char *label,
|
||||
{
|
||||
case MENU_ACTION_LEFT:
|
||||
if (g_settings.input.remap_ids[inp_desc_user][inp_desc_button_index_offset] > 0)
|
||||
{
|
||||
g_settings.input.remap_ids[inp_desc_user][inp_desc_button_index_offset]--;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
}
|
||||
break;
|
||||
case MENU_ACTION_RIGHT:
|
||||
if (g_settings.input.remap_ids[inp_desc_user][inp_desc_button_index_offset] < RARCH_FIRST_CUSTOM_BIND)
|
||||
{
|
||||
g_settings.input.remap_ids[inp_desc_user][inp_desc_button_index_offset]++;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -141,10 +152,14 @@ static int action_toggle_save_state(unsigned type, const char *label,
|
||||
case MENU_ACTION_LEFT:
|
||||
/* Slot -1 is (auto) slot. */
|
||||
if (g_settings.state_slot >= 0)
|
||||
{
|
||||
g_settings.state_slot--;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
}
|
||||
break;
|
||||
case MENU_ACTION_RIGHT:
|
||||
g_settings.state_slot++;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -170,15 +185,22 @@ static int action_toggle_scroll(unsigned type, const char *label,
|
||||
menu->navigation.selection_ptr - fast_scroll_speed, true);
|
||||
else
|
||||
menu_navigation_clear(&menu->navigation, false);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
case MENU_ACTION_RIGHT:
|
||||
if (menu->navigation.selection_ptr + fast_scroll_speed < (menu_list_get_size(menu->menu_list)))
|
||||
{
|
||||
menu_navigation_set(&menu->navigation,
|
||||
menu->navigation.selection_ptr + fast_scroll_speed, true);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((menu_list_get_size(menu->menu_list) > 0))
|
||||
menu_navigation_set_last(&menu->navigation);
|
||||
{
|
||||
menu_navigation_set_last(&menu->navigation);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -235,9 +257,12 @@ static int action_toggle_mainmenu(unsigned type, const char *label,
|
||||
"",
|
||||
"",
|
||||
0);
|
||||
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
case 2:
|
||||
action_toggle_scroll(0, "", action);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
@ -276,6 +301,8 @@ static int action_toggle_shader_scale_pass(unsigned type, const char *label,
|
||||
|
||||
shader_pass->fbo.valid = current_scale;
|
||||
shader_pass->fbo.scale_x = shader_pass->fbo.scale_y = current_scale;
|
||||
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -308,6 +335,8 @@ static int action_toggle_shader_filter_pass(unsigned type, const char *label,
|
||||
{
|
||||
unsigned delta = (action == MENU_ACTION_LEFT) ? 2 : 1;
|
||||
shader_pass->filter = ((shader_pass->filter + delta) % 3);
|
||||
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -344,11 +373,13 @@ static int action_toggle_cheat_num_passes(unsigned type, const char *label,
|
||||
if (cheat->size)
|
||||
new_size = cheat->size - 1;
|
||||
menu->need_refresh = true;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
|
||||
case MENU_ACTION_RIGHT:
|
||||
new_size = cheat->size + 1;
|
||||
menu->need_refresh = true;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -377,12 +408,14 @@ static int action_toggle_shader_num_passes(unsigned type, const char *label,
|
||||
if (shader->passes)
|
||||
shader->passes--;
|
||||
menu->need_refresh = true;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
|
||||
case MENU_ACTION_RIGHT:
|
||||
if ((shader->passes < GFX_MAX_SHADERS))
|
||||
shader->passes++;
|
||||
menu->need_refresh = true;
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -425,12 +458,18 @@ static int action_toggle_video_resolution(unsigned type, const char *label,
|
||||
case MENU_ACTION_LEFT:
|
||||
if (driver.video_data && driver.video_poke &&
|
||||
driver.video_poke->get_video_output_prev)
|
||||
{
|
||||
driver.video_poke->get_video_output_prev(driver.video_data);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
}
|
||||
break;
|
||||
case MENU_ACTION_RIGHT:
|
||||
if (driver.video_data && driver.video_poke &&
|
||||
driver.video_poke->get_video_output_next)
|
||||
{
|
||||
driver.video_poke->get_video_output_next(driver.video_data);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
@ -449,10 +488,12 @@ static int core_setting_toggle(unsigned type, const char *label,
|
||||
{
|
||||
case MENU_ACTION_LEFT:
|
||||
core_option_prev(g_extern.system.core_options, idx);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
|
||||
case MENU_ACTION_RIGHT:
|
||||
core_option_next(g_extern.system.core_options, idx);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -466,9 +507,11 @@ static int disk_options_disk_idx_toggle(unsigned type, const char *label,
|
||||
{
|
||||
case MENU_ACTION_LEFT:
|
||||
rarch_main_command(RARCH_CMD_DISK_PREV);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
case MENU_ACTION_RIGHT:
|
||||
rarch_main_command(RARCH_CMD_DISK_NEXT);
|
||||
g_runloop.frames.video.current.menu.action.active = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user