Fixed POV handling on Linux
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1339 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
44c943e651
commit
489ee2b17b
@ -122,23 +122,23 @@ JoystickState Joystick::UpdateState()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
// Compute the new POV angle
|
// Compute the new POV angle
|
||||||
if (myPovX == 1)
|
if (myPovX > 0)
|
||||||
{
|
{
|
||||||
if (myPovY == 1) myState.Axis[Joy::AxisPOV] = 315.f;
|
if (myPovY > 0) myState.Axis[Joy::AxisPOV] = 315.f;
|
||||||
else if (myPovY == -1) myState.Axis[Joy::AxisPOV] = 45.f;
|
else if (myPovY < 0) myState.Axis[Joy::AxisPOV] = 45.f;
|
||||||
else myState.Axis[Joy::AxisPOV] = 0.f;
|
else myState.Axis[Joy::AxisPOV] = 0.f;
|
||||||
}
|
}
|
||||||
else if (myPovX == -1)
|
else if (myPovX < 0)
|
||||||
{
|
{
|
||||||
if (myPovY == 1) myState.Axis[Joy::AxisPOV] = 225.f;
|
if (myPovY > 0) myState.Axis[Joy::AxisPOV] = 225.f;
|
||||||
else if (myPovY == -1) myState.Axis[Joy::AxisPOV] = 135.f;
|
else if (myPovY < 0) myState.Axis[Joy::AxisPOV] = 135.f;
|
||||||
else myState.Axis[Joy::AxisPOV] = 180.f;
|
else myState.Axis[Joy::AxisPOV] = 180.f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (myPovY == 1) myState.Axis[Joy::AxisPOV] = 270.f;
|
if (myPovY > 0) myState.Axis[Joy::AxisPOV] = 270.f;
|
||||||
else if (myPovY == -1) myState.Axis[Joy::AxisPOV] = 90.f;
|
else if (myPovY < 0) myState.Axis[Joy::AxisPOV] = 90.f;
|
||||||
else myState.Axis[Joy::AxisPOV] = -1.f;
|
else myState.Axis[Joy::AxisPOV] = -1.f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user