summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp')
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp
index 8e96231674..6a1427406d 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp
@@ -157,7 +157,7 @@ bool ControllerInterface::UpdateOutput(const bool force)
if (force)
lk.lock();
else if (!lk.try_lock())
- return false;
+ return false;
size_t ok_count = 0;
@@ -173,7 +173,7 @@ bool ControllerInterface::UpdateOutput(const bool force)
//
// Device :: ~Device
//
-// dtor, delete all inputs/outputs on device destruction
+// Destructor, delete all inputs/outputs on device destruction
//
ControllerInterface::Device::~Device()
{
@@ -209,9 +209,9 @@ void ControllerInterface::Device::AddOutput(Output* const o)
//
// Device :: ClearInputState
//
-// device classes should override this func
-// ControllerInterface will call this when the device returns failure durring UpdateInput
-// used to try to set all buttons and axes to their default state when user unplugs a gamepad durring play
+// Device classes should override this function
+// ControllerInterface will call this when the device returns failure during UpdateInput
+// used to try to set all buttons and axes to their default state when user unplugs a gamepad during play
// buttons/axes that were held down at the time of unplugging should be seen as not pressed after unplugging
//
void ControllerInterface::Device::ClearInputState()
@@ -239,8 +239,10 @@ ControlState ControllerInterface::InputReference::State( const ControlState igno
// bit of hax for "NOT" to work at start of expression
if (ci != ce)
+ {
if (ci->mode == 2)
state = 1;
+ }
for (; ci!=ce; ++ci)
{
@@ -354,7 +356,8 @@ bool ControllerInterface::DeviceQualifier::operator==(const ControllerInterface:
if (name == devq.name)
if (source == devq.source)
return true;
- return false;
+
+ return false;
}
//
@@ -421,7 +424,9 @@ void ControllerInterface::UpdateReference(ControllerInterface::ControlReference*
break; // no terminating '`' character
}
else
+ {
ctrl_str += c;
+ }
}
}
@@ -478,7 +483,9 @@ ControllerInterface::Device::Control* ControllerInterface::InputReference::Detec
return *i;
}
else if ((*i)->GetState() < (1 - INPUT_DETECT_THRESHOLD))
+ {
*state = false;
+ }
}
Common::SleepCurrentThread(10); time += 10;
}
@@ -490,8 +497,8 @@ ControllerInterface::Device::Control* ControllerInterface::InputReference::Detec
//
// OutputReference :: Detect
//
-// totally different from the inputReference detect / i have them combined so it was simplier to make the gui.
-// the gui doesnt know the difference between an input and an output / its odd but i was lazy and it was easy
+// Totally different from the inputReference detect / I have them combined so it was simpler to make the GUI.
+// The GUI doesn't know the difference between an input and an output / it's odd but I was lazy and it was easy
//
// set all binded outputs to <range> power for x milliseconds return false
//
@@ -499,7 +506,7 @@ ControllerInterface::Device::Control* ControllerInterface::OutputReference::Dete
{
// ignore device
- // dont hang if we dont even have any controls mapped
+ // don't hang if we don't even have any controls mapped
if (m_controls.size())
{
State(1);