mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-09 17:49:01 +00:00
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).
This commit is contained in:
parent
7dca7c237e
commit
6763a3fce1
10 changed files with 87 additions and 54 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue