diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2010-10-09 07:24:33 +0000 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2010-10-09 07:24:33 +0000 |
| commit | cf5639af5459c9c964ba7cf94bcc8fad5c779757 (patch) | |
| tree | 4630e815975c062801ac80c0173e8390345654d0 /Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp | |
| parent | f3b144d5636d4cdf49c00f9c7317100d356a61d8 (diff) | |
GCPad/WiimoteNew: Reordered some stuff in DirectInput device enumeration.(makes certain gamepads work now, hopfully doesn't break other pads) (Thanks to YoD for helping debug) Also fixed something ridiculous in the input config dialog. :p
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6264 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp')
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp index a433dcaa3d..337936f3a4 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp @@ -206,6 +206,21 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI , m_index(index) //, m_name(TStringToString(lpddi->tszInstanceName)) { + // seems this needs to be done before GetCapabilities + // polled or buffered data + DIPROPDWORD dipdw; + dipdw.diph.dwSize = sizeof(DIPROPDWORD); + dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dipdw.diph.dwObj = 0; + dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.dwData = DATA_BUFFER_SIZE; + // set the buffer size, + // if we can't set the property, we can't use buffered data + m_buffered = SUCCEEDED(m_device->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph)); + + // seems this needs to be done after SetProperty of buffer size + m_device->Acquire(); + // get joystick caps DIDEVCAPS js_caps; js_caps.dwSize = sizeof(js_caps); @@ -218,17 +233,6 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI //m_must_poll = (js_caps.dwFlags & DIDC_POLLEDDATAFORMAT) != 0; - // polled or buffered data - DIPROPDWORD dipdw; - dipdw.diph.dwSize = sizeof(DIPROPDWORD); - dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); - dipdw.diph.dwObj = 0; - dipdw.diph.dwHow = DIPH_DEVICE; - dipdw.dwData = DATA_BUFFER_SIZE; - // set the buffer size, - // if we can't set the property, we can't use buffered data - m_buffered = SUCCEEDED(m_device->SetProperty(DIPROP_BUFFERSIZE, &dipdw.diph)); - // buttons for ( unsigned int i = 0; i < js_caps.dwButtons; ++i ) AddInput( new Button( i ) ); @@ -267,9 +271,6 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI } } - // it seems this needs to be done after SetProperty... - m_device->Acquire(); - // TODO: check for DIDC_FORCEFEEDBACK in devcaps? // get supported ff effects |
