src/haptic/darwin/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2604 4eee4d565368
parent 2603 a84ce5ae8936
child 2608 7c7a63f22afa
     1.1 --- a/src/haptic/darwin/SDL_syshaptic.c	Tue Aug 05 15:56:35 2008 +0000
     1.2 +++ b/src/haptic/darwin/SDL_syshaptic.c	Tue Aug 05 16:02:56 2008 +0000
     1.3 @@ -555,14 +555,18 @@
     1.4        case SDL_HAPTIC_CARTESIAN:
     1.5           effect->dwFlags |= FFEFF_CARTESIAN;
     1.6           rglDir[0] = dir->dir[0];
     1.7 -         rglDir[1] = dir->dir[1];
     1.8 -         rglDir[2] = dir->dir[2];
     1.9 +         if (naxes > 1)
    1.10 +            rglDir[1] = dir->dir[1];
    1.11 +         if (naxes > 2)
    1.12 +            rglDir[2] = dir->dir[2];
    1.13           return 0;
    1.14        case SDL_HAPTIC_SPHERICAL:
    1.15           effect->dwFlags |= FFEFF_SPHERICAL;
    1.16           rglDir[0] = dir->dir[0];
    1.17 -         rglDir[1] = dir->dir[1];
    1.18 -         rglDir[2] = dir->dir[2];
    1.19 +         if (naxes > 1)
    1.20 +            rglDir[1] = dir->dir[1];
    1.21 +         if (naxes > 2)
    1.22 +            rglDir[2] = dir->dir[2];
    1.23           return 0;
    1.24  
    1.25        default: