diff options
| author | Lioncash <mathew1800@gmail.com> | 2013-04-14 22:53:10 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2013-04-14 22:53:10 -0400 |
| commit | 8a9fcd3014a4aee23b6fb7008a02679f8bf96200 (patch) | |
| tree | 7d4f2cff6e0ff82dc1cce6e41c9c81fb2f94348c /Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp | |
| parent | b91930a2d4742ec001d0b1df1abe938da7527d03 (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/XInput/XInput.cpp')
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp b/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp index 7fe54d0d09..f9df3891bb 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp @@ -31,13 +31,13 @@ static const struct { "Thumb R", XINPUT_GAMEPAD_RIGHT_THUMB } }; -static const char* const named_triggers[] = +static const char* const named_triggers[] = { "Trigger L", "Trigger R" }; -static const char* const named_axes[] = +static const char* const named_axes[] = { "Left X", "Left Y", @@ -45,7 +45,7 @@ static const char* const named_axes[] = "Right Y" }; -static const char* const named_motors[] = +static const char* const named_motors[] = { "Motor L", "Motor R" @@ -66,12 +66,14 @@ Device::Device(const XINPUT_CAPABILITIES& caps, u8 index) ZeroMemory(&m_current_state_out, sizeof(m_current_state_out)); // XInputGetCaps seems to always claim all capabilities are supported - // but i will leave all this stuff in, incase m$ fixes xinput up a bit + // but I will leave all this stuff in, incase m$ fixes xinput up a bit // get supported buttons for (int i = 0; i != sizeof(named_buttons)/sizeof(*named_buttons); ++i) + { if (named_buttons[i].bitmask & caps.Gamepad.wButtons) AddInput(new Button(i, m_state_in.Gamepad.wButtons)); + } // get supported triggers for (int i = 0; i != sizeof(named_triggers)/sizeof(*named_triggers); ++i) @@ -114,8 +116,8 @@ void Device::ClearInputState() std::string Device::GetName() const { // why aren't these defined - // subtype doesn't seem to work, i tested with 2 diff arcade sticks, both were shown as gamepad - // ill leave it in anyway, maybe m$ will fix it + // subtype doesn't seem to work, I tested with 2 different arcade sticks, both were shown as gamepad + // I'll leave it in anyway, maybe m$ will fix it switch (m_subtype) { @@ -140,7 +142,7 @@ std::string Device::GetSource() const return "XInput"; } -// update i/o +// Update I/O bool Device::UpdateInput() { @@ -157,7 +159,9 @@ bool Device::UpdateOutput() return (ERROR_SUCCESS == XInputSetState(m_index, &m_state_out)); } else + { return true; + } } // GET name/source/id |
