comparison src/joystick/linux/SDL_sysjoystick.c @ 5085:f521f8739611 SDL-1.2

Missed a small part of the patch
author Sam Lantinga <slouken@libsdl.org>
date Mon, 24 Jan 2011 14:34:58 -0800
parents 4c3c2599559b
children
comparison
equal deleted inserted replaced
5084:4c3c2599559b 5085:f521f8739611
714 if ( absinfo.minimum == absinfo.maximum ) { 714 if ( absinfo.minimum == absinfo.maximum ) {
715 joystick->hwdata->abs_correct[i].used = 0; 715 joystick->hwdata->abs_correct[i].used = 0;
716 } else { 716 } else {
717 joystick->hwdata->abs_correct[i].used = 1; 717 joystick->hwdata->abs_correct[i].used = 1;
718 joystick->hwdata->abs_correct[i].coef[0] = 718 joystick->hwdata->abs_correct[i].coef[0] =
719 (absinfo.maximum + absinfo.minimum) / 2 - values[4]; 719 (absinfo.maximum + absinfo.minimum) / 2 - absinfo.flat;
720 joystick->hwdata->abs_correct[i].coef[1] = 720 joystick->hwdata->abs_correct[i].coef[1] =
721 (absinfo.maximum + absinfo.minimum) / 2 + values[4]; 721 (absinfo.maximum + absinfo.minimum) / 2 + absinfo.flat;
722 t = ((absinfo.maximum - absinfo.minimum) / 2 - 2 * values[4]); 722 t = ((absinfo.maximum - absinfo.minimum) / 2 - 2 * absinfo.flat);
723 if ( t != 0 ) { 723 if ( t != 0 ) {
724 joystick->hwdata->abs_correct[i].coef[2] = (1 << 29) / t; 724 joystick->hwdata->abs_correct[i].coef[2] = (1 << 29) / t;
725 } else { 725 } else {
726 joystick->hwdata->abs_correct[i].coef[2] = 0; 726 joystick->hwdata->abs_correct[i].coef[2] = 0;
727 } 727 }