From b441593567fd07d4e9f28222796884ce6a37d2ef Mon Sep 17 00:00:00 2001 From: TurtleP Date: Thu, 12 Oct 2023 08:05:55 -0400 Subject: [PATCH] 3ds: clamp between -1.0f and 1.0f --- platform/ctr/source/objects/joystick_ext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/ctr/source/objects/joystick_ext.cpp b/platform/ctr/source/objects/joystick_ext.cpp index 5760ca74..43e3448a 100644 --- a/platform/ctr/source/objects/joystick_ext.cpp +++ b/platform/ctr/source/objects/joystick_ext.cpp @@ -168,7 +168,7 @@ float Joystick::GetAxis(int index) hidCircleRead(&leftStick); float value = (index == 1) ? leftStick.dx : leftStick.dy; - return std::clamp(value / Joystick::JoystickMax, 0, 1.0f); + return std::clamp(value / Joystick::JoystickMax, -1.0f, 1.0f); } else if (index == 2 || index == 3) { @@ -176,7 +176,7 @@ float Joystick::GetAxis(int index) irrstCstickRead(&rightStick); float value = (index == 3) ? rightStick.dx : rightStick.dy; - return std::clamp(value / Joystick::JoystickMax, 0, 1.0f); + return std::clamp(value / Joystick::JoystickMax, -1.0f, 1.0f); } else if (index == 4) {