From ed3410d7eb61593a2235ddba97ce257c85e405a6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 31 Aug 2012 23:42:43 +0300 Subject: Add const to more classes. --- src/keyboardconfig.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/keyboardconfig.cpp') diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index 742dd69d5..043024796 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -64,7 +64,7 @@ int KeyboardConfig::getKeyValueFromEvent(const SDL_Event &event) const return 0; } -int KeyboardConfig::getKeyIndex(const SDL_Event &event, int grp) const +int KeyboardConfig::getKeyIndex(const SDL_Event &event, const int grp) const { const int keyValue = getKeyValueFromEvent(event); return inputManager.getKeyIndex(keyValue, grp, INPUT_KEYBOARD); @@ -75,7 +75,7 @@ void KeyboardConfig::refreshActiveKeys() mActiveKeys = SDL_GetKeyState(nullptr); } -std::string KeyboardConfig::getKeyName(int key) +std::string KeyboardConfig::getKeyName(const int key) const { if (key == Input::KEY_NO_VALUE) return ""; @@ -113,7 +113,7 @@ KeysVector *KeyboardConfig::getActionVector(const SDL_Event &event) return nullptr; } -KeysVector *KeyboardConfig::getActionVectorByKey(int i) +KeysVector *KeyboardConfig::getActionVectorByKey(const int i) { // logger->log("key triggerAction: %d", i); if (i != 0 && i < SDLK_LAST && mKeyToAction.find(i) != mKeyToAction.end()) @@ -130,7 +130,7 @@ int KeyboardConfig::getActionId(const SDL_Event &event) return -1; } -bool KeyboardConfig::isActionActive(int index) const +bool KeyboardConfig::isActionActive(const int index) const { if (!mActiveKeys) return false; @@ -178,7 +178,7 @@ void KeyboardConfig::handleDeActicateKey(const SDL_Event &event) resetRepeat(key); } -void KeyboardConfig::handleRepeat(int time) +void KeyboardConfig::handleRepeat(const int time) { for (KeyTimeMapIter it = mKeyTimeMap.begin(), it_end = mKeyTimeMap.end(); it != it_end; ++ it) @@ -204,9 +204,9 @@ void KeyboardConfig::handleRepeat(int time) } } -void KeyboardConfig::resetRepeat(int key) +void KeyboardConfig::resetRepeat(const int key) { - KeyTimeMapIter it = mKeyTimeMap.find(key); + const KeyTimeMapIter it = mKeyTimeMap.find(key); if (it != mKeyTimeMap.end()) (*it).second = tick_time; } -- cgit v1.2.3-60-g2f50