summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/ControllerInterface/DInput
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2013-04-14 22:53:10 -0400
committerLioncash <mathew1800@gmail.com>2013-04-14 22:53:10 -0400
commit8a9fcd3014a4aee23b6fb7008a02679f8bf96200 (patch)
tree7d4f2cff6e0ff82dc1cce6e41c9c81fb2f94348c /Source/Core/InputCommon/Src/ControllerInterface/DInput
parentb91930a2d4742ec001d0b1df1abe938da7527d03 (diff)
Kill off dangling else's in the InputCommon project.
Some indentations were also too far for some things. Fixed this. Also update the license header to show Git instead of SVN. Got rid of some trailing spaces/tabs too.
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/DInput')
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp12
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp20
2 files changed, 25 insertions, 7 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp
index 9bc5364e76..ed5d1383ec 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputJoystick.cpp
@@ -319,9 +319,13 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI
eff.lpvTypeSpecificParams = &diCF;
}
else if (1 == f)
+ {
eff.cbTypeSpecificParams = sizeof(DIRAMPFORCE);
+ }
else
+ {
eff.cbTypeSpecificParams = sizeof(DIPERIODIC);
+ }
LPDIRECTINPUTEFFECT pEffect;
if (SUCCEEDED(m_device->CreateEffect(force_type_names[f].guid, &eff, &pEffect, NULL)))
@@ -427,7 +431,9 @@ bool Joystick::UpdateInput()
}
}
else
+ {
hr = m_device->GetDeviceState(sizeof(m_state_in), &m_state_in);
+ }
// try reacquire if input lost
if (DIERR_INPUTLOST == hr || DIERR_NOTACQUIRED == hr)
@@ -460,12 +466,16 @@ bool Joystick::UpdateOutput()
ok_count += SUCCEEDED(i->iface->SetParameters(&eff, DIEP_TYPESPECIFICPARAMS | DIEP_START));
}
else
+ {
ok_count += SUCCEEDED(i->iface->Stop());
+ }
i->params = NULL;
}
else
+ {
++ok_count;
+ }
}
return (m_state_out.size() == ok_count);
@@ -492,7 +502,9 @@ std::string Joystick::Axis::GetName() const
}
// slider
else
+ {
ss << "Slider " << (int)(m_index - 6);
+ }
ss << (m_range < 0 ? '-' : '+');
return ss.str();
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp
index aea12c065c..866bce9671 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp
@@ -56,15 +56,19 @@ void InitKeyboardMouse(IDirectInput8* const idi8, std::vector<ControllerInterfac
if (SUCCEEDED(idi8->CreateDevice( GUID_SysKeyboard, &kb_device, NULL)))
{
if (SUCCEEDED(kb_device->SetDataFormat(&c_dfDIKeyboard)))
- if (SUCCEEDED(kb_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
{
- if (SUCCEEDED(idi8->CreateDevice( GUID_SysMouse, &mo_device, NULL )))
+ if (SUCCEEDED(kb_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
{
- if (SUCCEEDED(mo_device->SetDataFormat(&c_dfDIMouse2)))
- if (SUCCEEDED(mo_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
+ if (SUCCEEDED(idi8->CreateDevice( GUID_SysMouse, &mo_device, NULL )))
{
- devices.push_back(new KeyboardMouse(kb_device, mo_device));
- return;
+ if (SUCCEEDED(mo_device->SetDataFormat(&c_dfDIMouse2)))
+ {
+ if (SUCCEEDED(mo_device->SetCooperativeLevel(NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
+ {
+ devices.push_back(new KeyboardMouse(kb_device, mo_device));
+ return;
+ }
+ }
}
}
}
@@ -203,7 +207,9 @@ bool KeyboardMouse::UpdateOutput()
memset( this, 0, sizeof(*this) );
type = INPUT_KEYBOARD;
ki.wVk = key;
- if (up) ki.dwFlags = KEYEVENTF_KEYUP;
+
+ if (up)
+ ki.dwFlags = KEYEVENTF_KEYUP;
}
};