Fix a small formatting issue

This commit is contained in:
Léo Lam 2016-06-24 16:28:27 +02:00
parent d3e2ae35ff
commit 9b075556ea

View File

@ -44,26 +44,15 @@ void InitKeyboardMouse(IDirectInput8* const idi8, HWND _hwnd)
LPDIRECTINPUTDEVICE8 kb_device = nullptr;
LPDIRECTINPUTDEVICE8 mo_device = nullptr;
if (SUCCEEDED(idi8->CreateDevice(GUID_SysKeyboard, &kb_device, nullptr)))
if (SUCCEEDED(idi8->CreateDevice(GUID_SysKeyboard, &kb_device, nullptr)) &&
SUCCEEDED(kb_device->SetDataFormat(&c_dfDIKeyboard)) &&
SUCCEEDED(kb_device->SetCooperativeLevel(nullptr, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)) &&
SUCCEEDED(idi8->CreateDevice(GUID_SysMouse, &mo_device, nullptr)) &&
SUCCEEDED(mo_device->SetDataFormat(&c_dfDIMouse2)) &&
SUCCEEDED(mo_device->SetCooperativeLevel(nullptr, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
{
if (SUCCEEDED(kb_device->SetDataFormat(&c_dfDIKeyboard)))
{
if (SUCCEEDED(kb_device->SetCooperativeLevel(nullptr, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
{
if (SUCCEEDED(idi8->CreateDevice(GUID_SysMouse, &mo_device, nullptr)))
{
if (SUCCEEDED(mo_device->SetDataFormat(&c_dfDIMouse2)))
{
if (SUCCEEDED(
mo_device->SetCooperativeLevel(nullptr, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
{
g_controller_interface.AddDevice(new KeyboardMouse(kb_device, mo_device));
return;
}
}
}
}
}
g_controller_interface.AddDevice(new KeyboardMouse(kb_device, mo_device));
return;
}
if (kb_device)