diff options
author | Simon Thum <simon.thum@gmx.de> | 2008-07-23 12:10:52 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2008-07-28 18:13:19 +0930 |
commit | 805f28e96ceb20bc53792ae3cf17f9c26564ae0e (patch) | |
tree | 15cee70a932d9b0a7c9964e6c0f79f860c31e195 /dix | |
parent | 3209bd21d00b8673d321f70afb65720588ddacb3 (diff) |
some trivial changes regarding C compat, indentation, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/ptrveloc.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index d6cd8c5af..21a2eca48 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -458,7 +458,10 @@ ApplySofteningAndConstantDeceleration( * Polynomial function similar previous one, but with f(1) = 1 */ static float -PolynomialAccelerationProfile(DeviceVelocityPtr pVel, float ignored, float acc) +PolynomialAccelerationProfile( + DeviceVelocityPtr pVel, + float ignored, + float acc) { return pow(pVel->velocity, (acc - 1.0) * 0.5); } @@ -474,7 +477,6 @@ ClassicProfile( float threshold, float acc) { - if (threshold) { return SimpleSmoothProfile (pVel, threshold, @@ -516,7 +518,8 @@ PowerProfile( * just a smooth function in [0..1] -> [0..1] * - point symmetry at 0.5 * - f'(0) = f'(1) = 0 - * - starts faster than sinoids, C1 (Cinf if you dare to ignore endpoints) + * - starts faster than a sinoid + * - smoothness C1 (Cinf if you dare to ignore endpoints) */ static inline float CalcPenumbralGradient(float x){ @@ -561,13 +564,15 @@ SmoothLinearProfile( float threshold, float acc) { + float res, nv; + if(acc > 1.0f) acc -= 1.0f; /*this is so acc = 1 is no acceleration */ else return 1.0f; - float nv = (pVel->velocity - threshold) * acc * 0.5f; - float res; + nv = (pVel->velocity - threshold) * acc * 0.5f; + if(nv < 0){ res = 0; }else if(nv < 2){ @@ -696,8 +701,12 @@ GetDevicePredictableAccelData( * enable fine-grained predictable acceleration profiles. */ void -acceleratePointerPredictable(DeviceIntPtr pDev, int first_valuator, - int num_valuators, int *valuators, int evtime) +acceleratePointerPredictable( + DeviceIntPtr pDev, + int first_valuator, + int num_valuators, + int *valuators, + int evtime) { float mult = 0.0; int dx = 0, dy = 0; |