From 9a7e9c9ee3af349337474bfd5b38d209dbdcbdcf Mon Sep 17 00:00:00 2001 From: fgsfds Date: Sat, 30 Sep 2023 14:05:53 +0200 Subject: [PATCH] port: small fixes for previous commit --- port/include/input.h | 4 ++++ port/src/input.c | 2 +- src/game/activemenutick.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/port/include/input.h b/port/include/input.h index a3859c5d3..1c27410ee 100644 --- a/port/include/input.h +++ b/port/include/input.h @@ -122,6 +122,10 @@ void inputMouseGetRawDelta(s32 *dx, s32 *dy); // returns 0, 0 when the mouse is not locked into the window void inputMouseGetScaledDelta(f32 *dx, f32 *dy); +// returns changes in mouse position since last frame, scaled by absolute sensitivity +// returns 0, 0 when the mouse is not locked into the window +void inputMouseGetAbsScaledDelta(f32 *dx, f32 *dy); + // call this every frame void inputUpdate(void); diff --git a/port/src/input.c b/port/src/input.c index 3106fc633..d9271070b 100644 --- a/port/src/input.c +++ b/port/src/input.c @@ -727,7 +727,7 @@ void inputMouseGetScaledDelta(f32 *dx, f32 *dy) if (dy) *dy = mdy; } -void inputMouseGetScaledDeltaAbsSens(f32 *dx, f32 *dy) +void inputMouseGetAbsScaledDelta(f32 *dx, f32 *dy) { f32 mdx, mdy; if (mouseLocked) { diff --git a/src/game/activemenutick.c b/src/game/activemenutick.c index 656c45a77..2ad4c57fd 100644 --- a/src/game/activemenutick.c +++ b/src/game/activemenutick.c @@ -70,7 +70,7 @@ void amTick(void) if (j == 0 && g_Vars.currentplayernum == 0 && inputMouseIsLocked()) { f32 mdx, mdy; struct activemenu *am = &g_AmMenus[g_AmIndex]; - inputMouseGetScaledDeltaAbsSens(&mdx, &mdy); + inputMouseGetAbsScaledDelta(&mdx, &mdy); if (mdx || mdy) { am->mousex += mdx * 4.f; am->mousey += mdy * 4.f;