From 798172633d5c7f327fb28357db6df9fc91b2fb35 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 25 Jan 2016 17:41:25 -0800 Subject: [PATCH] Move mouse acceleration to the header file --- mouse_movement.cpp | 12 ------------ mouse_movement.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/mouse_movement.cpp b/mouse_movement.cpp index 50046132..eeb89224 100644 --- a/mouse_movement.cpp +++ b/mouse_movement.cpp @@ -64,18 +64,6 @@ void warp_mouse(Key quadrant) { } -// we want the whole s curve, not just the bit -// that's usually above the x and y axes; -#define ATAN_LIMIT 1.57079633 -#define ACCELERATION_FLOOR 0.25 -#define ACCELERATION_MULTIPLIER 5 -#define ACCELERATION_RUNWAY 5 -// Climb speed is how fast we get to max speed -// 1 is "instant" -// 0.05 is just right -// 0.001 is insanely slow - -#define ACCELERATION_CLIMB_SPEED 0.05 double mouse_accel (double cycles) { double accel = (atan((cycles * ACCELERATION_CLIMB_SPEED)-ACCELERATION_RUNWAY) + ATAN_LIMIT) * ACCELERATION_MULTIPLIER; diff --git a/mouse_movement.h b/mouse_movement.h index 20657a88..a22e8ccc 100644 --- a/mouse_movement.h +++ b/mouse_movement.h @@ -24,3 +24,19 @@ int next_height; int section_top; int section_left; boolean is_warping = false; + + +// Mouse acceleration + +// we want the whole s curve, not just the bit +// that's usually above the x and y axes; +#define ATAN_LIMIT 1.57079633 +#define ACCELERATION_FLOOR 0.25 +#define ACCELERATION_MULTIPLIER 5 +#define ACCELERATION_RUNWAY 5 +// Climb speed is how fast we get to max speed +// 1 is "instant" +// 0.05 is just right +// 0.001 is insanely slow + +#define ACCELERATION_CLIMB_SPEED 0.05