mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
DInputJoystick: Always exclude XInput
Yeah, yeah, it's possible that some guy would try to build DInput without XInput, but they're crazy, and I doubt it would have worked since the header file mess was so fragile anyway. Always exclude DInput devices when we don't have XInput.
This commit is contained in:
@ -37,7 +37,6 @@ static const struct
|
|||||||
|
|
||||||
#define DATA_BUFFER_SIZE 32
|
#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,
|
// 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
|
// faster than checking all the devices for each DirectInput device, like MSDN says to do
|
||||||
@ -141,7 +140,6 @@ LCleanup:
|
|||||||
if( bCleanupCOM )
|
if( bCleanupCOM )
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices, HWND hwnd)
|
void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices, HWND hwnd)
|
||||||
{
|
{
|
||||||
@ -152,21 +150,18 @@ void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices
|
|||||||
// multiple joysticks with the same name shall get unique ids starting at 0
|
// multiple joysticks with the same name shall get unique ids starting at 0
|
||||||
std::map< std::basic_string<TCHAR>, int> name_counts;
|
std::map< std::basic_string<TCHAR>, int> name_counts;
|
||||||
|
|
||||||
#ifdef NO_DUPLICATE_DINPUT_XINPUT
|
|
||||||
std::vector<DWORD> xinput_guids;
|
std::vector<DWORD> xinput_guids;
|
||||||
GetXInputGUIDS( xinput_guids );
|
GetXInputGUIDS( xinput_guids );
|
||||||
#endif
|
|
||||||
|
|
||||||
std::list<DIDEVICEINSTANCE>::iterator
|
std::list<DIDEVICEINSTANCE>::iterator
|
||||||
i = joysticks.begin(),
|
i = joysticks.begin(),
|
||||||
e = joysticks.end();
|
e = joysticks.end();
|
||||||
for ( ; i!=e; ++i )
|
for ( ; i!=e; ++i )
|
||||||
{
|
{
|
||||||
#ifdef NO_DUPLICATE_DINPUT_XINPUT
|
|
||||||
// skip XInput Devices
|
// skip XInput Devices
|
||||||
if ( std::find( xinput_guids.begin(), xinput_guids.end(), i->guidProduct.Data1 ) != xinput_guids.end() )
|
if ( std::find( xinput_guids.begin(), xinput_guids.end(), i->guidProduct.Data1 ) != xinput_guids.end() )
|
||||||
continue;
|
continue;
|
||||||
#endif
|
|
||||||
LPDIRECTINPUTDEVICE8 js_device;
|
LPDIRECTINPUTDEVICE8 js_device;
|
||||||
if (SUCCEEDED(idi8->CreateDevice(i->guidInstance, &js_device, NULL)))
|
if (SUCCEEDED(idi8->CreateDevice(i->guidInstance, &js_device, NULL)))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user