From dec7875a6e23212021e4d9080330a42832dfe02a Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Tue, 15 Jun 2021 01:40:19 +0000
Subject: [PATCH] update SDL soruce to 2.0.14
---
source/src/haptic/windows/SDL_dinputhaptic.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/source/src/haptic/windows/SDL_dinputhaptic.c b/source/src/haptic/windows/SDL_dinputhaptic.c
index cccc74f..322afe9 100644
--- a/source/src/haptic/windows/SDL_dinputhaptic.c
+++ b/source/src/haptic/windows/SDL_dinputhaptic.c
@@ -51,10 +51,6 @@
static int
DI_SetError(const char *str, HRESULT err)
{
- /*
- SDL_SetError("Haptic: %s - %s: %s", str,
- DXGetErrorString8A(err), DXGetErrorDescription8A(err));
- */
return SDL_SetError("Haptic error %s", str);
}
@@ -87,7 +83,7 @@
coinitialized = SDL_TRUE;
ret = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER,
- &IID_IDirectInput8, (LPVOID)& dinput);
+ &IID_IDirectInput8, (LPVOID *) &dinput);
if (FAILED(ret)) {
SDL_SYS_HapticQuit();
return DI_SetError("CoCreateInstance", ret);
@@ -589,6 +585,10 @@
if (naxes > 2)
rglDir[2] = dir->dir[2];
return 0;
+ case SDL_HAPTIC_STEERING_AXIS:
+ effect->dwFlags |= DIEFF_CARTESIAN;
+ rglDir[0] = 0;
+ return 0;
default:
return SDL_SetError("Haptic: Unknown direction type.");
@@ -637,7 +637,11 @@
envelope->dwSize = sizeof(DIENVELOPE); /* Always should be this. */
/* Axes. */
- dest->cAxes = haptic->naxes;
+ if (src->constant.direction.type == SDL_HAPTIC_STEERING_AXIS) {
+ dest->cAxes = 1;
+ } else {
+ dest->cAxes = haptic->naxes;
+ }
if (dest->cAxes > 0) {
axes = SDL_malloc(sizeof(DWORD) * dest->cAxes);
if (axes == NULL) {
--
Gitblit v1.9.3