src/haptic/windows/SDL_syshaptic.c
changeset 8634 a60eaa04d3fb
parent 8629 4c01875a4620
child 8688 1543a7183f88
     1.1 --- a/src/haptic/windows/SDL_syshaptic.c	Tue Mar 18 12:53:01 2014 -0400
     1.2 +++ b/src/haptic/windows/SDL_syshaptic.c	Tue Mar 18 17:16:28 2014 -0400
     1.3 @@ -507,8 +507,25 @@
     1.4      SDL_Haptic *haptic = (SDL_Haptic *) pvRef;
     1.5  
     1.6      if ((dev->dwType & DIDFT_AXIS) && (dev->dwFlags & DIDOI_FFACTUATOR)) {
     1.7 +        const GUID *guid = &dev->guidType;
     1.8 +        DWORD offset = 0;
     1.9 +        if (DI_GUIDIsSame(guid, &GUID_XAxis)) {
    1.10 +            offset = DIJOFS_X;
    1.11 +        } else if (DI_GUIDIsSame(guid, &GUID_YAxis)) {
    1.12 +            offset = DIJOFS_Y;
    1.13 +        } else if (DI_GUIDIsSame(guid, &GUID_ZAxis)) {
    1.14 +            offset = DIJOFS_Z;
    1.15 +        } else if (DI_GUIDIsSame(guid, &GUID_RxAxis)) {
    1.16 +            offset = DIJOFS_RX;
    1.17 +        } else if (DI_GUIDIsSame(guid, &GUID_RyAxis)) {
    1.18 +            offset = DIJOFS_RY;
    1.19 +        } else if (DI_GUIDIsSame(guid, &GUID_RzAxis)) {
    1.20 +            offset = DIJOFS_RZ;
    1.21 +        } else {
    1.22 +            return DIENUM_CONTINUE;   /* can't use this, go on. */
    1.23 +        }
    1.24  
    1.25 -        haptic->hwdata->axes[haptic->naxes] = dev->dwOfs;
    1.26 +        haptic->hwdata->axes[haptic->naxes] = offset;
    1.27          haptic->naxes++;
    1.28  
    1.29          /* Currently using the artificial limit of 3 axes. */