aboutsummaryrefslogtreecommitdiff
path: root/src/rumble.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rumble.c')
-rw-r--r--src/rumble.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rumble.c b/src/rumble.c
index 2313d68..2212761 100644
--- a/src/rumble.c
+++ b/src/rumble.c
@@ -2,6 +2,8 @@
I made this a separate source file because Raylib has some quirks
regarding Windows compilation. And I also suppose because it has
some state of its own.
+
+NOTE FOR SPELUNKERS: this requires linking to xinput1_4 AFAIK
*/
#include "controller.h"
@@ -23,16 +25,17 @@ void set_rumble(f32 duration, f32 strength)
state.wRightMotorSpeed = (unsigned)(strength * 65535.0f);
if (XInputSetState(0, &state) == 0){
- timer = FIXED_POINT_ONE * duration;
+ timer = FP_TO_FIXED(duration);
}
}
void poll_rumble(f32 dt)
{
+ // Early return
if(timer <= 0)
return;
- fx32 delta = FIXED_POINT_ONE * dt;
+ fx32 delta = FP_TO_FIXED(dt);
timer -= delta;
if(timer <= 0){