Fixed goofy logic in haptic device comparison code.
Mitchell Keith Bloch did the research on this bug, and came up with a slightly different patch than this. Partially fixes Bugzilla #2126.main
parent
54dce3f53a
commit
6e1169ddc2
|
@ -636,9 +636,11 @@ SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick)
|
||||||
int
|
int
|
||||||
SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
|
SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
|
||||||
{
|
{
|
||||||
if ((joystick->hwdata->bXInputHaptic == haptic->hwdata->bXInputHaptic) && (haptic->hwdata->userid == joystick->hwdata->userid)) {
|
if ((joystick->hwdata->bXInputHaptic != haptic->hwdata->bXInputHaptic) {
|
||||||
return 1;
|
return 0; /* one is XInput, one is not; not the same device. */
|
||||||
} else {
|
} else if (joystick->hwdata->bXInputHaptic) { /* XInput */
|
||||||
|
return (haptic->hwdata->userid == joystick->hwdata->userid);
|
||||||
|
} else { /* DirectInput */
|
||||||
HRESULT ret;
|
HRESULT ret;
|
||||||
DIDEVICEINSTANCE hap_instance, joy_instance;
|
DIDEVICEINSTANCE hap_instance, joy_instance;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue