mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
InputCommon: add a ton of missing consts
fix some related grammar errors only the ButtonManager required code changes
This commit is contained in:
@ -32,7 +32,7 @@ AnalogStick::AnalogStick(const char* const name_, const char* const ui_name_,
|
||||
AddInput(Translate, _trans("Modifier"));
|
||||
}
|
||||
|
||||
AnalogStick::ReshapeData AnalogStick::GetReshapableState(bool adjusted)
|
||||
AnalogStick::ReshapeData AnalogStick::GetReshapableState(bool adjusted) const
|
||||
{
|
||||
const ControlState y = controls[0]->GetState() - controls[1]->GetState();
|
||||
const ControlState x = controls[3]->GetState() - controls[2]->GetState();
|
||||
@ -46,7 +46,7 @@ AnalogStick::ReshapeData AnalogStick::GetReshapableState(bool adjusted)
|
||||
return Reshape(x, y, modifier);
|
||||
}
|
||||
|
||||
AnalogStick::StateData AnalogStick::GetState()
|
||||
AnalogStick::StateData AnalogStick::GetState() const
|
||||
{
|
||||
return GetReshapableState(true);
|
||||
}
|
||||
|
@ -18,10 +18,10 @@ public:
|
||||
AnalogStick(const char* name, std::unique_ptr<StickGate>&& stick_gate);
|
||||
AnalogStick(const char* name, const char* ui_name, std::unique_ptr<StickGate>&& stick_gate);
|
||||
|
||||
ReshapeData GetReshapableState(bool adjusted) final override;
|
||||
ReshapeData GetReshapableState(bool adjusted) const final override;
|
||||
ControlState GetGateRadiusAtAngle(double ang) const override;
|
||||
|
||||
StateData GetState();
|
||||
StateData GetState() const;
|
||||
|
||||
private:
|
||||
std::unique_ptr<StickGate> m_stick_gate;
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
Buttons(const std::string& ini_name, const std::string& group_name);
|
||||
|
||||
template <typename C>
|
||||
void GetState(C* const buttons, const C* bitmasks)
|
||||
void GetState(C* const buttons, const C* bitmasks) const
|
||||
{
|
||||
for (auto& control : controls)
|
||||
*buttons |= *(bitmasks++) * control->GetState<bool>();
|
||||
|
@ -64,7 +64,7 @@ Cursor::Cursor(std::string name_, std::string ui_name_)
|
||||
AddSetting(&m_autohide_setting, {_trans("Auto-Hide")}, false);
|
||||
}
|
||||
|
||||
Cursor::ReshapeData Cursor::GetReshapableState(bool adjusted)
|
||||
Cursor::ReshapeData Cursor::GetReshapableState(bool adjusted) const
|
||||
{
|
||||
const ControlState y = controls[0]->GetState() - controls[1]->GetState();
|
||||
const ControlState x = controls[3]->GetState() - controls[2]->GetState();
|
||||
|
@ -25,9 +25,10 @@ public:
|
||||
|
||||
Cursor(std::string name, std::string ui_name);
|
||||
|
||||
ReshapeData GetReshapableState(bool adjusted) final override;
|
||||
ReshapeData GetReshapableState(bool adjusted) const final override;
|
||||
ControlState GetGateRadiusAtAngle(double ang) const override;
|
||||
|
||||
// Modifies the state
|
||||
StateData GetState(bool adjusted);
|
||||
|
||||
// Yaw movement in radians.
|
||||
|
@ -65,7 +65,7 @@ Force::Force(const std::string& name_) : ReshapableInput(name_, name_, GroupType
|
||||
90, 1, 180);
|
||||
}
|
||||
|
||||
Force::ReshapeData Force::GetReshapableState(bool adjusted)
|
||||
Force::ReshapeData Force::GetReshapableState(bool adjusted) const
|
||||
{
|
||||
const ControlState y = controls[0]->GetState() - controls[1]->GetState();
|
||||
const ControlState x = controls[3]->GetState() - controls[2]->GetState();
|
||||
@ -77,7 +77,7 @@ Force::ReshapeData Force::GetReshapableState(bool adjusted)
|
||||
return Reshape(x, y);
|
||||
}
|
||||
|
||||
Force::StateData Force::GetState(bool adjusted)
|
||||
Force::StateData Force::GetState(bool adjusted) const
|
||||
{
|
||||
const auto state = GetReshapableState(adjusted);
|
||||
ControlState z = controls[4]->GetState() - controls[5]->GetState();
|
||||
|
@ -19,12 +19,12 @@ public:
|
||||
|
||||
explicit Force(const std::string& name);
|
||||
|
||||
ReshapeData GetReshapableState(bool adjusted) final override;
|
||||
ReshapeData GetReshapableState(bool adjusted) const final override;
|
||||
ControlState GetGateRadiusAtAngle(double ang) const final override;
|
||||
|
||||
ControlState GetDefaultInputRadiusAtAngle(double angle) const final override;
|
||||
|
||||
StateData GetState(bool adjusted = true);
|
||||
StateData GetState(bool adjusted = true) const;
|
||||
|
||||
// Velocities returned in m/s.
|
||||
ControlState GetSpeed() const;
|
||||
|
@ -29,7 +29,7 @@ Slider::Slider(const std::string& name_) : Slider(name_, name_)
|
||||
{
|
||||
}
|
||||
|
||||
Slider::StateData Slider::GetState()
|
||||
Slider::StateData Slider::GetState() const
|
||||
{
|
||||
const ControlState deadzone = m_deadzone_setting.GetValue() / 100;
|
||||
const ControlState state = controls[1]->GetState() - controls[0]->GetState();
|
||||
|
@ -23,7 +23,7 @@ public:
|
||||
Slider(const std::string& name_, const std::string& ui_name_);
|
||||
explicit Slider(const std::string& name_);
|
||||
|
||||
StateData GetState();
|
||||
StateData GetState() const;
|
||||
|
||||
private:
|
||||
SettingValue<double> m_deadzone_setting;
|
||||
|
@ -42,7 +42,7 @@ Tilt::Tilt(const std::string& name_) : ReshapableInput(name_, name_, GroupType::
|
||||
7, 1, 50);
|
||||
}
|
||||
|
||||
Tilt::ReshapeData Tilt::GetReshapableState(bool adjusted)
|
||||
Tilt::ReshapeData Tilt::GetReshapableState(bool adjusted) const
|
||||
{
|
||||
const ControlState y = controls[0]->GetState() - controls[1]->GetState();
|
||||
const ControlState x = controls[3]->GetState() - controls[2]->GetState();
|
||||
@ -56,7 +56,7 @@ Tilt::ReshapeData Tilt::GetReshapableState(bool adjusted)
|
||||
return Reshape(x, y, modifier);
|
||||
}
|
||||
|
||||
Tilt::StateData Tilt::GetState()
|
||||
Tilt::StateData Tilt::GetState() const
|
||||
{
|
||||
return GetReshapableState(true);
|
||||
}
|
||||
|
@ -19,14 +19,14 @@ public:
|
||||
|
||||
explicit Tilt(const std::string& name);
|
||||
|
||||
ReshapeData GetReshapableState(bool adjusted) final override;
|
||||
ReshapeData GetReshapableState(bool adjusted) const final override;
|
||||
ControlState GetGateRadiusAtAngle(double angle) const final override;
|
||||
|
||||
// Tilt is using the gate radius to adjust the tilt angle so we must provide an unadjusted value
|
||||
// for the default input radius.
|
||||
ControlState GetDefaultInputRadiusAtAngle(double angle) const final override;
|
||||
|
||||
StateData GetState();
|
||||
StateData GetState() const;
|
||||
|
||||
// Return peak rotational velocity (for a complete turn) in radians/sec
|
||||
ControlState GetMaxRotationalVelocity() const;
|
||||
|
@ -21,7 +21,7 @@ Triggers::Triggers(const std::string& name_) : ControlGroup(name_, GroupType::Tr
|
||||
AddDeadzoneSetting(&m_deadzone_setting, 50);
|
||||
}
|
||||
|
||||
Triggers::StateData Triggers::GetState()
|
||||
Triggers::StateData Triggers::GetState() const
|
||||
{
|
||||
const size_t trigger_count = controls.size();
|
||||
const ControlState deadzone = m_deadzone_setting.GetValue() / 100;
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
|
||||
explicit Triggers(const std::string& name);
|
||||
|
||||
StateData GetState();
|
||||
StateData GetState() const;
|
||||
|
||||
private:
|
||||
SettingValue<double> m_deadzone_setting;
|
||||
|
Reference in New Issue
Block a user