summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerEmu/ControlGroup
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2019-03-19 19:15:17 -0500
committerJordan Woyak <jordan.woyak@gmail.com>2019-04-23 18:38:00 -0500
commit43746003678df348acdbee9aa866511ad9dd9bfc (patch)
tree71fc397a87ae994ee557d81f7520cb9f537ad0b0 /Source/Core/InputCommon/ControllerEmu/ControlGroup
parent59e1c83445bc869b3cf79e9461194faac7a64efe (diff)
WiimoteEmu: Implement MotionPlus parameter y0 and other cleanups.
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup')
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp9
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
index 5818f35d87..dd5bc87887 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
@@ -6,6 +6,7 @@
#include <algorithm>
#include <cmath>
+#include <limits>
#include <memory>
#include <string>
@@ -153,8 +154,7 @@ Cursor::StateData Cursor::GetState(const bool adjusted)
// If auto-hide time is up or hide button is held:
if (!m_auto_hide_timer || controls[6]->control_ref->State() > BUTTON_THRESHOLD)
{
- // TODO: Use NaN or something:
- result.x = 10000;
+ result.x = std::numeric_limits<ControlState>::quiet_NaN();
result.y = 0;
}
@@ -176,4 +176,9 @@ ControlState Cursor::GetVerticalOffset() const
return m_vertical_offset_setting.GetValue() / 100;
}
+bool Cursor::StateData::IsVisible() const
+{
+ return !std::isnan(x);
+}
+
} // namespace ControllerEmu
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h
index 7def851cc4..4b0d13eb6c 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h
@@ -20,6 +20,8 @@ public:
ControlState x{};
ControlState y{};
ControlState z{};
+
+ bool IsVisible() const;
};
explicit Cursor(const std::string& name);