Artur Szymiec wrote:
Here is attached patch for joystick_linuxinput.c where bug in dead zone calculation make joystick unusable. After correction tested in two games and works properly.
Best Regards Artur Szymiec
Thanks for spotting the problem. Unfortunately your patch has few problems too. I'll sending a better patch.
Vitaliy.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Vitaliy Margolen napisał(a):
Artur Szymiec wrote:
Here is attached patch for joystick_linuxinput.c where bug in dead zone calculation make joystick unusable. After correction tested in two games and works properly.
Best Regards Artur Szymiec
Thanks for spotting the problem. Unfortunately your patch has few problems too. I'll sending a better patch.
Vitaliy.
Thanks for reviewing the patch. Could you please explain to me what's wrong with this patch. What kind of problems do you mean ?
Best Regrads Artur
- -- - -------------------------------------------------------------------------- Registered User No 397465 Linux Debian 2.6.21-2-k7 i686 AMD Athlon(tm) XP 2800+ Conquer your Desktop! http://www.spreadkde.org/try_kde Reclaim Your Inbox! http://www.mozilla.org/products/thunderbird/ - --------------------------------------------------------------------------
Artur Szymiec wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Vitaliy Margolen napisał(a):
Artur Szymiec wrote:
Here is attached patch for joystick_linuxinput.c where bug in dead zone calculation make joystick unusable. After correction tested in two games and works properly.
Best Regards Artur Szymiec
Thanks for spotting the problem. Unfortunately your patch has few problems too. I'll sending a better patch.
Vitaliy.
Thanks for reviewing the patch. Could you please explain to me what's wrong with this patch. What kind of problems do you mean ?
You calculating center wrong:
- ret = (props->lMax-props->lMin)/2;
This won't work for min=1000 max=2000.
Vitaliy.
Artur Szymiec wrote:
Here is attached patch for joystick_linuxinput.c where bug in dead zone calculation make joystick unusable. After correction tested in two games and works properly.
Thanks for spotting the problem. Unfortunately your patch has few problems too. I'll sending a better patch.
What kind of problems do you mean ?
You calculating center wrong:
- ret = (props->lMax-props->lMin)/2;
This won't work for min=1000 max=2000.
But it does. Maybe you meant if min/max were switched? In such case
ret = (props->lMax-props->lMin)/2; if (props->lMax < props->lMin) ret = -ret;
Cheers, Kuba
Kuba Ober wrote:
You calculating center wrong:
- ret = (props->lMax-props->lMin)/2;
This won't work for min=1000 max=2000.
But it does. Maybe you meant if min/max were switched? In such case
ret = (props->lMax-props->lMin)/2; if (props->lMax < props->lMin) ret = -ret;
Cheers, Kuba
If ret is meant to have a value that is half way between props->lMax and props->lMin, then I believe there should be a "+" between them, not a "-". In other words:
ret = (props->lMax + props->lMin) / 2;
On Wednesday 15 August 2007, Andrew Talbot wrote:
Kuba Ober wrote:
You calculating center wrong:
- ret = (props->lMax-props->lMin)/2;
This won't work for min=1000 max=2000.
But it does. Maybe you meant if min/max were switched? In such case
ret = (props->lMax-props->lMin)/2; if (props->lMax < props->lMin) ret = -ret;
Cheers, Kuba
If ret is meant to have a value that is half way between props->lMax and props->lMin, then I believe there should be a "+" between them, not a "-". In other words:
ret = (props->lMax + props->lMin) / 2;
Yeah, another case of one (me) reading what one wants to see, rather than reading what's really there. I feel hilarious, having suggested a non-fix (ret = -ret) ;)
Cheers, Kuba