diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-31 23:42:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-01 18:47:54 +0300 |
commit | ed3410d7eb61593a2235ddba97ce257c85e405a6 (patch) | |
tree | 565c93ff291f70749cda2f59a4cc6fcd015ff203 /src/keyboardconfig.cpp | |
parent | 386dac2875f4a5ad4a534c403338db3b26239a68 (diff) | |
download | manaverse-ed3410d7eb61593a2235ddba97ce257c85e405a6.tar.gz manaverse-ed3410d7eb61593a2235ddba97ce257c85e405a6.tar.bz2 manaverse-ed3410d7eb61593a2235ddba97ce257c85e405a6.tar.xz manaverse-ed3410d7eb61593a2235ddba97ce257c85e405a6.zip |
Add const to more classes.
Diffstat (limited to 'src/keyboardconfig.cpp')
-rw-r--r-- | src/keyboardconfig.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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; } |