Merge pull request #1974 from flagrama/pj64-input-inverted-axis-checking-button

[Project64-Input] Fix inverted axis when checking pressed buttons
This commit is contained in:
zilmar 2021-02-25 07:46:14 +10:30 committed by GitHub
commit f6008997e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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]); return JoyPadPovPressed((AI_POV)Button.AxisID, ((uint32_t *)&Device.State.Joy)[Button.Offset]);
case BTNTYPE_JOYSLIDER: case BTNTYPE_JOYSLIDER:
case BTNTYPE_JOYAXE: 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; return false;
} }