diff --git a/gm82joy.c b/gm82joy.c index 7654d99..407f675 100644 --- a/gm82joy.c +++ b/gm82joy.c @@ -227,3 +227,7 @@ GMREAL joy_ball_y(double id, double ball) { } return 0; } + +GMREAL joy_rumble(double id, double strength, double len) { + return SDL_JoystickRumble(sticks[(int)id], (Uint16)(int)strength, (Uint16)(int)strength, (Uint32)(int)len); +} diff --git a/gm82joy.gej b/gm82joy.gej index a489e79..ccb3c04 100644 --- a/gm82joy.gej +++ b/gm82joy.gej @@ -336,6 +336,19 @@ ], "returntype": 2 }, + { + "name": "joystick_rumble", + "extname": "", + "calltype": 2, + "helpline": "", + "hidden": false, + "argtypes": [ + 2, + 2, + 2 + ], + "returntype": 2 + }, { "name": "__gm82joy_call", "extname": "", @@ -427,4 +440,4 @@ "constants": [] } ] -} \ No newline at end of file +} diff --git a/gm82joy.gml b/gm82joy.gml index bfbcd8d..46f2710 100644 --- a/gm82joy.gml +++ b/gm82joy.gml @@ -83,6 +83,7 @@ __gm82joy_define("joy_hat_y" ,ty_real,ty_real) __gm82joy_define("joy_ball_x" ,ty_real,ty_real) __gm82joy_define("joy_ball_y" ,ty_real,ty_real) + __gm82joy_define("joy_rumble" ,ty_real,ty_real,ty_real) __gm82joy_call("joy_init") @@ -385,3 +386,13 @@ return __gm82joy_deadzone(__gm82joy_call("joy_axis",argument0,5)) +#define joystick_rumble + ///joystick_rumble(id,strength,len) + //id: joystick (0-31) + //strength: rumble strength (0-0xFFFF) + //len: length of rumble, in milliseconds (Uint32 ms) + //returns: 0 if rumble is supported by controller, otherwise -1. + //*rumble is joystick's vibration. Useful for making an atmosphere. + return __gm82joy_call("joy_rumble",argument0,argument1,argument2) +// +// \ No newline at end of file