Fix inverted axis when checking pressed buttons

This commit is contained in:
Vincent Cunningham 2021-02-24 13:38:15 -05:00
parent 0a2756c163
commit 11c51f1b78
1 changed files with 1 additions and 1 deletions

View File

@ -365,7 +365,7 @@ bool CDirectInput::IsButtonPressed(BUTTON & Button)
return JoyPadPovPressed((AI_POV)Button.AxisID, ((uint32_t *)&Device.State.Joy)[Button.Offset]);
case BTNTYPE_JOYSLIDER:
case BTNTYPE_JOYAXE:
return Button.AxisID ? ((uint32_t *)&Device.State.Joy)[Button.Offset] < AXIS_TOP_VALUE : ((uint32_t *)&Device.State.Joy)[Button.Offset] > AXIS_BOTTOM_VALUE;
return Button.AxisID ? ((uint32_t*)&Device.State.Joy)[Button.Offset] > AXIS_BOTTOM_VALUE : ((uint32_t *)&Device.State.Joy)[Button.Offset] < AXIS_TOP_VALUE;
}
return false;
}