Merged last minute fixes from force feedback branch (r4031, r4033, r4034)
authorSam Lantinga <slouken@libsdl.org>
Mon, 25 Aug 2008 10:04:06 +0000
changeset 27141d1be6137875
parent 2713 0906692aa6a4
child 2715 336b604ec15b
Merged last minute fixes from force feedback branch (r4031, r4033, r4034)
configure.in
src/haptic/win32/SDL_syshaptic.c
src/video/win32/SDL_win32window.c
     1.1 --- a/configure.in	Mon Aug 25 09:55:03 2008 +0000
     1.2 +++ b/configure.in	Mon Aug 25 10:04:06 2008 +0000
     1.3 @@ -1869,7 +1869,7 @@
     1.4      if test x$enable_directx = xyes; then
     1.5          AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
     1.6          AC_CHECK_HEADER(dsound.h, have_dsound=yes)
     1.7 -        AC_CHECK_HEADER(dinput.h, use_dinput=yes)
     1.8 +        AC_CHECK_HEADER(dinput.h, have_dinput=yes)
     1.9      fi
    1.10  }
    1.11  
     2.1 --- a/src/haptic/win32/SDL_syshaptic.c	Mon Aug 25 09:55:03 2008 +0000
     2.2 +++ b/src/haptic/win32/SDL_syshaptic.c	Mon Aug 25 10:04:06 2008 +0000
     2.3 @@ -188,7 +188,8 @@
     2.4      }
     2.5  
     2.6      /* Look for haptic devices. */
     2.7 -    ret = IDirectInput_EnumDevices(dinput, 0,   /* Not sure if this is legal, but gets all devices. */
     2.8 +    ret = IDirectInput_EnumDevices(dinput,
     2.9 +                                   0,
    2.10                                     EnumHapticsCallback,
    2.11                                     NULL,
    2.12                                     DIEDFL_FORCEFEEDBACK |
     3.1 --- a/src/video/win32/SDL_win32window.c	Mon Aug 25 09:55:03 2008 +0000
     3.2 +++ b/src/video/win32/SDL_win32window.c	Mon Aug 25 10:04:06 2008 +0000
     3.3 @@ -49,8 +49,8 @@
     3.4  
     3.5  /* Fake window to help with DirectInput events. */
     3.6  HWND SDL_HelperWindow = NULL;
     3.7 -static const char *SDL_HelperWindowClassName = "SDLHelperWindowInputCatcher";
     3.8 -static const char *SDL_HelperWindowName = "SDLHelperWindowInputMsgWindow";
     3.9 +static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher");
    3.10 +static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow");
    3.11  static ATOM SDL_HelperWindowClass = 0;
    3.12  
    3.13  static int
    3.14 @@ -487,14 +487,14 @@
    3.15      WNDCLASSEX wce;
    3.16  
    3.17      /* Create the class. */
    3.18 -    SDL_memset(&wce, 0, sizeof(wce));
    3.19 +    SDL_zero(wce);
    3.20      wce.cbSize = sizeof(WNDCLASSEX);
    3.21      wce.lpfnWndProc = DefWindowProcA;
    3.22      wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName;
    3.23      wce.hInstance = hInstance;
    3.24  
    3.25      /* Register the class. */
    3.26 -    SDL_HelperWindowClass = RegisterClassExA(&wce);
    3.27 +    SDL_HelperWindowClass = RegisterClassEx(&wce);
    3.28      if (SDL_HelperWindowClass == 0) {
    3.29          SDL_SetError("Unable to create Helper Window Class: error %d.",
    3.30                       GetLastError());
    3.31 @@ -502,12 +502,12 @@
    3.32      }
    3.33  
    3.34      /* Create the window. */
    3.35 -    SDL_HelperWindow = CreateWindowExA(0, SDL_HelperWindowClassName,
    3.36 -                                       SDL_HelperWindowName,
    3.37 -                                       WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
    3.38 -                                       CW_USEDEFAULT, CW_USEDEFAULT,
    3.39 -                                       CW_USEDEFAULT, HWND_MESSAGE, NULL,
    3.40 -                                       hInstance, NULL);
    3.41 +    SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName,
    3.42 +                                      SDL_HelperWindowName,
    3.43 +                                      WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
    3.44 +                                      CW_USEDEFAULT, CW_USEDEFAULT,
    3.45 +                                      CW_USEDEFAULT, HWND_MESSAGE, NULL,
    3.46 +                                      hInstance, NULL);
    3.47      if (SDL_HelperWindow == NULL) {
    3.48          SDL_SetError("Unable to create Helper Window: error %d.",
    3.49                       GetLastError());
    3.50 @@ -532,7 +532,7 @@
    3.51  
    3.52      /* Unregister the class. */
    3.53      if (SDL_HelperWindowClass) {
    3.54 -        UnregisterClassA(SDL_HelperWindowClassName, GetModuleHandleA(NULL));
    3.55 +        UnregisterClass(SDL_HelperWindowClassName, GetModuleHandleA(NULL));
    3.56          SDL_HelperWindowClass = 0;
    3.57      }
    3.58  }