From 9ec9cec6b2485654bdee4a828e5a7b0708dcf4f4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 2 Feb 2014 12:48:18 +0300 Subject: Add missing const and static into input classes. --- src/input/inputmanager.cpp | 8 ++++---- src/input/inputmanager.h | 6 +++--- src/input/keyboardconfig.cpp | 2 +- src/input/keyboardconfig.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index 090629aea..e6952a956 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -102,7 +102,7 @@ void InputManager::init() update(); } -void InputManager::update() const +void InputManager::update() { keyboard.update(); if (joystick) @@ -347,7 +347,7 @@ bool InputManager::isActionActive(const int index) const return true; } -bool InputManager::isActionActive0(const int index) const +bool InputManager::isActionActive0(const int index) { if (keyboard.isActionActive(index)) return true; @@ -497,7 +497,7 @@ void InputManager::setNewKey(const SDL_Event &event, const int type) { int val = -1; if (type == INPUT_KEYBOARD) - val = keyboard.getKeyValueFromEvent(event); + val = KeyboardConfig::getKeyValueFromEvent(event); else if (type == INPUT_JOYSTICK && joystick) val = joystick->getButtonFromEvent(event); @@ -651,7 +651,7 @@ bool InputManager::handleEvent(const SDL_Event &event) return false; } -void InputManager::handleRepeat() const +void InputManager::handleRepeat() { const int time = tick_time; keyboard.handleRepeat(time); diff --git a/src/input/inputmanager.h b/src/input/inputmanager.h index ce662611a..630b52948 100644 --- a/src/input/inputmanager.h +++ b/src/input/inputmanager.h @@ -164,14 +164,14 @@ class InputManager final bool handleAssignKey(const SDL_Event &event, const int type); - void handleRepeat() const; + static void handleRepeat(); bool triggerAction(const KeysVector *const ptrs); int getKeyIndex(const int value, const int grp, const int type) const A_WARN_UNUSED; - void update() const; + static void update(); void updateConditionMask(); @@ -180,7 +180,7 @@ class InputManager final void executeAction(const int keyNum); protected: - bool isActionActive0(const int index) const A_WARN_UNUSED; + static bool isActionActive0(const int index) A_WARN_UNUSED; Setup_Input *mSetupInput; /**< Reference to setup window */ diff --git a/src/input/keyboardconfig.cpp b/src/input/keyboardconfig.cpp index 6cf524842..d849c54d2 100644 --- a/src/input/keyboardconfig.cpp +++ b/src/input/keyboardconfig.cpp @@ -59,7 +59,7 @@ void KeyboardConfig::deinit() mActiveKeys2 = nullptr; } -int KeyboardConfig::getKeyValueFromEvent(const SDL_Event &event) const +int KeyboardConfig::getKeyValueFromEvent(const SDL_Event &event) { #ifdef USE_SDL2 return event.key.keysym.scancode; diff --git a/src/input/keyboardconfig.h b/src/input/keyboardconfig.h index 5e8232508..b43f22790 100644 --- a/src/input/keyboardconfig.h +++ b/src/input/keyboardconfig.h @@ -75,7 +75,7 @@ class KeyboardConfig final static SDLKey getKeyFromEvent(const SDL_Event &event) A_WARN_UNUSED; - int getKeyValueFromEvent(const SDL_Event &event) const A_WARN_UNUSED; + static int getKeyValueFromEvent(const SDL_Event &event) A_WARN_UNUSED; KeysVector *getActionVector(const SDL_Event &event) A_WARN_UNUSED; -- cgit v1.2.3-70-g09d2