mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 17:19:44 -06: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:
@ -8,6 +8,10 @@
|
||||
|
||||
#include "Common/Config/Config.h"
|
||||
|
||||
enum class AspectMode : int;
|
||||
enum class ShaderCompilationMode : int;
|
||||
enum class StereoMode : int;
|
||||
|
||||
namespace Config
|
||||
{
|
||||
// Configuration Information
|
||||
@ -20,8 +24,8 @@ extern const ConfigInfo<int> GFX_ADAPTER;
|
||||
// Graphics.Settings
|
||||
|
||||
extern const ConfigInfo<bool> GFX_WIDESCREEN_HACK;
|
||||
extern const ConfigInfo<int> GFX_ASPECT_RATIO;
|
||||
extern const ConfigInfo<int> GFX_SUGGESTED_ASPECT_RATIO;
|
||||
extern const ConfigInfo<AspectMode> GFX_ASPECT_RATIO;
|
||||
extern const ConfigInfo<AspectMode> GFX_SUGGESTED_ASPECT_RATIO;
|
||||
extern const ConfigInfo<bool> GFX_CROP;
|
||||
extern const ConfigInfo<int> GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES;
|
||||
extern const ConfigInfo<bool> GFX_SHOW_FPS;
|
||||
@ -60,7 +64,7 @@ extern const ConfigInfo<bool> GFX_BACKEND_MULTITHREADING;
|
||||
extern const ConfigInfo<int> GFX_COMMAND_BUFFER_EXECUTE_INTERVAL;
|
||||
extern const ConfigInfo<bool> GFX_SHADER_CACHE;
|
||||
extern const ConfigInfo<bool> GFX_WAIT_FOR_SHADERS_BEFORE_STARTING;
|
||||
extern const ConfigInfo<int> GFX_SHADER_COMPILATION_MODE;
|
||||
extern const ConfigInfo<ShaderCompilationMode> GFX_SHADER_COMPILATION_MODE;
|
||||
extern const ConfigInfo<int> GFX_SHADER_COMPILER_THREADS;
|
||||
extern const ConfigInfo<int> GFX_SHADER_PRECOMPILER_THREADS;
|
||||
|
||||
@ -84,7 +88,7 @@ extern const ConfigInfo<bool> GFX_ENHANCE_DISABLE_COPY_FILTER;
|
||||
|
||||
// Graphics.Stereoscopy
|
||||
|
||||
extern const ConfigInfo<int> GFX_STEREO_MODE;
|
||||
extern const ConfigInfo<StereoMode> GFX_STEREO_MODE;
|
||||
extern const ConfigInfo<int> GFX_STEREO_DEPTH;
|
||||
extern const ConfigInfo<int> GFX_STEREO_CONVERGENCE_PERCENTAGE;
|
||||
extern const ConfigInfo<bool> GFX_STEREO_SWAP_EYES;
|
||||
|
Reference in New Issue
Block a user