Skip to content

Commit

Permalink
Add workaround for in-game inverty Y axis option.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdoeffinger committed Feb 28, 2018
1 parent 5e3fea6 commit ca55d65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion impl11/ddraw/joystick.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2016 Reimar Döffinger
// Copyright (c) 2016-2018 Reimar Döffinger
// Licensed under the MIT license. See LICENSE.txt

#include "config.h"
Expand Down Expand Up @@ -119,6 +119,8 @@ UINT WINAPI emulJoyGetPosEx(UINT joy, struct joyinfoex_tag *pji)
pji->dwXpos = state.Gamepad.sThumbLX + 32768;
pji->dwYpos = state.Gamepad.sThumbLY + 32768;
if (g_config.InvertYAxis) pji->dwYpos = 65536 - pji->dwYpos;
// The 65536 value breaks XWA with in-game invert Y axis option
pji->dwYpos = std::min(pji->dwYpos, DWORD(65535));
pji->dwZpos = state.Gamepad.bRightTrigger;
pji->dwRpos = state.Gamepad.sThumbRX + 32768;
pji->dwUpos = state.Gamepad.sThumbRY + 32768;
Expand Down

0 comments on commit ca55d65

Please sign in to comment.