Commit b77fa81a authored by Sam Lantinga's avatar Sam Lantinga

Merged last minute fixes from force feedback branch (r4031, r4033, r4034)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403162
parent 4fd9c25f
...@@ -1869,7 +1869,7 @@ AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default= ...@@ -1869,7 +1869,7 @@ AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default=
if test x$enable_directx = xyes; then if test x$enable_directx = xyes; then
AC_CHECK_HEADER(d3d9.h, have_d3d=yes) AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
AC_CHECK_HEADER(dsound.h, have_dsound=yes) AC_CHECK_HEADER(dsound.h, have_dsound=yes)
AC_CHECK_HEADER(dinput.h, use_dinput=yes) AC_CHECK_HEADER(dinput.h, have_dinput=yes)
fi fi
} }
......
...@@ -188,7 +188,8 @@ SDL_SYS_HapticInit(void) ...@@ -188,7 +188,8 @@ SDL_SYS_HapticInit(void)
} }
/* Look for haptic devices. */ /* Look for haptic devices. */
ret = IDirectInput_EnumDevices(dinput, 0, /* Not sure if this is legal, but gets all devices. */ ret = IDirectInput_EnumDevices(dinput,
0,
EnumHapticsCallback, EnumHapticsCallback,
NULL, NULL,
DIEDFL_FORCEFEEDBACK | DIEDFL_FORCEFEEDBACK |
......
...@@ -49,8 +49,8 @@ int highestId = 0; /* the highest id of the tablet context */ ...@@ -49,8 +49,8 @@ int highestId = 0; /* the highest id of the tablet context */
/* Fake window to help with DirectInput events. */ /* Fake window to help with DirectInput events. */
HWND SDL_HelperWindow = NULL; HWND SDL_HelperWindow = NULL;
static const char *SDL_HelperWindowClassName = "SDLHelperWindowInputCatcher"; static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher");
static const char *SDL_HelperWindowName = "SDLHelperWindowInputMsgWindow"; static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow");
static ATOM SDL_HelperWindowClass = 0; static ATOM SDL_HelperWindowClass = 0;
static int static int
...@@ -487,14 +487,14 @@ SDL_HelperWindowCreate(void) ...@@ -487,14 +487,14 @@ SDL_HelperWindowCreate(void)
WNDCLASSEX wce; WNDCLASSEX wce;
/* Create the class. */ /* Create the class. */
SDL_memset(&wce, 0, sizeof(wce)); SDL_zero(wce);
wce.cbSize = sizeof(WNDCLASSEX); wce.cbSize = sizeof(WNDCLASSEX);
wce.lpfnWndProc = DefWindowProcA; wce.lpfnWndProc = DefWindowProcA;
wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName; wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName;
wce.hInstance = hInstance; wce.hInstance = hInstance;
/* Register the class. */ /* Register the class. */
SDL_HelperWindowClass = RegisterClassExA(&wce); SDL_HelperWindowClass = RegisterClassEx(&wce);
if (SDL_HelperWindowClass == 0) { if (SDL_HelperWindowClass == 0) {
SDL_SetError("Unable to create Helper Window Class: error %d.", SDL_SetError("Unable to create Helper Window Class: error %d.",
GetLastError()); GetLastError());
...@@ -502,12 +502,12 @@ SDL_HelperWindowCreate(void) ...@@ -502,12 +502,12 @@ SDL_HelperWindowCreate(void)
} }
/* Create the window. */ /* Create the window. */
SDL_HelperWindow = CreateWindowExA(0, SDL_HelperWindowClassName, SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName,
SDL_HelperWindowName, SDL_HelperWindowName,
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, HWND_MESSAGE, NULL, CW_USEDEFAULT, HWND_MESSAGE, NULL,
hInstance, NULL); hInstance, NULL);
if (SDL_HelperWindow == NULL) { if (SDL_HelperWindow == NULL) {
SDL_SetError("Unable to create Helper Window: error %d.", SDL_SetError("Unable to create Helper Window: error %d.",
GetLastError()); GetLastError());
...@@ -532,7 +532,7 @@ SDL_HelperWindowDestroy(void) ...@@ -532,7 +532,7 @@ SDL_HelperWindowDestroy(void)
/* Unregister the class. */ /* Unregister the class. */
if (SDL_HelperWindowClass) { if (SDL_HelperWindowClass) {
UnregisterClassA(SDL_HelperWindowClassName, GetModuleHandleA(NULL)); UnregisterClass(SDL_HelperWindowClassName, GetModuleHandleA(NULL));
SDL_HelperWindowClass = 0; SDL_HelperWindowClass = 0;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment