WiimoteEmu: Implement MotionPlus parameter y0 and other cleanups.

This commit is contained in:
Jordan Woyak
2019-03-19 19:15:17 -05:00
parent 59e1c83445
commit 4374600367
9 changed files with 298 additions and 205 deletions

View File

@ -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

View File

@ -20,6 +20,8 @@ public:
ControlState x{};
ControlState y{};
ControlState z{};
bool IsVisible() const;
};
explicit Cursor(const std::string& name);