X-Git-Url: https://git.yukkurigames.com/?a=blobdiff_plain;f=Joystick.m;h=e729edb987a31ae5ba0ce7da0df439c1c58b7bd1;hb=8a554859b8457eefa566c839062640fa450424af;hp=c86a3637a19a6460df653108bf0d835664056834;hpb=2fb801b58b29997f54443d9879d2e20ae8b169ad;p=enjoyable.git diff --git a/Joystick.m b/Joystick.m index c86a363..e729edb 100644 --- a/Joystick.m +++ b/Joystick.m @@ -43,10 +43,9 @@ static NSArray *ActionsForElement(IOHIDDeviceRef device, id base) { } else if (usage == kHIDUsage_GD_Hatswitch) { action = [[JSActionHat alloc] initWithIndex:++hats]; } else if (usage >= kHIDUsage_GD_X && usage <= kHIDUsage_GD_Rz) { - // TODO(jfw): Scaling equation doesn't seem right if min != 0. action = [[JSActionAnalog alloc] initWithIndex:++axes - offset:-1.f - scale:2.f / (max - min)]; + rawMin:min + rawMax:max]; } else { continue; }