[RFC 6/11] Linux FF: Linux effect: conditional effect's parameters

Andrew Eikum aeikum at codeweavers.com
Wed Mar 5 09:05:55 CST 2014


On Tue, Mar 04, 2014 at 08:20:13PM +0100, Elias Vanderstuyft wrote:
>         for (i = 0; i < 2; ++i) {
>             This->effect.u.condition[i].center = (tsp[i].lOffset / 10) * 32;
>             This->effect.u.condition[i].right_coeff =
> (tsp[i].lPositiveCoefficient / 10) * 32;
>             This->effect.u.condition[i].left_coeff =
> (tsp[i].lNegativeCoefficient / 10) * 32;
>             This->effect.u.condition[i].right_saturation =
> (tsp[i].dwPositiveSaturation / 10) * 65;
>             This->effect.u.condition[i].left_saturation =
> (tsp[i].dwNegativeSaturation / 10) * 65;
>             This->effect.u.condition[i].deadband = (tsp[i].lDeadBand / 10) * 65;
>         }
> 

I agree with this in principle, but I think I would change the
implementation to be a bit more explicit. Something like,
    left_coeff = (lNegativeCoefficient / (double)10000) * 32767;
    right_saturation = (dwPositiveSaturation / (double)10000) * 65535;
which shows an explicit mapping between full ranges. (This might need
some more thinking at the extreme edges of the bounds, so we don't go
out of bounds during type coersion.)

>         - Don't return an error. This seems to be the behavior of the
> Windows Logitech FFB driver (MOMO, MOMO2, ...).

We should match Windows. Sounds like they ignore envelopes for effects
which don't support them, so we should too. Your change looks good. I
would probably use a TRACE instead of WARN, since we're doing the
right thing.

Andrew



More information about the wine-devel mailing list