From 11bf7aa63826f0eb4b3a6a5fb53708e2d8117c98 Mon Sep 17 00:00:00 2001 From: AL2009man <67606569+AL2009man@users.noreply.github.com> Date: Wed, 28 May 2025 22:32:41 -0400 Subject: [PATCH 1/3] Increased Mouse sensitivity to 30.00 this wil be more in line with id Tech's max mouse sens, which is also 30.00 --- port/src/optionsmenu.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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, }, { From 094d80a5cf5a5c6489e66a630440f738b03c6e47 Mon Sep 17 00:00:00 2001 From: AL2009man <67606569+AL2009man@users.noreply.github.com> Date: Wed, 28 May 2025 23:10:41 -0400 Subject: [PATCH 2/3] fixed `MouseSpeedX/Y` config file number limit --- port/src/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/port/src/input.c b/port/src/input.c index 96e37255e..1ad084260 100644 --- a/port/src/input.c +++ b/port/src/input.c @@ -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); From 57eead90780b66a045e48eb24d80ffea688b38a2 Mon Sep 17 00:00:00 2001 From: AL2009man <67606569+AL2009man@users.noreply.github.com> Date: Thu, 29 May 2025 00:07:33 -0400 Subject: [PATCH 3/3] cleaned up MouseGetScaledDelta and AbsScaledDelta To prepare for the revised MouseScaledDelta: the current setup has been simplified for easier code reading --- port/src/input.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/port/src/input.c b/port/src/input.c index 1ad084260..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;