forked from Clones/Controlify
✏️ Make rumble effects merge together rather than pausing one another when playing in unison (plays the stronger magnitude for both motors)
This commit is contained in:
@ -91,16 +91,9 @@ public class SingleJoystickController extends AbstractController<JoystickState,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setRumble(float strongMagnitude, float weakMagnitude, RumbleSource source) {
|
||||
public boolean setRumble(float strongMagnitude, float weakMagnitude) {
|
||||
if (!supportsRumble()) return false;
|
||||
|
||||
var strengthMod = config().getRumbleStrength(source);
|
||||
if (source != RumbleSource.MASTER)
|
||||
strengthMod *= config().getRumbleStrength(RumbleSource.MASTER);
|
||||
|
||||
strongMagnitude *= strengthMod;
|
||||
weakMagnitude *= strengthMod;
|
||||
|
||||
// the duration doesn't matter because we are not updating the joystick state,
|
||||
// so there is never any SDL check to stop the rumble after the desired time.
|
||||
if (!SDL.SDL_JoystickRumbleTriggers(ptrJoystick, (int)(strongMagnitude * 65535.0F), (int)(weakMagnitude * 65535.0F), 1)) {
|
||||
|
Reference in New Issue
Block a user