From 26f17a172353098740d97cce531f4c7c06abd4e4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 25 Feb 2017 00:35:02 -0500 Subject: ControlGroup: Convert group type enum into an enum class Gets some constants out of the ControllerEmu namespace, and modifies ControlGroup so that it uses the enum type itself to represent the underlying type, rather than a u32 value. --- .../ControllerEmu/ControlGroup/ControlGroup.h | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup/ControlGroup.h') diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/ControlGroup.h b/Source/Core/InputCommon/ControllerEmu/ControlGroup/ControlGroup.h index d1870f7f03..212205f333 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/ControlGroup.h +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/ControlGroup.h @@ -17,18 +17,18 @@ namespace ControllerEmu { class Control; -enum +enum class GroupType { - GROUP_TYPE_OTHER, - GROUP_TYPE_STICK, - GROUP_TYPE_MIXED_TRIGGERS, - GROUP_TYPE_BUTTONS, - GROUP_TYPE_FORCE, - GROUP_TYPE_EXTENSION, - GROUP_TYPE_TILT, - GROUP_TYPE_CURSOR, - GROUP_TYPE_TRIGGERS, - GROUP_TYPE_SLIDER + Other, + Stick, + MixedTriggers, + Buttons, + Force, + Extension, + Tilt, + Cursor, + Triggers, + Slider }; class ControlGroup @@ -102,8 +102,9 @@ public: } }; - explicit ControlGroup(const std::string& name, u32 type = GROUP_TYPE_OTHER); - ControlGroup(const std::string& name, const std::string& ui_name, u32 type = GROUP_TYPE_OTHER); + explicit ControlGroup(const std::string& name, GroupType type = GroupType::Other); + ControlGroup(const std::string& name, const std::string& ui_name, + GroupType type = GroupType::Other); virtual ~ControlGroup(); virtual void LoadConfig(IniFile::Section* sec, const std::string& defdev = "", @@ -115,7 +116,7 @@ public: const std::string name; const std::string ui_name; - const u32 type; + const GroupType type; std::vector> controls; std::vector> numeric_settings; -- cgit v1.2.3