summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-04-20 14:23:29 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-04-21 14:00:44 +1000
commit9e8645cacf5f1c398d7a6e837a36c66cf6cf0c9c (patch)
treedc10e22ddf4ad75b042410645d0f06801d401c67
parent62f4bef82d1252515689420f8aac198e2f29c4f1 (diff)
dix: CalcTracker only uses the tracker, thus only pass the tracker.
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> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--dix/ptrveloc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 474c03128..6cbb35c45 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -572,11 +572,9 @@ FeedTrackers(DeviceVelocityPtr vel, int dx, int dy, int cur_t)
* This assumes linear motion.
*/
static float
-CalcTracker(DeviceVelocityPtr vel, int offset, int cur_t){
- int index = TRACKER_INDEX(vel, offset);
- float dist = sqrt( vel->tracker[index].dx * vel->tracker[index].dx
- + vel->tracker[index].dy * vel->tracker[index].dy);
- int dtime = cur_t - vel->tracker[index].time;
+CalcTracker(const MotionTracker *tracker, int cur_t){
+ float dist = sqrt(tracker->dx * tracker->dx + tracker->dy * tracker->dy);
+ int dtime = cur_t - tracker->time;
if(dtime > 0)
return dist / dtime;
else
@@ -621,7 +619,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t){
break;
}
- tmp = CalcTracker(vel, offset, cur_t) * vfac;
+ tmp = CalcTracker(&vel->tracker[n], cur_t) * vfac;
if ((iveloc == 0 || offset <= vel->initial_range) && tmp != 0) {
/* set initial velocity and result */