Merge pull request #2432 from lioncash/android
ButtonManager: Pass strings by const reference
This commit is contained in:
commit
474188d606
|
@ -58,7 +58,7 @@ namespace ButtonManager
|
||||||
TRIGGER_R
|
TRIGGER_R
|
||||||
};
|
};
|
||||||
|
|
||||||
static void AddBind(std::string dev, sBind *bind)
|
static void AddBind(const std::string& dev, sBind *bind)
|
||||||
{
|
{
|
||||||
auto it = m_controllers.find(dev);
|
auto it = m_controllers.find(dev);
|
||||||
if (it != m_controllers.end())
|
if (it != m_controllers.end())
|
||||||
|
@ -156,7 +156,7 @@ namespace ButtonManager
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
bool GamepadEvent(std::string dev, int button, int action)
|
bool GamepadEvent(const std::string& dev, int button, int action)
|
||||||
{
|
{
|
||||||
auto it = m_controllers.find(dev);
|
auto it = m_controllers.find(dev);
|
||||||
if (it != m_controllers.end())
|
if (it != m_controllers.end())
|
||||||
|
@ -165,7 +165,7 @@ namespace ButtonManager
|
||||||
m_controllers[dev] = new InputDevice(dev);
|
m_controllers[dev] = new InputDevice(dev);
|
||||||
return m_controllers[dev]->PressEvent(button, action);
|
return m_controllers[dev]->PressEvent(button, action);
|
||||||
}
|
}
|
||||||
void GamepadAxisEvent(std::string dev, int axis, float value)
|
void GamepadAxisEvent(const std::string& dev, int axis, float value)
|
||||||
{
|
{
|
||||||
auto it = m_controllers.find(dev);
|
auto it = m_controllers.find(dev);
|
||||||
if (it != m_controllers.end())
|
if (it != m_controllers.end())
|
||||||
|
|
|
@ -108,7 +108,7 @@ namespace ButtonManager
|
||||||
void Init();
|
void Init();
|
||||||
bool GetButtonPressed(int padID, ButtonType button);
|
bool GetButtonPressed(int padID, ButtonType button);
|
||||||
float GetAxisValue(int padID, ButtonType axis);
|
float GetAxisValue(int padID, ButtonType axis);
|
||||||
bool GamepadEvent(std::string dev, int button, int action);
|
bool GamepadEvent(const std::string& dev, int button, int action);
|
||||||
void GamepadAxisEvent(std::string dev, int axis, float value);
|
void GamepadAxisEvent(const std::string& dev, int axis, float value);
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue