Mercurial > sdl-ios-xcode
comparison src/haptic/win32/SDL_syshaptic.c @ 2604:4eee4d565368 gsoc2008_force_feedback
Better handling of direction axes.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Tue, 05 Aug 2008 16:02:56 +0000 |
parents | a84ce5ae8936 |
children | 0ea3be6e81a7 |
comparison
equal
deleted
inserted
replaced
2603:a84ce5ae8936 | 2604:4eee4d565368 |
---|---|
566 rglDir[0] = dir->dir[0]; | 566 rglDir[0] = dir->dir[0]; |
567 return 0; | 567 return 0; |
568 case SDL_HAPTIC_CARTESIAN: | 568 case SDL_HAPTIC_CARTESIAN: |
569 effect->dwFlags |= DIEFF_CARTESIAN; | 569 effect->dwFlags |= DIEFF_CARTESIAN; |
570 rglDir[0] = dir->dir[0]; | 570 rglDir[0] = dir->dir[0]; |
571 rglDir[1] = dir->dir[1]; | 571 if (naxes > 1) |
572 rglDir[2] = dir->dir[2]; | 572 rglDir[1] = dir->dir[1]; |
573 if (naxes > 2) | |
574 rglDir[2] = dir->dir[2]; | |
573 return 0; | 575 return 0; |
574 case SDL_HAPTIC_SPHERICAL: | 576 case SDL_HAPTIC_SPHERICAL: |
575 effect->dwFlags |= DIEFF_SPHERICAL; | 577 effect->dwFlags |= DIEFF_SPHERICAL; |
576 rglDir[0] = dir->dir[0]; | 578 rglDir[0] = dir->dir[0]; |
577 rglDir[1] = dir->dir[1]; | 579 if (naxes > 1) |
578 rglDir[2] = dir->dir[2]; | 580 rglDir[1] = dir->dir[1]; |
581 if (naxes > 2) | |
582 rglDir[2] = dir->dir[2]; | |
579 return 0; | 583 return 0; |
580 | 584 |
581 default: | 585 default: |
582 SDL_SetError("Haptic: Unknown direction type."); | 586 SDL_SetError("Haptic: Unknown direction type."); |
583 return -1; | 587 return -1; |