src/joystick/windows/SDL_windowsjoystick.c
changeset 10226 cb13d22b7f09
parent 10147 ddbdc9c1b92f
child 10479 aa816d06ed78
     1.1 --- a/src/joystick/windows/SDL_windowsjoystick.c	Fri Aug 26 11:16:44 2016 -0700
     1.2 +++ b/src/joystick/windows/SDL_windowsjoystick.c	Fri Aug 26 12:18:08 2016 -0700
     1.3 @@ -42,9 +42,6 @@
     1.4  #include "SDL_joystick.h"
     1.5  #include "../SDL_sysjoystick.h"
     1.6  #include "../../thread/SDL_systhread.h"
     1.7 -#if !SDL_EVENTS_DISABLED
     1.8 -#include "../../events/SDL_events_c.h"
     1.9 -#endif
    1.10  #include "../../core/windows/SDL_windows.h"
    1.11  #if !defined(__WINRT__)
    1.12  #include <dbt.h>
    1.13 @@ -327,9 +324,6 @@
    1.14  SDL_SYS_JoystickDetect()
    1.15  {
    1.16      JoyStick_DeviceData *pCurList = NULL;
    1.17 -#if !SDL_EVENTS_DISABLED
    1.18 -    SDL_Event event;
    1.19 -#endif
    1.20  
    1.21      /* only enum the devices if the joystick thread told us something changed */
    1.22      if (!s_bDeviceAdded && !s_bDeviceRemoved) {
    1.23 @@ -361,17 +355,7 @@
    1.24              SDL_DINPUT_MaybeRemoveDevice(&pCurList->dxdevice);
    1.25          }
    1.26  
    1.27 -#if !SDL_EVENTS_DISABLED
    1.28 -        SDL_zero(event);
    1.29 -        event.type = SDL_JOYDEVICEREMOVED;
    1.30 -
    1.31 -        if (SDL_GetEventState(event.type) == SDL_ENABLE) {
    1.32 -            event.jdevice.which = pCurList->nInstanceID;
    1.33 -            if ((!SDL_EventOK) || (*SDL_EventOK) (SDL_EventOKParam, &event)) {
    1.34 -                SDL_PushEvent(&event);
    1.35 -            }
    1.36 -        }
    1.37 -#endif /* !SDL_EVENTS_DISABLED */
    1.38 +        SDL_PrivateJoystickRemoved(pCurList->nInstanceID);
    1.39  
    1.40          pListNext = pCurList->pNext;
    1.41          SDL_free(pCurList->joystickname);
    1.42 @@ -392,17 +376,8 @@
    1.43                      SDL_DINPUT_MaybeAddDevice(&pNewJoystick->dxdevice);
    1.44                  }
    1.45  
    1.46 -#if !SDL_EVENTS_DISABLED
    1.47 -                SDL_zero(event);
    1.48 -                event.type = SDL_JOYDEVICEADDED;
    1.49 +                SDL_PrivateJoystickAdded(device_index);
    1.50  
    1.51 -                if (SDL_GetEventState(event.type) == SDL_ENABLE) {
    1.52 -                    event.jdevice.which = device_index;
    1.53 -                    if ((!SDL_EventOK) || (*SDL_EventOK) (SDL_EventOKParam, &event)) {
    1.54 -                        SDL_PushEvent(&event);
    1.55 -                    }
    1.56 -                }
    1.57 -#endif /* !SDL_EVENTS_DISABLED */
    1.58                  pNewJoystick->send_add_event = SDL_FALSE;
    1.59              }
    1.60              device_index++;