Don't install 0-strength rumble effects.

This commit is contained in:
Themaister 2013-09-26 14:20:54 +02:00
parent 9131e3819e
commit 0314a57577

View File

@ -216,7 +216,7 @@ static bool udev_set_rumble(unsigned i, enum retro_rumble_effect effect, uint16_
// Setting at init seems to work for pads which are hotplugged ... // Setting at init seems to work for pads which are hotplugged ...
// //
// This approach might be cleaner in the end if we end up supporting configurable force feedback. // This approach might be cleaner in the end if we end up supporting configurable force feedback.
if (!pad->has_set_ff[effect]) if (!pad->has_set_ff[effect] && strength)
{ {
struct ff_effect e; struct ff_effect e;
memset(&e, 0, sizeof(e)); memset(&e, 0, sizeof(e));
@ -237,8 +237,8 @@ static bool udev_set_rumble(unsigned i, enum retro_rumble_effect effect, uint16_
pad->has_set_ff[effect] = true; pad->has_set_ff[effect] = true;
pad->effects[effect] = e.id; pad->effects[effect] = e.id;
pad->strength[effect] = strength;
} }
pad->strength[effect] = strength;
if (strength) if (strength)
{ {
@ -348,7 +348,6 @@ static int open_joystick(const char *path)
if (fd < 0) if (fd < 0)
return fd; return fd;
unsigned long evbit[NBITS(EV_MAX)] = {0}; unsigned long evbit[NBITS(EV_MAX)] = {0};
unsigned long keybit[NBITS(KEY_MAX)] = {0}; unsigned long keybit[NBITS(KEY_MAX)] = {0};
unsigned long absbit[NBITS(ABS_MAX)] = {0}; unsigned long absbit[NBITS(ABS_MAX)] = {0};
@ -362,7 +361,6 @@ static int open_joystick(const char *path)
if (!test_bit(EV_KEY, evbit)) if (!test_bit(EV_KEY, evbit))
goto error; goto error;
return fd; return fd;
error: error:
@ -402,7 +400,6 @@ static bool add_pad(unsigned i, int fd, const char *path)
return false; return false;
} }
RARCH_LOG("[udev]: Plugged pad: %s on port #%u.\n", pad->ident, i); RARCH_LOG("[udev]: Plugged pad: %s on port #%u.\n", pad->ident, i);
struct stat st; struct stat st;