early-access version 1617
This commit is contained in:
@@ -51,10 +51,6 @@ static LPDIRECTINPUT8 dinput = NULL;
|
||||
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 @@ SDL_DINPUT_HapticInit(void)
|
||||
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 @@ SDL_SYS_SetDirection(DIEFFECT * effect, SDL_HapticDirection * dir, int naxes)
|
||||
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 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest,
|
||||
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) {
|
||||
|
@@ -22,7 +22,6 @@
|
||||
|
||||
#if SDL_HAPTIC_DINPUT || SDL_HAPTIC_XINPUT
|
||||
|
||||
#include "SDL_assert.h"
|
||||
#include "SDL_thread.h"
|
||||
#include "SDL_mutex.h"
|
||||
#include "SDL_timer.h"
|
||||
|
@@ -50,6 +50,7 @@ struct haptic_hwdata
|
||||
/*
|
||||
* Haptic system effect data.
|
||||
*/
|
||||
#if SDL_HAPTIC_DINPUT || SDL_HAPTIC_XINPUT
|
||||
struct haptic_hweffect
|
||||
{
|
||||
#if SDL_HAPTIC_DINPUT
|
||||
@@ -60,6 +61,7 @@ struct haptic_hweffect
|
||||
XINPUT_VIBRATION vibration;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* List of available haptic devices.
|
||||
|
@@ -26,7 +26,6 @@
|
||||
|
||||
#if SDL_HAPTIC_XINPUT
|
||||
|
||||
#include "SDL_assert.h"
|
||||
#include "SDL_hints.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_windowshaptic_c.h"
|
||||
|
Reference in New Issue
Block a user