From 8a9fcd3014a4aee23b6fb7008a02679f8bf96200 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 14 Apr 2013 22:53:10 -0400 Subject: 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. --- .../Src/ControllerInterface/XInput/XInput.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp') 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 -- cgit v1.2.3