src/haptic/darwin/SDL_syshaptic.c
changeset 13635 701fe6486077
parent 13422 fd6a12de91c7
child 13789 a359f4f93439
equal deleted inserted replaced
13634:9a8e6854f652 13635:701fe6486077
   763         }
   763         }
   764         if (naxes > 2) {
   764         if (naxes > 2) {
   765             rglDir[2] = dir->dir[2];
   765             rglDir[2] = dir->dir[2];
   766         }
   766         }
   767         return 0;
   767         return 0;
       
   768     case SDL_HAPTIC_FIRST_AXIS:
       
   769         effect->dwFlags |= FFEFF_CARTESIAN;
       
   770         rglDir[0] = 0;
       
   771         return 0;
   768 
   772 
   769     default:
   773     default:
   770         return SDL_SetError("Haptic: Unknown direction type.");
   774         return SDL_SetError("Haptic: Unknown direction type.");
   771     }
   775     }
   772 }
   776 }
   811     SDL_memset(envelope, 0, sizeof(FFENVELOPE));
   815     SDL_memset(envelope, 0, sizeof(FFENVELOPE));
   812     dest->lpEnvelope = envelope;
   816     dest->lpEnvelope = envelope;
   813     envelope->dwSize = sizeof(FFENVELOPE);      /* Always should be this. */
   817     envelope->dwSize = sizeof(FFENVELOPE);      /* Always should be this. */
   814 
   818 
   815     /* Axes. */
   819     /* Axes. */
   816     dest->cAxes = haptic->naxes;
   820     if (src->constant.direction.type == SDL_HAPTIC_FIRST_AXIS) {
       
   821         dest->cAxes = 1;
       
   822     } else {
       
   823         dest->cAxes = haptic->naxes;
       
   824     }
   817     if (dest->cAxes > 0) {
   825     if (dest->cAxes > 0) {
   818         axes = SDL_malloc(sizeof(DWORD) * dest->cAxes);
   826         axes = SDL_malloc(sizeof(DWORD) * dest->cAxes);
   819         if (axes == NULL) {
   827         if (axes == NULL) {
   820             return SDL_OutOfMemory();
   828             return SDL_OutOfMemory();
   821         }
   829         }