diff --git a/port/src/input.c b/port/src/input.c index 96e37255e..c1c03ee1b 100644 --- a/port/src/input.c +++ b/port/src/input.c @@ -1244,8 +1244,8 @@ void inputMouseGetScaledDelta(f32* dx, f32* dy) f32 mdx = 0.f, mdy = 0.f; if (mouseLocked) { - mdx = mouseSensX * ((f32)mouseDX / 3.5f) * 0.022f; - mdy = mouseSensY * ((f32)mouseDY / 3.5f) * 0.022f; + mdx = mouseDX * (0.022f / 3.5f) * mouseSensX; + mdy = mouseDY * (0.022f / 3.5f) * mouseSensY; } if (dx) *dx = mdx; if (dy) *dy = mdy; @@ -1256,8 +1256,8 @@ void inputMouseGetAbsScaledDelta(f32* dx, f32* dy) f32 mdx = 0.f, mdy = 0.f; if (mouseLocked) { - mdx = fabsf(mouseSensX) * ((f32)mouseDX / 3.5f) * 0.022f; - mdy = fabsf(mouseSensY) * ((f32)mouseDY / 3.5f) * 0.022f; + mdx = fabsf(mouseDX) * (0.022f / 3.5f) * fabsf(mouseSensX); + mdy = fabsf(mouseDY) * (0.022f / 3.5f) * fabsf(mouseSensY); } if (dx) *dx = mdx; if (dy) *dy = mdy; @@ -1509,8 +1509,8 @@ PD_CONSTRUCTOR static void inputConfigInit(void) { configRegisterInt("Input.MouseEnabled", &mouseEnabled, 0, 1); configRegisterInt("Input.MouseLockMode", &mouseLockMode, MLOCK_OFF, MLOCK_AUTO); - configRegisterFloat("Input.MouseSpeedX", &mouseSensX, -10.f, 10.f); - configRegisterFloat("Input.MouseSpeedY", &mouseSensY, -10.f, 10.f); + configRegisterFloat("Input.MouseSpeedX", &mouseSensX, -30.f, 30.f); + configRegisterFloat("Input.MouseSpeedY", &mouseSensY, -30.f, 30.f); configRegisterInt("Input.FakeGamepads", &fakeControllers, 0, 4); configRegisterInt("Input.FirstGamepadNum", &firstController, 0, 3); configRegisterInt("Input.UseHIDAPI", &useHIDAPI, 0, 1); diff --git a/port/src/optionsmenu.c b/port/src/optionsmenu.c index e077acb31..563215334 100644 --- a/port/src/optionsmenu.c +++ b/port/src/optionsmenu.c @@ -170,8 +170,6 @@ static MenuItemHandlerResult menuhandlerMouseSpeedX(s32 operation, struct menuit inputMouseGetSpeed(&x, &y); if (x < 0.f) { data->slider.value = 0; - } else if (x > 10.f) { - data->slider.value = 1000; } else { data->slider.value = x * 100.f + 0.5f; } @@ -182,6 +180,7 @@ static MenuItemHandlerResult menuhandlerMouseSpeedX(s32 operation, struct menuit break; case MENUOP_GETSLIDERLABEL: sprintf(data->slider.label, "%.2f", (f32)data->slider.value / 100.f); + break; } return 0; @@ -196,8 +195,6 @@ static MenuItemHandlerResult menuhandlerMouseSpeedY(s32 operation, struct menuit inputMouseGetSpeed(&x, &y); if (y < 0.f) { data->slider.value = 0; - } else if (y > 10.f) { - data->slider.value = 1000; } else { data->slider.value = y * 100.f + 0.5f; } @@ -208,6 +205,7 @@ static MenuItemHandlerResult menuhandlerMouseSpeedY(s32 operation, struct menuit break; case MENUOP_GETSLIDERLABEL: sprintf(data->slider.label, "%.2f", (f32)data->slider.value / 100.f); + break; } return 0; @@ -325,7 +323,7 @@ struct menuitem g_ExtendedMouseMenuItems[] = { 0, MENUITEMFLAG_LITERAL_TEXT | MENUITEMFLAG_SLIDER_WIDE, (uintptr_t)"Mouse Speed X", - 1000, + 3000, menuhandlerMouseSpeedX, }, { @@ -333,7 +331,7 @@ struct menuitem g_ExtendedMouseMenuItems[] = { 0, MENUITEMFLAG_LITERAL_TEXT | MENUITEMFLAG_SLIDER_WIDE, (uintptr_t)"Mouse Speed Y", - 1000, + 3000, menuhandlerMouseSpeedY, }, {