Add a recenter control for Wiimote IR relative input

This adds a recenter control binding which allows recentering the
cursor when relative input is enabled.

(EnableSettingControl is renamed to avoid confusions.)
This commit is contained in:
Léo Lam
2016-07-17 14:32:06 +02:00
parent 1ad19f9371
commit 149654df5a
4 changed files with 41 additions and 8 deletions

View File

@ -434,6 +434,13 @@ public:
m_x = MathUtil::Clamp(m_x + xx * SPEED_MULTIPLIER, -1.0, 1.0);
if (std::abs(yy) > deadzone)
m_y = MathUtil::Clamp(m_y + yy * SPEED_MULTIPLIER, -1.0, 1.0);
// recenter
if (controls[7]->control_ref->State() > 0.5)
{
m_x = 0.0;
m_y = 0.0;
}
}
else
{