mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(Menu) Refactor set_current_unsigned_integer
This commit is contained in:
parent
e8ff64bad6
commit
fb1f525901
@ -2162,8 +2162,7 @@ static void menu_common_setting_set_current_fraction(rarch_setting_t *setting, u
|
||||
setting->change_handler(setting);
|
||||
}
|
||||
|
||||
static void menu_common_setting_set_current_unsigned_integer(rarch_setting_t *setting, unsigned action,
|
||||
bool enforce_min_check, bool enforce_max_check)
|
||||
static void menu_common_setting_set_current_unsigned_integer(rarch_setting_t *setting, unsigned action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
@ -2171,7 +2170,7 @@ static void menu_common_setting_set_current_unsigned_integer(rarch_setting_t *se
|
||||
if (*setting->value.unsigned_integer != setting->min)
|
||||
*setting->value.unsigned_integer = *setting->value.unsigned_integer - setting->step;
|
||||
|
||||
if (enforce_min_check)
|
||||
if (setting->enforce_minrange)
|
||||
{
|
||||
if (*setting->value.unsigned_integer < setting->min)
|
||||
*setting->value.unsigned_integer = setting->min;
|
||||
@ -2182,7 +2181,7 @@ static void menu_common_setting_set_current_unsigned_integer(rarch_setting_t *se
|
||||
case MENU_ACTION_OK:
|
||||
*setting->value.unsigned_integer = *setting->value.unsigned_integer + setting->step;
|
||||
|
||||
if (enforce_max_check)
|
||||
if (setting->enforce_maxrange)
|
||||
{
|
||||
if (*setting->value.unsigned_integer > setting->max)
|
||||
*setting->value.unsigned_integer = setting->max;
|
||||
@ -3406,21 +3405,15 @@ static int menu_common_setting_set(unsigned id, unsigned action, rarch_setting_t
|
||||
case MENU_SETTINGS_AUDIO_LATENCY:
|
||||
case MENU_CONTENT_HISTORY_SIZE:
|
||||
case MENU_SETTINGS_NETPLAY_DELAY_FRAMES:
|
||||
if (setting)
|
||||
menu_common_setting_set_current_unsigned_integer(setting, action, true, false);
|
||||
break;
|
||||
case MENU_SETTINGS_LIBRETRO_LOG_LEVEL:
|
||||
case MENU_SETTINGS_USER_LANGUAGE:
|
||||
case MENU_SETTINGS_VIDEO_ROTATION:
|
||||
case MENU_SETTINGS_VIDEO_ASPECT_RATIO:
|
||||
case MENU_SETTINGS_VIDEO_SWAP_INTERVAL:
|
||||
case MENU_SETTINGS_VIDEO_HARD_SYNC_FRAMES:
|
||||
if (setting)
|
||||
menu_common_setting_set_current_unsigned_integer(setting, action, true, true);
|
||||
break;
|
||||
case MENU_SETTINGS_VIDEO_MONITOR_INDEX:
|
||||
if (setting)
|
||||
menu_common_setting_set_current_unsigned_integer(setting, action, false, false);
|
||||
menu_common_setting_set_current_unsigned_integer(setting, action);
|
||||
break;
|
||||
#if defined(HAVE_THREADS)
|
||||
case MENU_SETTINGS_SRAM_AUTOSAVE:
|
||||
|
@ -1541,7 +1541,7 @@ rarch_setting_t* setting_data_get_list(void)
|
||||
CONFIG_BOOL(g_settings.video.shared_context, "video_shared_context", "HW Shared Context Enable", false, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
|
||||
END_SUB_GROUP()
|
||||
START_SUB_GROUP("Monitor")
|
||||
CONFIG_UINT(g_settings.video.monitor_index, "video_monitor_index", "Monitor Index", monitor_index, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
|
||||
CONFIG_UINT(g_settings.video.monitor_index, "video_monitor_index", "Monitor Index", monitor_index, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) WITH_RANGE(0, 1, 1, true, false)
|
||||
#if !defined(RARCH_CONSOLE) && !defined(RARCH_MOBILE)
|
||||
CONFIG_BOOL(g_settings.video.fullscreen, "video_fullscreen", "Use Fullscreen mode", fullscreen, GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user