some trivial changes regarding C compat, indentation, etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Simon Thum 2008-07-23 12:10:52 +02:00 committed by Peter Hutterer
parent 3209bd21d0
commit 805f28e96c
2 changed files with 17 additions and 8 deletions

View File

@ -458,7 +458,10 @@ ApplySofteningAndConstantDeceleration(
* Polynomial function similar previous one, but with f(1) = 1 * Polynomial function similar previous one, but with f(1) = 1
*/ */
static float 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); return pow(pVel->velocity, (acc - 1.0) * 0.5);
} }
@ -474,7 +477,6 @@ ClassicProfile(
float threshold, float threshold,
float acc) float acc)
{ {
if (threshold) { if (threshold) {
return SimpleSmoothProfile (pVel, return SimpleSmoothProfile (pVel,
threshold, threshold,
@ -516,7 +518,8 @@ PowerProfile(
* just a smooth function in [0..1] -> [0..1] * just a smooth function in [0..1] -> [0..1]
* - point symmetry at 0.5 * - point symmetry at 0.5
* - f'(0) = f'(1) = 0 * - 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 static inline float
CalcPenumbralGradient(float x){ CalcPenumbralGradient(float x){
@ -561,13 +564,15 @@ SmoothLinearProfile(
float threshold, float threshold,
float acc) float acc)
{ {
float res, nv;
if(acc > 1.0f) if(acc > 1.0f)
acc -= 1.0f; /*this is so acc = 1 is no acceleration */ acc -= 1.0f; /*this is so acc = 1 is no acceleration */
else else
return 1.0f; return 1.0f;
float nv = (pVel->velocity - threshold) * acc * 0.5f; nv = (pVel->velocity - threshold) * acc * 0.5f;
float res;
if(nv < 0){ if(nv < 0){
res = 0; res = 0;
}else if(nv < 2){ }else if(nv < 2){
@ -696,8 +701,12 @@ GetDevicePredictableAccelData(
* enable fine-grained predictable acceleration profiles. * enable fine-grained predictable acceleration profiles.
*/ */
void void
acceleratePointerPredictable(DeviceIntPtr pDev, int first_valuator, acceleratePointerPredictable(
int num_valuators, int *valuators, int evtime) DeviceIntPtr pDev,
int first_valuator,
int num_valuators,
int *valuators,
int evtime)
{ {
float mult = 0.0; float mult = 0.0;
int dx = 0, dy = 0; int dx = 0, dy = 0;

View File

@ -138,7 +138,7 @@ ProcessVelocityConfiguration(char* devname, pointer list, DeviceVelocityPtr s){
s->min_acceleration = 1.0 / tempf; /* set minimum acceleration */ s->min_acceleration = 1.0 / tempf; /* set minimum acceleration */
} }
tempf = xf86SetRealOption(list, "VelocityCoupling", 0.2); tempf = xf86SetRealOption(list, "VelocityCoupling", 0.25);
xf86Msg(X_CONFIG, "%s: (accel) velocity coupling is %.1f%%\n", devname, xf86Msg(X_CONFIG, "%s: (accel) velocity coupling is %.1f%%\n", devname,
tempf*100.0); tempf*100.0);
s->coupling = tempf; s->coupling = tempf;