diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-31 00:19:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-31 00:19:18 +0300 |
commit | 694e07d193e7c5758a7d672b45668651b034003d (patch) | |
tree | 20a4aec8dee2b3b5475db9f3667e797fb43c603b /src/touchmanager.h | |
parent | c9a84749b3b71d4df6cc3b9b488d60dc4a013a20 (diff) | |
download | mv-694e07d193e7c5758a7d672b45668651b034003d.tar.gz mv-694e07d193e7c5758a7d672b45668651b034003d.tar.bz2 mv-694e07d193e7c5758a7d672b45668651b034003d.tar.xz mv-694e07d193e7c5758a7d672b45668651b034003d.zip |
Convert InputAction enum into strong typed enum.
Diffstat (limited to 'src/touchmanager.h')
-rw-r--r-- | src/touchmanager.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/touchmanager.h b/src/touchmanager.h index a8c83b8d7..932d1981f 100644 --- a/src/touchmanager.h +++ b/src/touchmanager.h @@ -38,7 +38,7 @@ class MouseInput; typedef void (*TouchFuncPtr) (const MouseInput &mouseInput); -const int actionsSize = InputAction::TOTAL; +const int actionsSize = static_cast<int>(InputAction::TOTAL); const int buttonsCount = 12; struct TouchItem final @@ -131,12 +131,16 @@ class TouchManager final : public ConfigListener bool processEvent(const MouseInput &mouseInput); - bool isActionActive(const int index) const; + bool isActionActive(const InputActionT index) const; - void setActionActive(const int index, const bool value) + void setActionActive(const InputActionT index, + const bool value) { - if (index >= 0 && index < actionsSize) - mActions[index] = value; + if (static_cast<int>(index) >= 0 && + static_cast<int>(index) < actionsSize) + { + mActions[static_cast<size_t>(index)] = value; + } } void resize(const int width, const int height); |