src/haptic/darwin/SDL_syshaptic.c
changeset 13635 701fe6486077
parent 13422 fd6a12de91c7
child 13789 a359f4f93439
     1.1 --- a/src/haptic/darwin/SDL_syshaptic.c	Mon Mar 16 12:25:02 2020 -0700
     1.2 +++ b/src/haptic/darwin/SDL_syshaptic.c	Mon Mar 16 13:28:38 2020 -0700
     1.3 @@ -765,6 +765,10 @@
     1.4              rglDir[2] = dir->dir[2];
     1.5          }
     1.6          return 0;
     1.7 +    case SDL_HAPTIC_FIRST_AXIS:
     1.8 +        effect->dwFlags |= FFEFF_CARTESIAN;
     1.9 +        rglDir[0] = 0;
    1.10 +        return 0;
    1.11  
    1.12      default:
    1.13          return SDL_SetError("Haptic: Unknown direction type.");
    1.14 @@ -813,7 +817,11 @@
    1.15      envelope->dwSize = sizeof(FFENVELOPE);      /* Always should be this. */
    1.16  
    1.17      /* Axes. */
    1.18 -    dest->cAxes = haptic->naxes;
    1.19 +    if (src->constant.direction.type == SDL_HAPTIC_FIRST_AXIS) {
    1.20 +        dest->cAxes = 1;
    1.21 +    } else {
    1.22 +        dest->cAxes = haptic->naxes;
    1.23 +    }
    1.24      if (dest->cAxes > 0) {
    1.25          axes = SDL_malloc(sizeof(DWORD) * dest->cAxes);
    1.26          if (axes == NULL) {