Merge pull request #8285 from lioncash/dinput-ffe
InputCommon/DInputJoystick: Correct force-feedback flag testing
This commit is contained in:
commit
64c0ff576c
|
@ -164,9 +164,8 @@ Joystick::Joystick(/*const LPCDIDEVICEINSTANCE lpddi, */ const LPDIRECTINPUTDEVI
|
||||||
if (SUCCEEDED(m_device->EnumObjects(DIEnumDeviceObjectsCallback, (LPVOID)&objects, DIDFT_AXIS)))
|
if (SUCCEEDED(m_device->EnumObjects(DIEnumDeviceObjectsCallback, (LPVOID)&objects, DIDFT_AXIS)))
|
||||||
{
|
{
|
||||||
const int num_ff_axes =
|
const int num_ff_axes =
|
||||||
std::count_if(std::begin(objects), std::end(objects), [](DIDEVICEOBJECTINSTANCE& pdidoi) {
|
std::count_if(std::begin(objects), std::end(objects),
|
||||||
return pdidoi.dwFlags && DIDOI_FFACTUATOR;
|
[](const auto& pdidoi) { return (pdidoi.dwFlags & DIDOI_FFACTUATOR) != 0; });
|
||||||
});
|
|
||||||
InitForceFeedback(m_device, num_ff_axes);
|
InitForceFeedback(m_device, num_ff_axes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue