summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-04-20 15:32:33 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-04-21 14:22:19 +1000
commit5870d507cee8547c0993791195fe04d96b271289 (patch)
treee58dc51a74b4e523ae365997f7499598d92e3aa9
parent8ae90552f95f025ad09a17258d56603a424ca076 (diff)
dix: split softening and constant deceleration into two functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
-rw-r--r--dix/ptrveloc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 98468bc8e..a7101fcf7 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -709,7 +709,7 @@ ApplySimpleSoftening(int prev_delta, int delta)
static void
-ApplySofteningAndConstantDeceleration(
+ApplySoftening(
DeviceVelocityPtr vel,
int dx,
int dy,
@@ -724,7 +724,11 @@ ApplySofteningAndConstantDeceleration(
*fdx = dx;
*fdy = dy;
}
+}
+static void
+ApplyConstantDeceleration(DeviceVelocityPtr vel, float *fdx, float *fdy)
+{
*fdx *= vel->const_acceleration;
*fdy *= vel->const_acceleration;
}
@@ -1149,10 +1153,11 @@ acceleratePointerPredictable(
(float)dev->ptrfeed->ctrl.den);
if(mult != 1.0f || velocitydata->const_acceleration != 1.0f) {
- ApplySofteningAndConstantDeceleration(velocitydata,
- dx, dy,
- &fdx, &fdy,
- (mult > 1.0f) && soften);
+ ApplySoftening(velocitydata,
+ dx, dy,
+ &fdx, &fdy,
+ (mult > 1.0f) && soften);
+ ApplyConstantDeceleration(velocitydata, &fdx, &fdy);
/* Calculate the new delta (with accel) and drop it back
* into the valuator masks */