Merge pull request #2432 from lioncash/android

ButtonManager: Pass strings by const reference
This commit is contained in:
Lioncash 2015-05-21 22:37:47 -04:00
commit 474188d606
2 changed files with 5 additions and 5 deletions

View File

@ -58,7 +58,7 @@ namespace ButtonManager
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);
if (it != m_controllers.end())
@ -156,7 +156,7 @@ namespace ButtonManager
}
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);
if (it != m_controllers.end())
@ -165,7 +165,7 @@ namespace ButtonManager
m_controllers[dev] = new InputDevice(dev);
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);
if (it != m_controllers.end())

View File

@ -108,7 +108,7 @@ namespace ButtonManager
void Init();
bool GetButtonPressed(int padID, ButtonType button);
float GetAxisValue(int padID, ButtonType axis);
bool GamepadEvent(std::string dev, int button, int action);
void GamepadAxisEvent(std::string dev, int axis, float value);
bool GamepadEvent(const std::string& dev, int button, int action);
void GamepadAxisEvent(const std::string& dev, int axis, float value);
void Shutdown();
}