InputCommon: Eliminate some duplicated button threshold logic.

This commit is contained in:
Jordan Woyak
2020-02-08 20:36:26 -06:00
parent 2e2540317e
commit f07457b6cc
17 changed files with 50 additions and 45 deletions

View File

@ -44,14 +44,14 @@ Tilt::Tilt(const std::string& name_) : ReshapableInput(name_, name_, GroupType::
Tilt::ReshapeData Tilt::GetReshapableState(bool adjusted)
{
const ControlState y = controls[0]->control_ref->State() - controls[1]->control_ref->State();
const ControlState x = controls[3]->control_ref->State() - controls[2]->control_ref->State();
const ControlState y = controls[0]->GetState() - controls[1]->GetState();
const ControlState x = controls[3]->GetState() - controls[2]->GetState();
// Return raw values. (used in UI)
if (!adjusted)
return {x, y};
const ControlState modifier = controls[4]->control_ref->State();
const ControlState modifier = controls[4]->GetState();
return Reshape(x, y, modifier);
}