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/input/inputactionmap.h | |
parent | c9a84749b3b71d4df6cc3b9b488d60dc4a013a20 (diff) | |
download | plus-694e07d193e7c5758a7d672b45668651b034003d.tar.gz plus-694e07d193e7c5758a7d672b45668651b034003d.tar.bz2 plus-694e07d193e7c5758a7d672b45668651b034003d.tar.xz plus-694e07d193e7c5758a7d672b45668651b034003d.zip |
Convert InputAction enum into strong typed enum.
Diffstat (limited to 'src/input/inputactionmap.h')
-rw-r--r-- | src/input/inputactionmap.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index cd57e47a7..b96a187f8 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -43,18 +43,19 @@ #include "localconsts.h" #define defaultAction(name) \ - InputType::UNKNOWN, InputAction::NO_VALUE, \ - InputType::UNKNOWN, InputAction::NO_VALUE, \ + InputType::UNKNOWN, -1, \ + InputType::UNKNOWN, -1, \ Input::GRP_DEFAULT, \ name, \ InputAction::NO_VALUE, 50 #define addKey(name) InputType::KEYBOARD, name -#define emptyKey InputType::UNKNOWN, InputAction::NO_VALUE +#define emptyKey InputType::UNKNOWN, -1 #define joystickButton(num) InputType::JOYSTICK, num // keyData must be in same order as enum keyAction. -static const InputActionData inputActionData[InputAction::TOTAL] = { +static const InputActionData inputActionData + [static_cast<size_t>(InputAction::TOTAL)] = { {"keyMoveUp", addKey(SDLK_UP), emptyKey, |