diff options
| author | JMC47 <JMC4789@gmail.com> | 2019-04-26 05:50:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-26 05:50:18 -0400 |
| commit | 664376dae15ef187df4e4c8c7c5e241b9a68fb5d (patch) | |
| tree | 0bbfa4617934f632156996a90922e232be1e7651 /Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp | |
| parent | 057fa6c092fb10abb90a0f038d90c97a00731a59 (diff) | |
| parent | ba1b3351184864ed3d5692a461b00edd2f3a21f6 (diff) | |
Merge pull request #7861 from jordan-woyak/mplus-emu
WiimoteEmu: Emulated MotionPlus and improved emulated swing.
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp | 9 |
1 files changed, 7 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 |
