mirror of
https://github.com/libretro/RetroArch
synced 2025-02-12 00:40:26 +00:00
clamp axis_threshold to avoid potential floating point issues.
This commit is contained in:
parent
765e876cc4
commit
9e865d22c9
@ -2659,17 +2659,16 @@ static int menu_common_setting_set(void *data, unsigned setting, unsigned action
|
|||||||
|
|
||||||
case RGUI_ACTION_OK:
|
case RGUI_ACTION_OK:
|
||||||
case RGUI_ACTION_RIGHT:
|
case RGUI_ACTION_RIGHT:
|
||||||
if (g_settings.input.axis_threshold < 1.0)
|
g_settings.input.axis_threshold += 0.01;
|
||||||
g_settings.input.axis_threshold += 0.001;
|
|
||||||
break;
|
break;
|
||||||
case RGUI_ACTION_LEFT:
|
case RGUI_ACTION_LEFT:
|
||||||
if (g_settings.input.axis_threshold > 0.0)
|
g_settings.input.axis_threshold -= 0.01;
|
||||||
g_settings.input.axis_threshold -= 0.001;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
g_settings.input.axis_threshold = max(min(g_settings.input.axis_threshold, 0.95f), 0.05f);
|
||||||
break;
|
break;
|
||||||
case RGUI_SETTINGS_BIND_DEVICE_TYPE:
|
case RGUI_SETTINGS_BIND_DEVICE_TYPE:
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user