Skip to content

Commit

Permalink
3ds: clamp between -1.0f and 1.0f
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtleP committed Oct 12, 2023
1 parent 8a0e125 commit b441593
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platform/ctr/source/objects/joystick_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ float Joystick<Console::CTR>::GetAxis(int index)
hidCircleRead(&leftStick);

float value = (index == 1) ? leftStick.dx : leftStick.dy;
return std::clamp<float>(value / Joystick::JoystickMax, 0, 1.0f);
return std::clamp<float>(value / Joystick::JoystickMax, -1.0f, 1.0f);
}
else if (index == 2 || index == 3)
{
circlePosition rightStick {};
irrstCstickRead(&rightStick);

float value = (index == 3) ? rightStick.dx : rightStick.dy;
return std::clamp<float>(value / Joystick::JoystickMax, 0, 1.0f);
return std::clamp<float>(value / Joystick::JoystickMax, -1.0f, 1.0f);
}
else if (index == 4)
{
Expand Down

0 comments on commit b441593

Please sign in to comment.