X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=Joystick.m;h=e729edb987a31ae5ba0ce7da0df439c1c58b7bd1;hp=c86a3637a19a6460df653108bf0d835664056834;hb=ffbf6e3d236b35d5c084deafe5e63e8effb01903;hpb=2fb801b58b29997f54443d9879d2e20ae8b169ad 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; }