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. --- Source/Core/DolphinWX/Input/InputConfigDiag.cpp | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'Source/Core/DolphinWX/Input/InputConfigDiag.cpp') diff --git a/Source/Core/DolphinWX/Input/InputConfigDiag.cpp b/Source/Core/DolphinWX/Input/InputConfigDiag.cpp index 06b95e8f49..dc5ddadd16 100644 --- a/Source/Core/DolphinWX/Input/InputConfigDiag.cpp +++ b/Source/Core/DolphinWX/Input/InputConfigDiag.cpp @@ -942,10 +942,10 @@ ControlGroupBox::~ControlGroupBox() bool ControlGroupBox::HasBitmapHeading() const { - return control_group->type == ControllerEmu::GROUP_TYPE_STICK || - control_group->type == ControllerEmu::GROUP_TYPE_TILT || - control_group->type == ControllerEmu::GROUP_TYPE_CURSOR || - control_group->type == ControllerEmu::GROUP_TYPE_FORCE; + return control_group->type == ControllerEmu::GroupType::Stick || + control_group->type == ControllerEmu::GroupType::Tilt || + control_group->type == ControllerEmu::GroupType::Cursor || + control_group->type == ControllerEmu::GroupType::Force; } ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWindow* const parent, @@ -1000,10 +1000,10 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin switch (group->type) { - case ControllerEmu::GROUP_TYPE_STICK: - case ControllerEmu::GROUP_TYPE_TILT: - case ControllerEmu::GROUP_TYPE_CURSOR: - case ControllerEmu::GROUP_TYPE_FORCE: + case ControllerEmu::GroupType::Stick: + case ControllerEmu::GroupType::Tilt: + case ControllerEmu::GroupType::Cursor: + case ControllerEmu::GroupType::Force: { wxSize bitmap_size = parent->FromDIP(wxSize(64, 64)); m_scale = bitmap_size.GetWidth() / 64.0; @@ -1045,7 +1045,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin Add(h_szr, 0, wxEXPAND | wxLEFT | wxRIGHT, space3); } break; - case ControllerEmu::GROUP_TYPE_BUTTONS: + case ControllerEmu::GroupType::Buttons: { // Draw buttons in rows of 8 unsigned int button_cols = group->controls.size() > 8 ? 8 : group->controls.size(); @@ -1083,17 +1083,17 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin Add(static_bitmap, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT, space3); } break; - case ControllerEmu::GROUP_TYPE_MIXED_TRIGGERS: - case ControllerEmu::GROUP_TYPE_TRIGGERS: - case ControllerEmu::GROUP_TYPE_SLIDER: + case ControllerEmu::GroupType::MixedTriggers: + case ControllerEmu::GroupType::Triggers: + case ControllerEmu::GroupType::Slider: { int height = (int)(12 * group->controls.size()); int width = 64; - if (ControllerEmu::GROUP_TYPE_MIXED_TRIGGERS == group->type) + if (group->type == ControllerEmu::GroupType::MixedTriggers) width = 64 + 12 + 1; - if (ControllerEmu::GROUP_TYPE_TRIGGERS != group->type) + if (group->type != ControllerEmu::GroupType::Triggers) height /= 2; height += 1; @@ -1127,7 +1127,7 @@ ControlGroupBox::ControlGroupBox(ControllerEmu::ControlGroup* const group, wxWin Add(static_bitmap, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT, space3); } break; - case ControllerEmu::GROUP_TYPE_EXTENSION: + case ControllerEmu::GroupType::Extension: { PadSettingExtension* const attachments = new PadSettingExtension(parent, (ControllerEmu::Extension*)group); -- cgit v1.2.3