dinput: Default value for unassigned POVs should be -1.

This commit is contained in:
Vitaliy Margolen 2008-05-08 08:11:19 -06:00 committed by Alexandre Julliard
parent b92d1c7fbe
commit 382ed33b7a
2 changed files with 12 additions and 2 deletions

View File

@ -452,9 +452,12 @@ HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *format)
dt[index].size = sizeof(DWORD); dt[index].size = sizeof(DWORD);
dt[index].offset_in = -1; dt[index].offset_in = -1;
dt[index].offset_out = asked_format->rgodf[j].dwOfs; dt[index].offset_out = asked_format->rgodf[j].dwOfs;
dt[index].value = 0; if (asked_format->rgodf[j].dwType & DIDFT_POV)
dt[index].value = -1;
else
dt[index].value = 0;
index++; index++;
same = 0; same = 0;
} }
} }

View File

@ -324,6 +324,13 @@ static BOOL CALLBACK EnumJoysticks(
ok(hr == S_FALSE, "IDirectInputDevice_Acquire() should have returned S_FALSE, got: %s\n", ok(hr == S_FALSE, "IDirectInputDevice_Acquire() should have returned S_FALSE, got: %s\n",
DXGetErrorString8(hr)); DXGetErrorString8(hr));
if (info.pov < 4)
{
hr = IDirectInputDevice_GetDeviceState(pJoystick, sizeof(DIJOYSTATE2), &js);
ok(hr == DI_OK, "IDirectInputDevice_GetDeviceState() failed: %s\n", DXGetErrorString8(hr));
ok(js.rgdwPOV[3] == -1, "Default for unassigned POV should be -1 not: %d\n", js.rgdwPOV[3]);
}
if (winetest_interactive) { if (winetest_interactive) {
trace("You have 30 seconds to test all axes, sliders, POVs and buttons\n"); trace("You have 30 seconds to test all axes, sliders, POVs and buttons\n");
count = 300; count = 300;