InputCommon: add a ton of missing consts

fix some related grammar errors
only the ButtonManager required code changes
This commit is contained in:
Filoppi
2021-05-04 23:47:55 +03:00
parent d586163e38
commit a261e61e9e
20 changed files with 61 additions and 40 deletions

View File

@ -210,7 +210,7 @@ private:
public:
Button() : m_state(BUTTON_RELEASED) {}
void SetState(ButtonState state) { m_state = state; }
bool Pressed() { return m_state == BUTTON_PRESSED; }
bool Pressed() const { return m_state == BUTTON_PRESSED; }
~Button() {}
};
class Axis
@ -221,7 +221,7 @@ private:
public:
Axis() : m_value(0.0f) {}
void SetValue(float value) { m_value = value; }
float AxisValue() { return m_value; }
float AxisValue() const { return m_value; }
~Axis() {}
};
@ -244,7 +244,7 @@ class InputDevice
private:
const std::string m_dev;
std::map<ButtonType, bool> m_buttons;
std::map<ButtonType, float> m_axises;
std::map<ButtonType, float> m_axes;
// Key is pad_id and ButtonType
std::map<std::pair<int, ButtonType>, sBind*> m_input_binds;
@ -263,8 +263,8 @@ public:
}
bool PressEvent(int button, int action);
void AxisEvent(int axis, float value);
bool ButtonValue(int pad_id, ButtonType button);
float AxisValue(int pad_id, ButtonType axis);
bool ButtonValue(int pad_id, ButtonType button) const;
float AxisValue(int pad_id, ButtonType axis) const;
};
void Init(const std::string&);