summaryrefslogtreecommitdiff
path: root/src/touchmanager.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-31 00:19:18 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-31 00:19:18 +0300
commit694e07d193e7c5758a7d672b45668651b034003d (patch)
tree20a4aec8dee2b3b5475db9f3667e797fb43c603b /src/touchmanager.h
parentc9a84749b3b71d4df6cc3b9b488d60dc4a013a20 (diff)
downloadmv-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.h14
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);