diff options
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp')
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp index 916d142149..fa33595ee8 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp @@ -1,10 +1,14 @@ -#include "../ControllerInterface.h" - -#ifdef CIFACE_USE_DINPUT_JOYSTICK #include "DInputJoystick.h" #include "DInput.h" +#include <map> +#include <sstream> +#include <algorithm> + +#include <wbemidl.h> +#include <oleauto.h> + namespace ciface { namespace DInput @@ -36,7 +40,6 @@ static const struct #define DATA_BUFFER_SIZE 32 -#ifdef NO_DUPLICATE_DINPUT_XINPUT //----------------------------------------------------------------------------- // Modified some MSDN code to get all the XInput device GUID.Data1 values in a vector, // faster than checking all the devices for each DirectInput device, like MSDN says to do @@ -140,9 +143,8 @@ LCleanup: if( bCleanupCOM ) CoUninitialize(); } -#endif -void InitJoystick(IDirectInput8* const idi8, std::vector<ControllerInterface::Device*>& devices, HWND hwnd) +void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices, HWND hwnd) { std::list<DIDEVICEINSTANCE> joysticks; idi8->EnumDevices( DI8DEVCLASS_GAMECTRL, DIEnumDevicesCallback, (LPVOID)&joysticks, DIEDFL_ATTACHEDONLY ); @@ -151,21 +153,18 @@ void InitJoystick(IDirectInput8* const idi8, std::vector<ControllerInterface::De // multiple joysticks with the same name shall get unique ids starting at 0 std::map< std::basic_string<TCHAR>, int> name_counts; -#ifdef NO_DUPLICATE_DINPUT_XINPUT std::vector<DWORD> xinput_guids; GetXInputGUIDS( xinput_guids ); -#endif std::list<DIDEVICEINSTANCE>::iterator i = joysticks.begin(), e = joysticks.end(); for ( ; i!=e; ++i ) { -#ifdef NO_DUPLICATE_DINPUT_XINPUT // skip XInput Devices if ( std::find( xinput_guids.begin(), xinput_guids.end(), i->guidProduct.Data1 ) != xinput_guids.end() ) continue; -#endif + LPDIRECTINPUTDEVICE8 js_device; if (SUCCEEDED(idi8->CreateDevice(i->guidInstance, &js_device, NULL))) { @@ -599,5 +598,3 @@ Joystick::Force<P>::Force(u8 index, EffectState& state) } } - -#endif |
