diff options
| author | degasus <wickmarkus@web.de> | 2013-01-24 16:58:28 +0100 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2013-01-24 16:58:28 +0100 |
| commit | e0ffdda26e5fb34b2f0d59d5d45b0deda9c90c19 (patch) | |
| tree | 8e289ea93c97fe7430ae501200b60327f572c7e2 /Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp | |
| parent | d5748ebaef93cd601ae6ab5e12f39dd201593ad0 (diff) | |
| parent | d60cc373d1b389215eb63c4e20fe24e902680c7a (diff) | |
Merge branch 'immediate-removal' into GLSL-master
Conflicts:
Source/Core/VideoCommon/Src/PixelShaderGen.cpp
Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp
immediate-removal is a new created branch seperated from master but reverted the revert of immediate-removal
so we get less conflicts by merging
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp')
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp index 08d62bcfc1..9bc5364e76 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp @@ -254,9 +254,9 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI for (unsigned int offset = 0; offset < DIJOFS_BUTTON(0) / sizeof(LONG); ++offset) { range.diph.dwObj = offset * sizeof(LONG); - // try to set some nice power of 2 values (8192) - range.lMin = -(1 << 13); - range.lMax = (1 << 13); + // try to set some nice power of 2 values (128) to match the GameCube controls + range.lMin = -(1 << 7); + range.lMax = (1 << 7); m_device->SetProperty(DIPROP_RANGE, &range.diph); // but i guess not all devices support setting range // so i getproperty right afterward incase it didn't set :P @@ -267,8 +267,8 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI const LONG& ax = (&m_state_in.lX)[offset]; // each axis gets a negative and a positive input instance associated with it - AddInput(new Axis(offset, ax, base, range.lMin-base)); - AddInput(new Axis(offset, ax, base, range.lMax-base)); + AddAnalogInputs(new Axis(offset, ax, base, range.lMin-base), + new Axis(offset, ax, base, range.lMax-base)); } } @@ -281,17 +281,19 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI if ( objects.size() ) { // temporary - DWORD rgdwAxes[] = {DIJOFS_X, DIJOFS_Y}; - LONG rglDirection[] = {0, 0}; + DWORD rgdwAxes[2] = {DIJOFS_X, DIJOFS_Y}; + LONG rglDirection[2] = {-200, 0}; DIEFFECT eff; ZeroMemory(&eff, sizeof(eff)); eff.dwSize = sizeof(DIEFFECT); eff.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS; eff.dwDuration = INFINITE; // (4 * DI_SECONDS) + eff.dwSamplePeriod = 0; eff.dwGain = DI_FFNOMINALMAX; eff.dwTriggerButton = DIEB_NOTRIGGER; - eff.cAxes = std::min((DWORD)2, (DWORD)objects.size()); + eff.dwTriggerRepeatInterval = 0; + eff.cAxes = std::min((DWORD)1, (DWORD)objects.size()); eff.rgdwAxes = rgdwAxes; eff.rglDirection = rglDirection; @@ -310,7 +312,12 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI { // ugly if ladder if (0 == f) + { + DICONSTANTFORCE diCF = {-10000}; + diCF.lMagnitude = DI_FFNOMINALMAX; eff.cbTypeSpecificParams = sizeof(DICONSTANTFORCE); + eff.lpvTypeSpecificParams = &diCF; + } else if (1 == f) eff.cbTypeSpecificParams = sizeof(DIRAMPFORCE); else |
