From 694e07d193e7c5758a7d672b45668651b034003d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 31 May 2015 00:19:18 +0300 Subject: Convert InputAction enum into strong typed enum. --- src/touchmanager.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/touchmanager.cpp') diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp index b7db9d83f..f3adecf8e 100644 --- a/src/touchmanager.cpp +++ b/src/touchmanager.cpp @@ -328,11 +328,14 @@ bool TouchManager::processEvent(const MouseInput &mouseInput) return false; } -bool TouchManager::isActionActive(const int index) const +bool TouchManager::isActionActive(const InputActionT index) const { - if (index < 0 || index >= actionsSize) + if (static_cast(index) < 0 || + static_cast(index) >= actionsSize) + { return false; - return mActions[index]; + } + return mActions[static_cast(index)]; } void TouchManager::resize(const int width, const int height) @@ -670,5 +673,6 @@ void TouchManager::setTempHide(const bool b) void TouchManager::executeAction(const std::string &event) { - inputManager.executeAction(config.getIntValue(event)); + inputManager.executeAction(static_cast( + config.getIntValue(event))); } -- cgit v1.2.3-70-g09d2