summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/VideoConfigDiag.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2018-05-11 22:38:44 +0200
committerLéo Lam <leo@innovatetechnologi.es>2018-05-12 18:10:26 +0200
commit6763a3fce1df5a949900dd976393c7fe89fa4aec (patch)
treecdf3ad1c04d6746d62d7f53ff0a2c46e547727b9 /Source/Core/DolphinWX/VideoConfigDiag.cpp
parent7dca7c237eb9ae40765e581317df6df4b4fc1ad4 (diff)
Config: Add support for enums
This makes it possible to use enums as the config type. Default values are now clearer and there's no need for casts when calling Config::Get/Set anymore. In order to add support for enums, the common code was updated to handle enums by using the underlying type when loading/saving settings. A copy constructor is also provided for conversions from `ConfigInfo<Enum>` to `ConfigInfo<underlying_type<Enum>>` so that enum settings can still easily work with code that doesn't care about the actual enum values (like Graphics{Choice,Radio} in DolphinQt2 which only treat the setting as an integer).
Diffstat (limited to 'Source/Core/DolphinWX/VideoConfigDiag.cpp')
-rw-r--r--Source/Core/DolphinWX/VideoConfigDiag.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp
index c29ce83e1b..11f6ef49cd 100644
--- a/Source/Core/DolphinWX/VideoConfigDiag.cpp
+++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp
@@ -465,7 +465,8 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string& title)
{
szr_shader_compilation->Add(
CreateRadioButton(page_general, modes[i].first, modes[i].second,
- Config::GFX_SHADER_COMPILATION_MODE, static_cast<int>(i)),
+ Config::GFX_SHADER_COMPILATION_MODE,
+ static_cast<ShaderCompilationMode>(i)),
wxGBPosition(static_cast<int>(i / 2), static_cast<int>(i % 2)), wxDefaultSpan,
wxALIGN_CENTER_VERTICAL);
}