Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Better handling of direction axes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Aug 5, 2008
1 parent 77b2651 commit b21b39a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions src/haptic/darwin/SDL_syshaptic.c
Expand Up @@ -555,14 +555,18 @@ SDL_SYS_SetDirection( FFEFFECT * effect, SDL_HapticDirection *dir, int naxes )
case SDL_HAPTIC_CARTESIAN:
effect->dwFlags |= FFEFF_CARTESIAN;
rglDir[0] = dir->dir[0];
rglDir[1] = dir->dir[1];
rglDir[2] = dir->dir[2];
if (naxes > 1)
rglDir[1] = dir->dir[1];
if (naxes > 2)
rglDir[2] = dir->dir[2];
return 0;
case SDL_HAPTIC_SPHERICAL:
effect->dwFlags |= FFEFF_SPHERICAL;
rglDir[0] = dir->dir[0];
rglDir[1] = dir->dir[1];
rglDir[2] = dir->dir[2];
if (naxes > 1)
rglDir[1] = dir->dir[1];
if (naxes > 2)
rglDir[2] = dir->dir[2];
return 0;

default:
Expand Down
12 changes: 8 additions & 4 deletions src/haptic/win32/SDL_syshaptic.c
Expand Up @@ -568,14 +568,18 @@ SDL_SYS_SetDirection( DIEFFECT * effect, SDL_HapticDirection *dir, int naxes )
case SDL_HAPTIC_CARTESIAN:
effect->dwFlags |= DIEFF_CARTESIAN;
rglDir[0] = dir->dir[0];
rglDir[1] = dir->dir[1];
rglDir[2] = dir->dir[2];
if (naxes > 1)
rglDir[1] = dir->dir[1];
if (naxes > 2)
rglDir[2] = dir->dir[2];
return 0;
case SDL_HAPTIC_SPHERICAL:
effect->dwFlags |= DIEFF_SPHERICAL;
rglDir[0] = dir->dir[0];
rglDir[1] = dir->dir[1];
rglDir[2] = dir->dir[2];
if (naxes > 1)
rglDir[1] = dir->dir[1];
if (naxes > 2)
rglDir[2] = dir->dir[2];
return 0;

default:
Expand Down

0 comments on commit b21b39a

Please sign in to comment.