Commit 8cc44cb8 authored by Lucas Fialho Zawacki's avatar Lucas Fialho Zawacki Committed by Alexandre Julliard

dinput: SetActionMap setting the axis range according to the action format.

parent 79bd7249
...@@ -1483,9 +1483,17 @@ HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface ...@@ -1483,9 +1483,17 @@ HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface
DWORD dwFlags) DWORD dwFlags)
{ {
DIPROPDWORD dp; DIPROPDWORD dp;
DIPROPRANGE dpr;
FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags); FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
dpr.diph.dwSize = sizeof(DIPROPRANGE);
dpr.lMin = lpdiaf->lAxisMin;
dpr.lMax = lpdiaf->lAxisMax;
dpr.diph.dwHeaderSize = sizeof(DIPROPHEADER);
dpr.diph.dwHow = DIPH_DEVICE;
IDirectInputDevice8_SetProperty(iface, DIPROP_RANGE, &dpr.diph);
if (lpdiaf->dwBufferSize > 0) if (lpdiaf->dwBufferSize > 0)
{ {
dp.diph.dwSize = sizeof(DIPROPDWORD); dp.diph.dwSize = sizeof(DIPROPDWORD);
......
...@@ -132,6 +132,7 @@ static BOOL CALLBACK enumeration_callback( ...@@ -132,6 +132,7 @@ static BOOL CALLBACK enumeration_callback(
{ {
HRESULT hr; HRESULT hr;
DIPROPDWORD dp; DIPROPDWORD dp;
DIPROPRANGE dpr;
struct enum_data *data = pvRef; struct enum_data *data = pvRef;
if (!data) return DIENUM_CONTINUE; if (!data) return DIENUM_CONTINUE;
...@@ -179,6 +180,20 @@ static BOOL CALLBACK enumeration_callback( ...@@ -179,6 +180,20 @@ static BOOL CALLBACK enumeration_callback(
ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr);
ok (dp.dwData == data->lpdiaf->dwBufferSize, "SetActionMap must set the buffer, buffersize=%d\n", dp.dwData); ok (dp.dwData == data->lpdiaf->dwBufferSize, "SetActionMap must set the buffer, buffersize=%d\n", dp.dwData);
/* Test axis range */
memset(&dpr, 0, sizeof(dpr));
dpr.diph.dwSize = sizeof(dpr);
dpr.diph.dwHeaderSize = sizeof(DIPROPHEADER);
dpr.diph.dwHow = DIPH_DEVICE;
hr = IDirectInputDevice_GetProperty(lpdid, DIPROP_RANGE, &dpr.diph);
/* Only test if device supports the range property */
if (SUCCEEDED(hr))
{
ok (dpr.lMin == data->lpdiaf->lAxisMin, "SetActionMap must set the min axis range expected=%d got=%d\n", data->lpdiaf->lAxisMin, dpr.lMin);
ok (dpr.lMax == data->lpdiaf->lAxisMax, "SetActionMap must set the max axis range expected=%d got=%d\n", data->lpdiaf->lAxisMax, dpr.lMax);
}
/* SetActionMap has set the data format so now it should work */ /* SetActionMap has set the data format so now it should work */
hr = IDirectInputDevice8_Acquire(lpdid); hr = IDirectInputDevice8_Acquire(lpdid);
ok (SUCCEEDED(hr), "Acquire failed hr=%08x\n", hr); ok (SUCCEEDED(hr), "Acquire failed hr=%08x\n", hr);
......
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