src/joystick/iphoneos/SDL_sysjoystick.m
changeset 10499 363c1c7e7a41
parent 10351 12f90eb6b52b
child 10617 346c02ff71b6
     1.1 --- a/src/joystick/iphoneos/SDL_sysjoystick.m	Fri Sep 30 09:26:57 2016 -0400
     1.2 +++ b/src/joystick/iphoneos/SDL_sysjoystick.m	Fri Oct 07 23:40:44 2016 -0700
     1.3 @@ -127,13 +127,11 @@
     1.4      }
     1.5  #if TARGET_OS_TV
     1.6      else if (controller.microGamepad) {
     1.7 -        const char *hint = SDL_GetHint(SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION);
     1.8 -
     1.9          device->naxes = 2; /* treat the touch surface as two axes */
    1.10          device->nhats = 0; /* apparently the touch surface-as-dpad is buggy */
    1.11          device->nbuttons = 3; /* AX, pause button */
    1.12  
    1.13 -        controller.microGamepad.allowsRotation = (hint != NULL && *hint != '0');
    1.14 +        controller.microGamepad.allowsRotation = SDL_GetHintBoolean(SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION, SDL_FALSE);
    1.15      }
    1.16  #endif /* TARGET_OS_TV */
    1.17  
    1.18 @@ -279,8 +277,7 @@
    1.19          NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
    1.20  
    1.21  #if !TARGET_OS_TV
    1.22 -        const char *hint = SDL_GetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK);
    1.23 -        if (!hint || SDL_atoi(hint)) {
    1.24 +        if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_TRUE)) {
    1.25              /* Default behavior, accelerometer as joystick */
    1.26              SDL_SYS_AddJoystickDevice(nil, SDL_TRUE);
    1.27          }