| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | { |
| | | XINPUT_VIBRATION *vib = &effect->hweffect->vibration; |
| | | SDL_assert(data->type == SDL_HAPTIC_LEFTRIGHT); |
| | | vib->wLeftMotorSpeed = data->leftright.large_magnitude; |
| | | vib->wRightMotorSpeed = data->leftright.small_magnitude; |
| | | /* SDL_HapticEffect has max magnitude of 32767, XInput expects 65535 max, so multiply */ |
| | | vib->wLeftMotorSpeed = data->leftright.large_magnitude * 2; |
| | | vib->wRightMotorSpeed = data->leftright.small_magnitude * 2; |
| | | SDL_LockMutex(haptic->hwdata->mutex); |
| | | if (haptic->hwdata->stopTicks) { /* running right now? Update it. */ |
| | | XINPUTSETSTATE(haptic->hwdata->userid, vib); |