diff options
| author | Lioncash <mathew1800@gmail.com> | 2017-02-25 00:35:02 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2017-02-25 01:15:04 -0500 |
| commit | 26f17a172353098740d97cce531f4c7c06abd4e4 (patch) | |
| tree | cf488dab1c5371856cb73af2753854ab15fa4c8f /Source/Core/DolphinWX/Input/InputConfigDiag.cpp | |
| parent | 51136681dfa77c88f548d187c9c7954f0ad6ac32 (diff) | |
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.
Diffstat (limited to 'Source/Core/DolphinWX/Input/InputConfigDiag.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Input/InputConfigDiag.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
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); |
