src/joystick/win32/SDL_dxjoystick.c
branchgsoc2008_nds
changeset 2698 e1da92da346c
parent 2198 fe19afb86473
     1.1 --- a/src/joystick/win32/SDL_dxjoystick.c	Thu Aug 21 12:38:21 2008 +0000
     1.2 +++ b/src/joystick/win32/SDL_dxjoystick.c	Wed Aug 27 04:23:38 2008 +0000
     1.3 @@ -226,8 +226,8 @@
     1.4  
     1.5      result =
     1.6          IDirectInput_CreateDevice(dinput,
     1.7 -                                  &SYS_Joystick[joystick->index].
     1.8 -                                  guidInstance, &device, NULL);
     1.9 +                                  &SYS_Joystick[joystick->index].guidInstance,
    1.10 +                                  &device, NULL);
    1.11      if (FAILED(result)) {
    1.12          SetDIerror("IDirectInput::CreateDevice", result);
    1.13          return (-1);
    1.14 @@ -236,8 +236,8 @@
    1.15      /* Now get the IDirectInputDevice2 interface, instead. */
    1.16      result = IDirectInputDevice_QueryInterface(device,
    1.17                                                 &IID_IDirectInputDevice2,
    1.18 -                                               (LPVOID *) & joystick->
    1.19 -                                               hwdata->InputDevice);
    1.20 +                                               (LPVOID *) & joystick->hwdata->
    1.21 +                                               InputDevice);
    1.22      /* We are done with this object.  Use the stored one from now on. */
    1.23      IDirectInputDevice_Release(device);
    1.24  
    1.25 @@ -249,8 +249,8 @@
    1.26      /* Aquire shared access. Exclusive access is required for forces,
    1.27       * though. */
    1.28      result =
    1.29 -        IDirectInputDevice2_SetCooperativeLevel(joystick->hwdata->
    1.30 -                                                InputDevice, SDL_Window,
    1.31 +        IDirectInputDevice2_SetCooperativeLevel(joystick->hwdata->InputDevice,
    1.32 +                                                SDL_Window,
    1.33                                                  DISCL_EXCLUSIVE |
    1.34                                                  DISCL_BACKGROUND);
    1.35      if (FAILED(result)) {
    1.36 @@ -289,8 +289,8 @@
    1.37  
    1.38          /* reset all accuators. */
    1.39          result =
    1.40 -            IDirectInputDevice2_SendForceFeedbackCommand(joystick->hwdata->
    1.41 -                                                         InputDevice,
    1.42 +            IDirectInputDevice2_SendForceFeedbackCommand(joystick->
    1.43 +                                                         hwdata->InputDevice,
    1.44                                                           DISFFC_RESET);
    1.45  
    1.46          if (FAILED(result)) {
    1.47 @@ -481,9 +481,8 @@
    1.48  
    1.49          case BUTTON:
    1.50              SDL_PrivateJoystickButton_Int(joystick, in->num,
    1.51 -                                          (Uint8) (state.
    1.52 -                                                   rgbButtons[in->ofs -
    1.53 -                                                              DIJOFS_BUTTON0]
    1.54 +                                          (Uint8) (state.rgbButtons[in->ofs -
    1.55 +                                                                    DIJOFS_BUTTON0]
    1.56                                                     ? SDL_PRESSED :
    1.57                                                     SDL_RELEASED));
    1.58              break;
    1.59 @@ -539,8 +538,8 @@
    1.60                  break;
    1.61              case BUTTON:
    1.62                  SDL_PrivateJoystickButton(joystick, in->num,
    1.63 -                                          (Uint8) (evtbuf[i].
    1.64 -                                                   dwData ? SDL_PRESSED :
    1.65 +                                          (Uint8) (evtbuf[i].dwData ?
    1.66 +                                                   SDL_PRESSED :
    1.67                                                     SDL_RELEASED));
    1.68                  break;
    1.69              case HAT: