[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: dinput: Move gain support from effect to device
From: Vitaliy Margolen <wine-devel () kievinfo ! com>
Date: 2009-01-30 1:58:34
Message-ID: 49825ECA.4040308 () kievinfo ! com
[Download RAW message or body]
Vincent Pelletier wrote:
> Hi.
>
> Windows supports setting force feedback effect gain at 2 levels:
> - device
> - effect
> There is support for the former on Linux, but not for the latter.
>
>
> + DWORD ff_gain;
> };
...
> + This->ff_gain = max(0, (int) pd->dwData);
First why do you typecase DWORD to (int) to assign to DWORD? Second DWORD
will always be > 0. If you want to check it against limit then just check it
being <= 10000 otherwise return error.
> + if (This->joyfd != -1) {
You should be checking This->base.acquired instead of fd.
> + event.value = This->ff_gain * 0xFFFF / 10000;
You should use MulDiv instead because this can be optimized out by compiler
into something that won't be as accurate.
Vitaliy.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic