Large diffs are not rendered by default.

@@ -18,111 +18,111 @@ namespace Config

// Graphics.Hardware

extern const ConfigInfo<bool> GFX_VSYNC;
extern const ConfigInfo<int> GFX_ADAPTER;
extern const Info<bool> GFX_VSYNC;
extern const Info<int> GFX_ADAPTER;

// Graphics.Settings

extern const ConfigInfo<bool> GFX_WIDESCREEN_HACK;
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;
extern const ConfigInfo<bool> GFX_SHOW_NETPLAY_PING;
extern const ConfigInfo<bool> GFX_SHOW_NETPLAY_MESSAGES;
extern const ConfigInfo<bool> GFX_LOG_RENDER_TIME_TO_FILE;
extern const ConfigInfo<bool> GFX_OVERLAY_STATS;
extern const ConfigInfo<bool> GFX_OVERLAY_PROJ_STATS;
extern const ConfigInfo<bool> GFX_DUMP_TEXTURES;
extern const ConfigInfo<bool> GFX_HIRES_TEXTURES;
extern const ConfigInfo<bool> GFX_CACHE_HIRES_TEXTURES;
extern const ConfigInfo<bool> GFX_DUMP_EFB_TARGET;
extern const ConfigInfo<bool> GFX_DUMP_XFB_TARGET;
extern const ConfigInfo<bool> GFX_DUMP_FRAMES_AS_IMAGES;
extern const ConfigInfo<bool> GFX_FREE_LOOK;
extern const ConfigInfo<bool> GFX_USE_FFV1;
extern const ConfigInfo<std::string> GFX_DUMP_FORMAT;
extern const ConfigInfo<std::string> GFX_DUMP_CODEC;
extern const ConfigInfo<std::string> GFX_DUMP_ENCODER;
extern const ConfigInfo<std::string> GFX_DUMP_PATH;
extern const ConfigInfo<int> GFX_BITRATE_KBPS;
extern const ConfigInfo<bool> GFX_INTERNAL_RESOLUTION_FRAME_DUMPS;
extern const ConfigInfo<bool> GFX_ENABLE_GPU_TEXTURE_DECODING;
extern const ConfigInfo<bool> GFX_ENABLE_PIXEL_LIGHTING;
extern const ConfigInfo<bool> GFX_FAST_DEPTH_CALC;
extern const ConfigInfo<u32> GFX_MSAA;
extern const ConfigInfo<bool> GFX_SSAA;
extern const ConfigInfo<int> GFX_EFB_SCALE;
extern const ConfigInfo<int> GFX_MAX_EFB_SCALE;
extern const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_ENABLE;
extern const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_CENTER;
extern const ConfigInfo<bool> GFX_ENABLE_WIREFRAME;
extern const ConfigInfo<bool> GFX_DISABLE_FOG;
extern const ConfigInfo<bool> GFX_BORDERLESS_FULLSCREEN;
extern const ConfigInfo<bool> GFX_ENABLE_VALIDATION_LAYER;
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<ShaderCompilationMode> GFX_SHADER_COMPILATION_MODE;
extern const ConfigInfo<int> GFX_SHADER_COMPILER_THREADS;
extern const ConfigInfo<int> GFX_SHADER_PRECOMPILER_THREADS;
extern const ConfigInfo<bool> GFX_SAVE_TEXTURE_CACHE_TO_STATE;

extern const ConfigInfo<bool> GFX_SW_ZCOMPLOC;
extern const ConfigInfo<bool> GFX_SW_ZFREEZE;
extern const ConfigInfo<bool> GFX_SW_DUMP_OBJECTS;
extern const ConfigInfo<bool> GFX_SW_DUMP_TEV_STAGES;
extern const ConfigInfo<bool> GFX_SW_DUMP_TEV_TEX_FETCHES;
extern const ConfigInfo<int> GFX_SW_DRAW_START;
extern const ConfigInfo<int> GFX_SW_DRAW_END;

extern const ConfigInfo<bool> GFX_PREFER_GLES;
extern const Info<bool> GFX_WIDESCREEN_HACK;
extern const Info<AspectMode> GFX_ASPECT_RATIO;
extern const Info<AspectMode> GFX_SUGGESTED_ASPECT_RATIO;
extern const Info<bool> GFX_CROP;
extern const Info<int> GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES;
extern const Info<bool> GFX_SHOW_FPS;
extern const Info<bool> GFX_SHOW_NETPLAY_PING;
extern const Info<bool> GFX_SHOW_NETPLAY_MESSAGES;
extern const Info<bool> GFX_LOG_RENDER_TIME_TO_FILE;
extern const Info<bool> GFX_OVERLAY_STATS;
extern const Info<bool> GFX_OVERLAY_PROJ_STATS;
extern const Info<bool> GFX_DUMP_TEXTURES;
extern const Info<bool> GFX_HIRES_TEXTURES;
extern const Info<bool> GFX_CACHE_HIRES_TEXTURES;
extern const Info<bool> GFX_DUMP_EFB_TARGET;
extern const Info<bool> GFX_DUMP_XFB_TARGET;
extern const Info<bool> GFX_DUMP_FRAMES_AS_IMAGES;
extern const Info<bool> GFX_FREE_LOOK;
extern const Info<bool> GFX_USE_FFV1;
extern const Info<std::string> GFX_DUMP_FORMAT;
extern const Info<std::string> GFX_DUMP_CODEC;
extern const Info<std::string> GFX_DUMP_ENCODER;
extern const Info<std::string> GFX_DUMP_PATH;
extern const Info<int> GFX_BITRATE_KBPS;
extern const Info<bool> GFX_INTERNAL_RESOLUTION_FRAME_DUMPS;
extern const Info<bool> GFX_ENABLE_GPU_TEXTURE_DECODING;
extern const Info<bool> GFX_ENABLE_PIXEL_LIGHTING;
extern const Info<bool> GFX_FAST_DEPTH_CALC;
extern const Info<u32> GFX_MSAA;
extern const Info<bool> GFX_SSAA;
extern const Info<int> GFX_EFB_SCALE;
extern const Info<int> GFX_MAX_EFB_SCALE;
extern const Info<bool> GFX_TEXFMT_OVERLAY_ENABLE;
extern const Info<bool> GFX_TEXFMT_OVERLAY_CENTER;
extern const Info<bool> GFX_ENABLE_WIREFRAME;
extern const Info<bool> GFX_DISABLE_FOG;
extern const Info<bool> GFX_BORDERLESS_FULLSCREEN;
extern const Info<bool> GFX_ENABLE_VALIDATION_LAYER;
extern const Info<bool> GFX_BACKEND_MULTITHREADING;
extern const Info<int> GFX_COMMAND_BUFFER_EXECUTE_INTERVAL;
extern const Info<bool> GFX_SHADER_CACHE;
extern const Info<bool> GFX_WAIT_FOR_SHADERS_BEFORE_STARTING;
extern const Info<ShaderCompilationMode> GFX_SHADER_COMPILATION_MODE;
extern const Info<int> GFX_SHADER_COMPILER_THREADS;
extern const Info<int> GFX_SHADER_PRECOMPILER_THREADS;
extern const Info<bool> GFX_SAVE_TEXTURE_CACHE_TO_STATE;

extern const Info<bool> GFX_SW_ZCOMPLOC;
extern const Info<bool> GFX_SW_ZFREEZE;
extern const Info<bool> GFX_SW_DUMP_OBJECTS;
extern const Info<bool> GFX_SW_DUMP_TEV_STAGES;
extern const Info<bool> GFX_SW_DUMP_TEV_TEX_FETCHES;
extern const Info<int> GFX_SW_DRAW_START;
extern const Info<int> GFX_SW_DRAW_END;

extern const Info<bool> GFX_PREFER_GLES;

// Graphics.Enhancements

extern const ConfigInfo<bool> GFX_ENHANCE_FORCE_FILTERING;
extern const ConfigInfo<int> GFX_ENHANCE_MAX_ANISOTROPY; // NOTE - this is x in (1 << x)
extern const ConfigInfo<std::string> GFX_ENHANCE_POST_SHADER;
extern const ConfigInfo<bool> GFX_ENHANCE_FORCE_TRUE_COLOR;
extern const ConfigInfo<bool> GFX_ENHANCE_DISABLE_COPY_FILTER;
extern const ConfigInfo<bool> GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION;
extern const ConfigInfo<float> GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION_THRESHOLD;
extern const Info<bool> GFX_ENHANCE_FORCE_FILTERING;
extern const Info<int> GFX_ENHANCE_MAX_ANISOTROPY; // NOTE - this is x in (1 << x)
extern const Info<std::string> GFX_ENHANCE_POST_SHADER;
extern const Info<bool> GFX_ENHANCE_FORCE_TRUE_COLOR;
extern const Info<bool> GFX_ENHANCE_DISABLE_COPY_FILTER;
extern const Info<bool> GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION;
extern const Info<float> GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION_THRESHOLD;

// Graphics.Stereoscopy

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;
extern const ConfigInfo<int> GFX_STEREO_CONVERGENCE;
extern const ConfigInfo<bool> GFX_STEREO_EFB_MONO_DEPTH;
extern const ConfigInfo<int> GFX_STEREO_DEPTH_PERCENTAGE;
extern const Info<StereoMode> GFX_STEREO_MODE;
extern const Info<int> GFX_STEREO_DEPTH;
extern const Info<int> GFX_STEREO_CONVERGENCE_PERCENTAGE;
extern const Info<bool> GFX_STEREO_SWAP_EYES;
extern const Info<int> GFX_STEREO_CONVERGENCE;
extern const Info<bool> GFX_STEREO_EFB_MONO_DEPTH;
extern const Info<int> GFX_STEREO_DEPTH_PERCENTAGE;

// Stereoscopy pseudo-limits for consistent behavior between enhancements tab and hotkeys.
static constexpr int GFX_STEREO_DEPTH_MAXIMUM = 100;
static constexpr int GFX_STEREO_CONVERGENCE_MAXIMUM = 200;

// Graphics.Hacks

extern const ConfigInfo<bool> GFX_HACK_EFB_ACCESS_ENABLE;
extern const ConfigInfo<bool> GFX_HACK_EFB_DEFER_INVALIDATION;
extern const ConfigInfo<int> GFX_HACK_EFB_ACCESS_TILE_SIZE;
extern const ConfigInfo<bool> GFX_HACK_BBOX_ENABLE;
extern const ConfigInfo<bool> GFX_HACK_FORCE_PROGRESSIVE;
extern const ConfigInfo<bool> GFX_HACK_SKIP_EFB_COPY_TO_RAM;
extern const ConfigInfo<bool> GFX_HACK_SKIP_XFB_COPY_TO_RAM;
extern const ConfigInfo<bool> GFX_HACK_DISABLE_COPY_TO_VRAM;
extern const ConfigInfo<bool> GFX_HACK_DEFER_EFB_COPIES;
extern const ConfigInfo<bool> GFX_HACK_IMMEDIATE_XFB;
extern const ConfigInfo<bool> GFX_HACK_SKIP_DUPLICATE_XFBS;
extern const ConfigInfo<bool> GFX_HACK_COPY_EFB_SCALED;
extern const ConfigInfo<bool> GFX_HACK_EFB_EMULATE_FORMAT_CHANGES;
extern const ConfigInfo<bool> GFX_HACK_VERTEX_ROUDING;
extern const Info<bool> GFX_HACK_EFB_ACCESS_ENABLE;
extern const Info<bool> GFX_HACK_EFB_DEFER_INVALIDATION;
extern const Info<int> GFX_HACK_EFB_ACCESS_TILE_SIZE;
extern const Info<bool> GFX_HACK_BBOX_ENABLE;
extern const Info<bool> GFX_HACK_FORCE_PROGRESSIVE;
extern const Info<bool> GFX_HACK_SKIP_EFB_COPY_TO_RAM;
extern const Info<bool> GFX_HACK_SKIP_XFB_COPY_TO_RAM;
extern const Info<bool> GFX_HACK_DISABLE_COPY_TO_VRAM;
extern const Info<bool> GFX_HACK_DEFER_EFB_COPIES;
extern const Info<bool> GFX_HACK_IMMEDIATE_XFB;
extern const Info<bool> GFX_HACK_SKIP_DUPLICATE_XFBS;
extern const Info<bool> GFX_HACK_COPY_EFB_SCALED;
extern const Info<bool> GFX_HACK_EFB_EMULATE_FORMAT_CHANGES;
extern const Info<bool> GFX_HACK_VERTEX_ROUDING;

// Graphics.GameSpecific

extern const ConfigInfo<bool> GFX_PERF_QUERIES_ENABLE;
extern const Info<bool> GFX_PERF_QUERIES_ENABLE;

} // namespace Config

Large diffs are not rendered by default.

@@ -22,99 +22,99 @@ namespace Config
{
// Main.Core

extern const ConfigInfo<bool> MAIN_SKIP_IPL;
extern const ConfigInfo<bool> MAIN_LOAD_IPL_DUMP;
extern const ConfigInfo<PowerPC::CPUCore> MAIN_CPU_CORE;
extern const ConfigInfo<bool> MAIN_JIT_FOLLOW_BRANCH;
extern const ConfigInfo<bool> MAIN_FASTMEM;
extern const Info<bool> MAIN_SKIP_IPL;
extern const Info<bool> MAIN_LOAD_IPL_DUMP;
extern const Info<PowerPC::CPUCore> MAIN_CPU_CORE;
extern const Info<bool> MAIN_JIT_FOLLOW_BRANCH;
extern const Info<bool> MAIN_FASTMEM;
// Should really be in the DSP section, but we're kind of stuck with bad decisions made in the past.
extern const ConfigInfo<bool> MAIN_DSP_HLE;
extern const ConfigInfo<int> MAIN_TIMING_VARIANCE;
extern const ConfigInfo<bool> MAIN_CPU_THREAD;
extern const ConfigInfo<bool> MAIN_SYNC_ON_SKIP_IDLE;
extern const ConfigInfo<std::string> MAIN_DEFAULT_ISO;
extern const ConfigInfo<bool> MAIN_ENABLE_CHEATS;
extern const ConfigInfo<int> MAIN_GC_LANGUAGE;
extern const ConfigInfo<bool> MAIN_OVERRIDE_REGION_SETTINGS;
extern const ConfigInfo<bool> MAIN_DPL2_DECODER;
extern const ConfigInfo<AudioCommon::DPL2Quality> MAIN_DPL2_QUALITY;
extern const ConfigInfo<int> MAIN_AUDIO_LATENCY;
extern const ConfigInfo<bool> MAIN_AUDIO_STRETCH;
extern const ConfigInfo<int> MAIN_AUDIO_STRETCH_LATENCY;
extern const ConfigInfo<std::string> MAIN_MEMCARD_A_PATH;
extern const ConfigInfo<std::string> MAIN_MEMCARD_B_PATH;
extern const ConfigInfo<std::string> MAIN_AGP_CART_A_PATH;
extern const ConfigInfo<std::string> MAIN_AGP_CART_B_PATH;
extern const ConfigInfo<std::string> MAIN_GCI_FOLDER_A_PATH_OVERRIDE;
extern const ConfigInfo<std::string> MAIN_GCI_FOLDER_B_PATH_OVERRIDE;
extern const ConfigInfo<bool> MAIN_CODE_SYNC_OVERRIDE;
extern const ConfigInfo<bool> MAIN_GCI_FOLDER_CURRENT_GAME_ONLY;
extern const ConfigInfo<int> MAIN_SLOT_A;
extern const ConfigInfo<int> MAIN_SLOT_B;
extern const ConfigInfo<int> MAIN_SERIAL_PORT_1;
extern const ConfigInfo<std::string> MAIN_BBA_MAC;
ConfigInfo<u32> GetInfoForSIDevice(u32 channel);
ConfigInfo<bool> GetInfoForAdapterRumble(u32 channel);
ConfigInfo<bool> GetInfoForSimulateKonga(u32 channel);
extern const ConfigInfo<bool> MAIN_WII_SD_CARD;
extern const ConfigInfo<bool> MAIN_WII_SD_CARD_WRITABLE;
extern const ConfigInfo<bool> MAIN_WII_KEYBOARD;
extern const ConfigInfo<bool> MAIN_WIIMOTE_CONTINUOUS_SCANNING;
extern const ConfigInfo<bool> MAIN_WIIMOTE_ENABLE_SPEAKER;
extern const ConfigInfo<bool> MAIN_RUN_COMPARE_SERVER;
extern const ConfigInfo<bool> MAIN_RUN_COMPARE_CLIENT;
extern const ConfigInfo<bool> MAIN_MMU;
extern const ConfigInfo<int> MAIN_BB_DUMP_PORT;
extern const ConfigInfo<bool> MAIN_SYNC_GPU;
extern const ConfigInfo<int> MAIN_SYNC_GPU_MAX_DISTANCE;
extern const ConfigInfo<int> MAIN_SYNC_GPU_MIN_DISTANCE;
extern const ConfigInfo<float> MAIN_SYNC_GPU_OVERCLOCK;
extern const ConfigInfo<bool> MAIN_FAST_DISC_SPEED;
extern const ConfigInfo<bool> MAIN_LOW_DCBZ_HACK;
extern const ConfigInfo<bool> MAIN_FPRF;
extern const ConfigInfo<bool> MAIN_ACCURATE_NANS;
extern const ConfigInfo<float> MAIN_EMULATION_SPEED;
extern const ConfigInfo<float> MAIN_OVERCLOCK;
extern const ConfigInfo<bool> MAIN_OVERCLOCK_ENABLE;
extern const ConfigInfo<bool> MAIN_RAM_OVERRIDE_ENABLE;
extern const ConfigInfo<u32> MAIN_MEM1_SIZE;
extern const ConfigInfo<u32> MAIN_MEM2_SIZE;
extern const Info<bool> MAIN_DSP_HLE;
extern const Info<int> MAIN_TIMING_VARIANCE;
extern const Info<bool> MAIN_CPU_THREAD;
extern const Info<bool> MAIN_SYNC_ON_SKIP_IDLE;
extern const Info<std::string> MAIN_DEFAULT_ISO;
extern const Info<bool> MAIN_ENABLE_CHEATS;
extern const Info<int> MAIN_GC_LANGUAGE;
extern const Info<bool> MAIN_OVERRIDE_REGION_SETTINGS;
extern const Info<bool> MAIN_DPL2_DECODER;
extern const Info<AudioCommon::DPL2Quality> MAIN_DPL2_QUALITY;
extern const Info<int> MAIN_AUDIO_LATENCY;
extern const Info<bool> MAIN_AUDIO_STRETCH;
extern const Info<int> MAIN_AUDIO_STRETCH_LATENCY;
extern const Info<std::string> MAIN_MEMCARD_A_PATH;
extern const Info<std::string> MAIN_MEMCARD_B_PATH;
extern const Info<std::string> MAIN_AGP_CART_A_PATH;
extern const Info<std::string> MAIN_AGP_CART_B_PATH;
extern const Info<std::string> MAIN_GCI_FOLDER_A_PATH_OVERRIDE;
extern const Info<std::string> MAIN_GCI_FOLDER_B_PATH_OVERRIDE;
extern const Info<bool> MAIN_CODE_SYNC_OVERRIDE;
extern const Info<bool> MAIN_GCI_FOLDER_CURRENT_GAME_ONLY;
extern const Info<int> MAIN_SLOT_A;
extern const Info<int> MAIN_SLOT_B;
extern const Info<int> MAIN_SERIAL_PORT_1;
extern const Info<std::string> MAIN_BBA_MAC;
Info<u32> GetInfoForSIDevice(u32 channel);
Info<bool> GetInfoForAdapterRumble(u32 channel);
Info<bool> GetInfoForSimulateKonga(u32 channel);
extern const Info<bool> MAIN_WII_SD_CARD;
extern const Info<bool> MAIN_WII_SD_CARD_WRITABLE;
extern const Info<bool> MAIN_WII_KEYBOARD;
extern const Info<bool> MAIN_WIIMOTE_CONTINUOUS_SCANNING;
extern const Info<bool> MAIN_WIIMOTE_ENABLE_SPEAKER;
extern const Info<bool> MAIN_RUN_COMPARE_SERVER;
extern const Info<bool> MAIN_RUN_COMPARE_CLIENT;
extern const Info<bool> MAIN_MMU;
extern const Info<int> MAIN_BB_DUMP_PORT;
extern const Info<bool> MAIN_SYNC_GPU;
extern const Info<int> MAIN_SYNC_GPU_MAX_DISTANCE;
extern const Info<int> MAIN_SYNC_GPU_MIN_DISTANCE;
extern const Info<float> MAIN_SYNC_GPU_OVERCLOCK;
extern const Info<bool> MAIN_FAST_DISC_SPEED;
extern const Info<bool> MAIN_LOW_DCBZ_HACK;
extern const Info<bool> MAIN_FPRF;
extern const Info<bool> MAIN_ACCURATE_NANS;
extern const Info<float> MAIN_EMULATION_SPEED;
extern const Info<float> MAIN_OVERCLOCK;
extern const Info<bool> MAIN_OVERCLOCK_ENABLE;
extern const Info<bool> MAIN_RAM_OVERRIDE_ENABLE;
extern const Info<u32> MAIN_MEM1_SIZE;
extern const Info<u32> MAIN_MEM2_SIZE;
// Should really be part of System::GFX, but again, we're stuck with past mistakes.
extern const ConfigInfo<std::string> MAIN_GFX_BACKEND;
extern const ConfigInfo<std::string> MAIN_GPU_DETERMINISM_MODE;
extern const ConfigInfo<std::string> MAIN_PERF_MAP_DIR;
extern const ConfigInfo<bool> MAIN_CUSTOM_RTC_ENABLE;
extern const ConfigInfo<u32> MAIN_CUSTOM_RTC_VALUE;
extern const ConfigInfo<bool> MAIN_AUTO_DISC_CHANGE;
extern const Info<std::string> MAIN_GFX_BACKEND;
extern const Info<std::string> MAIN_GPU_DETERMINISM_MODE;
extern const Info<std::string> MAIN_PERF_MAP_DIR;
extern const Info<bool> MAIN_CUSTOM_RTC_ENABLE;
extern const Info<u32> MAIN_CUSTOM_RTC_VALUE;
extern const Info<bool> MAIN_AUTO_DISC_CHANGE;

// Main.DSP

extern const ConfigInfo<bool> MAIN_DSP_CAPTURE_LOG;
extern const ConfigInfo<bool> MAIN_DSP_JIT;
extern const ConfigInfo<bool> MAIN_DUMP_AUDIO;
extern const ConfigInfo<bool> MAIN_DUMP_AUDIO_SILENT;
extern const ConfigInfo<bool> MAIN_DUMP_UCODE;
extern const ConfigInfo<std::string> MAIN_AUDIO_BACKEND;
extern const ConfigInfo<int> MAIN_AUDIO_VOLUME;
extern const Info<bool> MAIN_DSP_CAPTURE_LOG;
extern const Info<bool> MAIN_DSP_JIT;
extern const Info<bool> MAIN_DUMP_AUDIO;
extern const Info<bool> MAIN_DUMP_AUDIO_SILENT;
extern const Info<bool> MAIN_DUMP_UCODE;
extern const Info<std::string> MAIN_AUDIO_BACKEND;
extern const Info<int> MAIN_AUDIO_VOLUME;

// Main.Display

extern const ConfigInfo<std::string> MAIN_FULLSCREEN_DISPLAY_RES;
extern const ConfigInfo<bool> MAIN_FULLSCREEN;
extern const ConfigInfo<bool> MAIN_RENDER_TO_MAIN;
extern const ConfigInfo<int> MAIN_RENDER_WINDOW_XPOS;
extern const ConfigInfo<int> MAIN_RENDER_WINDOW_YPOS;
extern const ConfigInfo<int> MAIN_RENDER_WINDOW_WIDTH;
extern const ConfigInfo<int> MAIN_RENDER_WINDOW_HEIGHT;
extern const ConfigInfo<bool> MAIN_RENDER_WINDOW_AUTOSIZE;
extern const ConfigInfo<bool> MAIN_KEEP_WINDOW_ON_TOP;
extern const ConfigInfo<bool> MAIN_DISABLE_SCREENSAVER;
extern const Info<std::string> MAIN_FULLSCREEN_DISPLAY_RES;
extern const Info<bool> MAIN_FULLSCREEN;
extern const Info<bool> MAIN_RENDER_TO_MAIN;
extern const Info<int> MAIN_RENDER_WINDOW_XPOS;
extern const Info<int> MAIN_RENDER_WINDOW_YPOS;
extern const Info<int> MAIN_RENDER_WINDOW_WIDTH;
extern const Info<int> MAIN_RENDER_WINDOW_HEIGHT;
extern const Info<bool> MAIN_RENDER_WINDOW_AUTOSIZE;
extern const Info<bool> MAIN_KEEP_WINDOW_ON_TOP;
extern const Info<bool> MAIN_DISABLE_SCREENSAVER;

// Main.General

extern const ConfigInfo<std::string> MAIN_DUMP_PATH;
extern const ConfigInfo<std::string> MAIN_LOAD_PATH;
extern const ConfigInfo<std::string> MAIN_RESOURCEPACK_PATH;
extern const ConfigInfo<std::string> MAIN_FS_PATH;
extern const ConfigInfo<std::string> MAIN_SD_PATH;
extern const Info<std::string> MAIN_DUMP_PATH;
extern const Info<std::string> MAIN_LOAD_PATH;
extern const Info<std::string> MAIN_RESOURCEPACK_PATH;
extern const Info<std::string> MAIN_FS_PATH;
extern const Info<std::string> MAIN_SD_PATH;
} // namespace Config
@@ -14,55 +14,49 @@ static constexpr u16 DEFAULT_LISTEN_PORT = 2626;

// Main.NetPlay

const ConfigInfo<std::string> NETPLAY_TRAVERSAL_SERVER{{System::Main, "NetPlay", "TraversalServer"},
"stun.dolphin-emu.org"};
const ConfigInfo<u16> NETPLAY_TRAVERSAL_PORT{{System::Main, "NetPlay", "TraversalPort"}, 6262};
const ConfigInfo<std::string> NETPLAY_TRAVERSAL_CHOICE{{System::Main, "NetPlay", "TraversalChoice"},
"direct"};
const ConfigInfo<std::string> NETPLAY_INDEX_URL{{System::Main, "NetPlay", "IndexServer"},
"https://lobby.dolphin-emu.org"};
const Info<std::string> NETPLAY_TRAVERSAL_SERVER{{System::Main, "NetPlay", "TraversalServer"},
"stun.dolphin-emu.org"};
const Info<u16> NETPLAY_TRAVERSAL_PORT{{System::Main, "NetPlay", "TraversalPort"}, 6262};
const Info<std::string> NETPLAY_TRAVERSAL_CHOICE{{System::Main, "NetPlay", "TraversalChoice"},
"direct"};
const Info<std::string> NETPLAY_INDEX_URL{{System::Main, "NetPlay", "IndexServer"},
"https://lobby.dolphin-emu.org"};

const ConfigInfo<bool> NETPLAY_USE_INDEX{{System::Main, "NetPlay", "UseIndex"}, false};
const ConfigInfo<std::string> NETPLAY_INDEX_NAME{{System::Main, "NetPlay", "IndexName"}, ""};
const ConfigInfo<std::string> NETPLAY_INDEX_REGION{{System::Main, "NetPlay", "IndexRegion"}, ""};
const ConfigInfo<std::string> NETPLAY_INDEX_PASSWORD{{System::Main, "NetPlay", "IndexPassword"},
""};
const Info<bool> NETPLAY_USE_INDEX{{System::Main, "NetPlay", "UseIndex"}, false};
const Info<std::string> NETPLAY_INDEX_NAME{{System::Main, "NetPlay", "IndexName"}, ""};
const Info<std::string> NETPLAY_INDEX_REGION{{System::Main, "NetPlay", "IndexRegion"}, ""};
const Info<std::string> NETPLAY_INDEX_PASSWORD{{System::Main, "NetPlay", "IndexPassword"}, ""};

const ConfigInfo<std::string> NETPLAY_HOST_CODE{{System::Main, "NetPlay", "HostCode"}, "00000000"};
const Info<std::string> NETPLAY_HOST_CODE{{System::Main, "NetPlay", "HostCode"}, "00000000"};

const ConfigInfo<u16> NETPLAY_HOST_PORT{{System::Main, "NetPlay", "HostPort"}, DEFAULT_LISTEN_PORT};
const ConfigInfo<std::string> NETPLAY_ADDRESS{{System::Main, "NetPlay", "Address"}, "127.0.0.1"};
const ConfigInfo<u16> NETPLAY_CONNECT_PORT{{System::Main, "NetPlay", "ConnectPort"},
DEFAULT_LISTEN_PORT};
const ConfigInfo<u16> NETPLAY_LISTEN_PORT{{System::Main, "NetPlay", "ListenPort"},
DEFAULT_LISTEN_PORT};
const Info<u16> NETPLAY_HOST_PORT{{System::Main, "NetPlay", "HostPort"}, DEFAULT_LISTEN_PORT};
const Info<std::string> NETPLAY_ADDRESS{{System::Main, "NetPlay", "Address"}, "127.0.0.1"};
const Info<u16> NETPLAY_CONNECT_PORT{{System::Main, "NetPlay", "ConnectPort"}, DEFAULT_LISTEN_PORT};
const Info<u16> NETPLAY_LISTEN_PORT{{System::Main, "NetPlay", "ListenPort"}, DEFAULT_LISTEN_PORT};

const ConfigInfo<std::string> NETPLAY_NICKNAME{{System::Main, "NetPlay", "Nickname"}, "Player"};
const ConfigInfo<bool> NETPLAY_USE_UPNP{{System::Main, "NetPlay", "UseUPNP"}, false};
const Info<std::string> NETPLAY_NICKNAME{{System::Main, "NetPlay", "Nickname"}, "Player"};
const Info<bool> NETPLAY_USE_UPNP{{System::Main, "NetPlay", "UseUPNP"}, false};

const ConfigInfo<bool> NETPLAY_ENABLE_QOS{{System::Main, "NetPlay", "EnableQoS"}, true};
const Info<bool> NETPLAY_ENABLE_QOS{{System::Main, "NetPlay", "EnableQoS"}, true};

const ConfigInfo<bool> NETPLAY_ENABLE_CHUNKED_UPLOAD_LIMIT{
const Info<bool> NETPLAY_ENABLE_CHUNKED_UPLOAD_LIMIT{
{System::Main, "NetPlay", "EnableChunkedUploadLimit"}, false};
const ConfigInfo<u32> NETPLAY_CHUNKED_UPLOAD_LIMIT{{System::Main, "NetPlay", "ChunkedUploadLimit"},
3000};

const ConfigInfo<u32> NETPLAY_BUFFER_SIZE{{System::Main, "NetPlay", "BufferSize"}, 5};
const ConfigInfo<u32> NETPLAY_CLIENT_BUFFER_SIZE{{System::Main, "NetPlay", "BufferSizeClient"}, 1};

const ConfigInfo<bool> NETPLAY_WRITE_SAVE_SDCARD_DATA{
{System::Main, "NetPlay", "WriteSaveSDCardData"}, false};
const ConfigInfo<bool> NETPLAY_LOAD_WII_SAVE{{System::Main, "NetPlay", "LoadWiiSave"}, false};
const ConfigInfo<bool> NETPLAY_SYNC_SAVES{{System::Main, "NetPlay", "SyncSaves"}, true};
const ConfigInfo<bool> NETPLAY_SYNC_CODES{{System::Main, "NetPlay", "SyncCodes"}, true};
const ConfigInfo<bool> NETPLAY_RECORD_INPUTS{{System::Main, "NetPlay", "RecordInputs"}, false};
const ConfigInfo<bool> NETPLAY_STRICT_SETTINGS_SYNC{{System::Main, "NetPlay", "StrictSettingsSync"},
false};
const ConfigInfo<std::string> NETPLAY_NETWORK_MODE{{System::Main, "NetPlay", "NetworkMode"},
"fixeddelay"};
const ConfigInfo<bool> NETPLAY_SYNC_ALL_WII_SAVES{{System::Main, "NetPlay", "SyncAllWiiSaves"},
false};
const ConfigInfo<bool> NETPLAY_GOLF_MODE_OVERLAY{{System::Main, "NetPlay", "GolfModeOverlay"},
true};
const Info<u32> NETPLAY_CHUNKED_UPLOAD_LIMIT{{System::Main, "NetPlay", "ChunkedUploadLimit"}, 3000};

const Info<u32> NETPLAY_BUFFER_SIZE{{System::Main, "NetPlay", "BufferSize"}, 5};
const Info<u32> NETPLAY_CLIENT_BUFFER_SIZE{{System::Main, "NetPlay", "BufferSizeClient"}, 1};

const Info<bool> NETPLAY_WRITE_SAVE_SDCARD_DATA{{System::Main, "NetPlay", "WriteSaveSDCardData"},
false};
const Info<bool> NETPLAY_LOAD_WII_SAVE{{System::Main, "NetPlay", "LoadWiiSave"}, false};
const Info<bool> NETPLAY_SYNC_SAVES{{System::Main, "NetPlay", "SyncSaves"}, true};
const Info<bool> NETPLAY_SYNC_CODES{{System::Main, "NetPlay", "SyncCodes"}, true};
const Info<bool> NETPLAY_RECORD_INPUTS{{System::Main, "NetPlay", "RecordInputs"}, false};
const Info<bool> NETPLAY_STRICT_SETTINGS_SYNC{{System::Main, "NetPlay", "StrictSettingsSync"},
false};
const Info<std::string> NETPLAY_NETWORK_MODE{{System::Main, "NetPlay", "NetworkMode"},
"fixeddelay"};
const Info<bool> NETPLAY_SYNC_ALL_WII_SAVES{{System::Main, "NetPlay", "SyncAllWiiSaves"}, false};
const Info<bool> NETPLAY_GOLF_MODE_OVERLAY{{System::Main, "NetPlay", "GolfModeOverlay"}, true};

} // namespace Config
@@ -15,41 +15,41 @@ namespace Config

// Main.NetPlay

extern const ConfigInfo<std::string> NETPLAY_TRAVERSAL_SERVER;
extern const ConfigInfo<u16> NETPLAY_TRAVERSAL_PORT;
extern const ConfigInfo<std::string> NETPLAY_TRAVERSAL_CHOICE;
extern const ConfigInfo<std::string> NETPLAY_HOST_CODE;
extern const ConfigInfo<std::string> NETPLAY_INDEX_URL;

extern const ConfigInfo<u16> NETPLAY_HOST_PORT;
extern const ConfigInfo<std::string> NETPLAY_ADDRESS;
extern const ConfigInfo<u16> NETPLAY_CONNECT_PORT;
extern const ConfigInfo<u16> NETPLAY_LISTEN_PORT;

extern const ConfigInfo<std::string> NETPLAY_NICKNAME;
extern const ConfigInfo<bool> NETPLAY_USE_UPNP;

extern const ConfigInfo<bool> NETPLAY_ENABLE_QOS;

extern const ConfigInfo<bool> NETPLAY_USE_INDEX;
extern const ConfigInfo<std::string> NETPLAY_INDEX_REGION;
extern const ConfigInfo<std::string> NETPLAY_INDEX_NAME;
extern const ConfigInfo<std::string> NETPLAY_INDEX_PASSWORD;

extern const ConfigInfo<bool> NETPLAY_ENABLE_CHUNKED_UPLOAD_LIMIT;
extern const ConfigInfo<u32> NETPLAY_CHUNKED_UPLOAD_LIMIT;

extern const ConfigInfo<u32> NETPLAY_BUFFER_SIZE;
extern const ConfigInfo<u32> NETPLAY_CLIENT_BUFFER_SIZE;

extern const ConfigInfo<bool> NETPLAY_WRITE_SAVE_SDCARD_DATA;
extern const ConfigInfo<bool> NETPLAY_LOAD_WII_SAVE;
extern const ConfigInfo<bool> NETPLAY_SYNC_SAVES;
extern const ConfigInfo<bool> NETPLAY_SYNC_CODES;
extern const ConfigInfo<bool> NETPLAY_RECORD_INPUTS;
extern const ConfigInfo<bool> NETPLAY_STRICT_SETTINGS_SYNC;
extern const ConfigInfo<std::string> NETPLAY_NETWORK_MODE;
extern const ConfigInfo<bool> NETPLAY_SYNC_ALL_WII_SAVES;
extern const ConfigInfo<bool> NETPLAY_GOLF_MODE_OVERLAY;
extern const Info<std::string> NETPLAY_TRAVERSAL_SERVER;
extern const Info<u16> NETPLAY_TRAVERSAL_PORT;
extern const Info<std::string> NETPLAY_TRAVERSAL_CHOICE;
extern const Info<std::string> NETPLAY_HOST_CODE;
extern const Info<std::string> NETPLAY_INDEX_URL;

extern const Info<u16> NETPLAY_HOST_PORT;
extern const Info<std::string> NETPLAY_ADDRESS;
extern const Info<u16> NETPLAY_CONNECT_PORT;
extern const Info<u16> NETPLAY_LISTEN_PORT;

extern const Info<std::string> NETPLAY_NICKNAME;
extern const Info<bool> NETPLAY_USE_UPNP;

extern const Info<bool> NETPLAY_ENABLE_QOS;

extern const Info<bool> NETPLAY_USE_INDEX;
extern const Info<std::string> NETPLAY_INDEX_REGION;
extern const Info<std::string> NETPLAY_INDEX_NAME;
extern const Info<std::string> NETPLAY_INDEX_PASSWORD;

extern const Info<bool> NETPLAY_ENABLE_CHUNKED_UPLOAD_LIMIT;
extern const Info<u32> NETPLAY_CHUNKED_UPLOAD_LIMIT;

extern const Info<u32> NETPLAY_BUFFER_SIZE;
extern const Info<u32> NETPLAY_CLIENT_BUFFER_SIZE;

extern const Info<bool> NETPLAY_WRITE_SAVE_SDCARD_DATA;
extern const Info<bool> NETPLAY_LOAD_WII_SAVE;
extern const Info<bool> NETPLAY_SYNC_SAVES;
extern const Info<bool> NETPLAY_SYNC_CODES;
extern const Info<bool> NETPLAY_RECORD_INPUTS;
extern const Info<bool> NETPLAY_STRICT_SETTINGS_SYNC;
extern const Info<std::string> NETPLAY_NETWORK_MODE;
extern const Info<bool> NETPLAY_SYNC_ALL_WII_SAVES;
extern const Info<bool> NETPLAY_GOLF_MODE_OVERLAY;

} // namespace Config
@@ -8,19 +8,19 @@ namespace Config
{
// SYSCONF.IPL

const ConfigInfo<bool> SYSCONF_SCREENSAVER{{System::SYSCONF, "IPL", "SSV"}, false};
const ConfigInfo<u32> SYSCONF_LANGUAGE{{System::SYSCONF, "IPL", "LNG"}, 0x01};
const ConfigInfo<u32> SYSCONF_COUNTRY{{System::SYSCONF, "IPL", "SADR"}, 0x6c};
const ConfigInfo<bool> SYSCONF_WIDESCREEN{{System::SYSCONF, "IPL", "AR"}, true};
const ConfigInfo<bool> SYSCONF_PROGRESSIVE_SCAN{{System::SYSCONF, "IPL", "PGS"}, true};
const ConfigInfo<bool> SYSCONF_PAL60{{System::SYSCONF, "IPL", "E60"}, 0x01};
const Info<bool> SYSCONF_SCREENSAVER{{System::SYSCONF, "IPL", "SSV"}, false};
const Info<u32> SYSCONF_LANGUAGE{{System::SYSCONF, "IPL", "LNG"}, 0x01};
const Info<u32> SYSCONF_COUNTRY{{System::SYSCONF, "IPL", "SADR"}, 0x6c};
const Info<bool> SYSCONF_WIDESCREEN{{System::SYSCONF, "IPL", "AR"}, true};
const Info<bool> SYSCONF_PROGRESSIVE_SCAN{{System::SYSCONF, "IPL", "PGS"}, true};
const Info<bool> SYSCONF_PAL60{{System::SYSCONF, "IPL", "E60"}, 0x01};

// SYSCONF.BT

const ConfigInfo<u32> SYSCONF_SENSOR_BAR_POSITION{{System::SYSCONF, "BT", "BAR"}, 0x01};
const ConfigInfo<u32> SYSCONF_SENSOR_BAR_SENSITIVITY{{System::SYSCONF, "BT", "SENS"}, 0x03};
const ConfigInfo<u32> SYSCONF_SPEAKER_VOLUME{{System::SYSCONF, "BT", "SPKV"}, 0x58};
const ConfigInfo<bool> SYSCONF_WIIMOTE_MOTOR{{System::SYSCONF, "BT", "MOT"}, true};
const Info<u32> SYSCONF_SENSOR_BAR_POSITION{{System::SYSCONF, "BT", "BAR"}, 0x01};
const Info<u32> SYSCONF_SENSOR_BAR_SENSITIVITY{{System::SYSCONF, "BT", "SENS"}, 0x03};
const Info<u32> SYSCONF_SPEAKER_VOLUME{{System::SYSCONF, "BT", "SPKV"}, 0x58};
const Info<bool> SYSCONF_WIIMOTE_MOTOR{{System::SYSCONF, "BT", "MOT"}, true};

const std::array<SYSCONFSetting, 10> SYSCONF_SETTINGS{
{{SYSCONF_SCREENSAVER, SysConf::Entry::Type::Byte},
@@ -16,23 +16,23 @@ namespace Config

// SYSCONF.IPL

extern const ConfigInfo<bool> SYSCONF_SCREENSAVER;
extern const ConfigInfo<u32> SYSCONF_LANGUAGE;
extern const ConfigInfo<u32> SYSCONF_COUNTRY;
extern const ConfigInfo<bool> SYSCONF_WIDESCREEN;
extern const ConfigInfo<bool> SYSCONF_PROGRESSIVE_SCAN;
extern const ConfigInfo<bool> SYSCONF_PAL60;
extern const Info<bool> SYSCONF_SCREENSAVER;
extern const Info<u32> SYSCONF_LANGUAGE;
extern const Info<u32> SYSCONF_COUNTRY;
extern const Info<bool> SYSCONF_WIDESCREEN;
extern const Info<bool> SYSCONF_PROGRESSIVE_SCAN;
extern const Info<bool> SYSCONF_PAL60;

// SYSCONF.BT

extern const ConfigInfo<u32> SYSCONF_SENSOR_BAR_POSITION;
extern const ConfigInfo<u32> SYSCONF_SENSOR_BAR_SENSITIVITY;
extern const ConfigInfo<u32> SYSCONF_SPEAKER_VOLUME;
extern const ConfigInfo<bool> SYSCONF_WIIMOTE_MOTOR;
extern const Info<u32> SYSCONF_SENSOR_BAR_POSITION;
extern const Info<u32> SYSCONF_SENSOR_BAR_SENSITIVITY;
extern const Info<u32> SYSCONF_SPEAKER_VOLUME;
extern const Info<bool> SYSCONF_WIIMOTE_MOTOR;

struct SYSCONFSetting
{
std::variant<ConfigInfo<u32>, ConfigInfo<bool>> config_info;
std::variant<Info<u32>, Info<bool>> config_info;
SysConf::Entry::Type type;
};

@@ -8,10 +8,9 @@ namespace Config
{
// UI.General

const ConfigInfo<bool> MAIN_USE_DISCORD_PRESENCE{{System::Main, "General", "UseDiscordPresence"},
true};
const ConfigInfo<bool> MAIN_USE_GAME_COVERS{{System::Main, "General", "UseGameCovers"}, false};
const Info<bool> MAIN_USE_DISCORD_PRESENCE{{System::Main, "General", "UseDiscordPresence"}, true};
const Info<bool> MAIN_USE_GAME_COVERS{{System::Main, "General", "UseGameCovers"}, false};

const ConfigInfo<bool> MAIN_FOCUSED_HOTKEYS{{System::Main, "General", "HotkeysRequireFocus"}, true};
const Info<bool> MAIN_FOCUSED_HOTKEYS{{System::Main, "General", "HotkeysRequireFocus"}, true};

} // namespace Config
@@ -16,8 +16,8 @@ namespace Config

// UI.General

extern const ConfigInfo<bool> MAIN_USE_DISCORD_PRESENCE;
extern const ConfigInfo<bool> MAIN_USE_GAME_COVERS;
extern const ConfigInfo<bool> MAIN_FOCUSED_HOTKEYS;
extern const Info<bool> MAIN_USE_DISCORD_PRESENCE;
extern const Info<bool> MAIN_USE_GAME_COVERS;
extern const Info<bool> MAIN_FOCUSED_HOTKEYS;

} // namespace Config
@@ -113,7 +113,7 @@ class BaseConfigLayerLoader final : public Config::ConfigLayerLoader

for (const auto& value : section_map)
{
const Config::ConfigLocation location{system.first, section_name, value.first};
const Config::Location location{system.first, section_name, value.first};
layer->Set(location, value.second);
}
}
@@ -133,7 +133,7 @@ class BaseConfigLayerLoader final : public Config::ConfigLayerLoader

for (const auto& config : layer->GetLayerMap())
{
const Config::ConfigLocation& location = config.first;
const Config::Location& location = config.first;
const std::optional<std::string>& value = config.second;

// Done by SaveToSYSCONF
@@ -59,11 +59,11 @@ std::vector<std::string> GetGameIniFilenames(const std::string& id, std::optiona
return filenames;
}

using ConfigLocation = Config::ConfigLocation;
using INIToLocationMap = std::map<std::pair<std::string, std::string>, ConfigLocation>;
using Location = Config::Location;
using INIToLocationMap = std::map<std::pair<std::string, std::string>, Location>;
using INIToSectionMap = std::map<std::string, std::pair<Config::System, std::string>>;

// This is a mapping from the legacy section-key pairs to ConfigLocations.
// This is a mapping from the legacy section-key pairs to Locations.
// New settings do not need to be added to this mapping.
// See also: MapINIToRealLocation and GetINILocationFromConfig.
static const INIToLocationMap& GetINIToLocationMap()
@@ -95,11 +95,11 @@ static const INIToSectionMap& GetINIToSectionMap()
return ini_to_section;
}

// Converts from a legacy GameINI section-key tuple to a ConfigLocation.
// Converts from a legacy GameINI section-key tuple to a Location.
// Also supports the following format:
// [System.Section]
// Key = Value
static ConfigLocation MapINIToRealLocation(const std::string& section, const std::string& key)
static Location MapINIToRealLocation(const std::string& section, const std::string& key)
{
static const INIToLocationMap& ini_to_location = GetINIToLocationMap();
const auto it = ini_to_location.find({section, key});
@@ -130,7 +130,7 @@ static ConfigLocation MapINIToRealLocation(const std::string& section, const std
return {Config::System::Main, "", ""};
}

static std::pair<std::string, std::string> GetINILocationFromConfig(const ConfigLocation& location)
static std::pair<std::string, std::string> GetINILocationFromConfig(const Location& location)
{
static const INIToLocationMap& ini_to_location = GetINIToLocationMap();
const auto it = std::find_if(ini_to_location.begin(), ini_to_location.end(),
@@ -205,7 +205,7 @@ class INIGameConfigLayerLoader final : public Config::ConfigLayerLoader
std::string path = "Profiles/" + std::get<1>(use_data) + "/";

const auto control_section = [&](std::string key) {
return Config::ConfigLocation{std::get<2>(use_data), "Controls", key};
return Config::Location{std::get<2>(use_data), "Controls", key};
};

for (const char num : nums)
@@ -227,8 +227,8 @@ class INIGameConfigLayerLoader final : public Config::ConfigLayerLoader
const IniFile::Section::SectionMap& section_map = ini_section->GetValues();
for (const auto& value : section_map)
{
Config::ConfigLocation location{std::get<2>(use_data), std::get<1>(use_data) + num,
value.first};
Config::Location location{std::get<2>(use_data), std::get<1>(use_data) + num,
value.first};
layer->Set(location, value.second);
}
}
@@ -269,7 +269,7 @@ void INIGameConfigLayerLoader::Save(Config::Layer* layer)

for (const auto& config : layer->GetLayerMap())
{
const Config::ConfigLocation& location = config.first;
const Config::Location& location = config.first;
const std::optional<std::string>& value = config.second;

if (!IsSettingSaveable(location))
@@ -14,7 +14,7 @@

namespace ConfigLoaders
{
bool IsSettingSaveable(const Config::ConfigLocation& config_location)
bool IsSettingSaveable(const Config::Location& config_location)
{
if (config_location.system == Config::System::DualShockUDPClient)
return true;
@@ -28,7 +28,7 @@ bool IsSettingSaveable(const Config::ConfigLocation& config_location)
return true;
}

static constexpr std::array<const Config::ConfigLocation*, 96> s_setting_saveable = {
static constexpr std::array<const Config::Location*, 96> s_setting_saveable = {
// Main.Core

&Config::MAIN_DEFAULT_ISO.location,
@@ -155,7 +155,7 @@ bool IsSettingSaveable(const Config::ConfigLocation& config_location)
};

return std::any_of(s_setting_saveable.cbegin(), s_setting_saveable.cend(),
[&config_location](const Config::ConfigLocation* location) {
[&config_location](const Config::Location* location) {
return *location == config_location;
});
}
@@ -6,13 +6,13 @@

namespace Config
{
struct ConfigLocation;
struct Location;
}

namespace ConfigLoaders
{
// This is a temporary function that allows for both the new and old configuration
// systems to co-exist without trampling on each other while saving.
// This function shall be removed when the old configuration system retires.
bool IsSettingSaveable(const Config::ConfigLocation& config_location);
bool IsSettingSaveable(const Config::Location& config_location);
} // namespace ConfigLoaders
@@ -12,8 +12,7 @@

#include <QFont>

GraphicsBool::GraphicsBool(const QString& label, const Config::ConfigInfo<bool>& setting,
bool reverse)
GraphicsBool::GraphicsBool(const QString& label, const Config::Info<bool>& setting, bool reverse)
: QCheckBox(label), m_setting(setting), m_reverse(reverse)
{
connect(this, &QCheckBox::toggled, this, &GraphicsBool::Update);
@@ -34,7 +33,7 @@ void GraphicsBool::Update()
Config::SetBaseOrCurrent(m_setting, static_cast<bool>(isChecked() ^ m_reverse));
}

GraphicsBoolEx::GraphicsBoolEx(const QString& label, const Config::ConfigInfo<bool>& setting,
GraphicsBoolEx::GraphicsBoolEx(const QString& label, const Config::Info<bool>& setting,
bool reverse)
: QRadioButton(label), m_setting(setting), m_reverse(reverse)
{
@@ -10,32 +10,31 @@
namespace Config
{
template <typename T>
struct ConfigInfo;
struct Info;
}

class GraphicsBool : public QCheckBox
{
Q_OBJECT
public:
GraphicsBool(const QString& label, const Config::ConfigInfo<bool>& setting, bool reverse = false);
GraphicsBool(const QString& label, const Config::Info<bool>& setting, bool reverse = false);

private:
void Update();

const Config::ConfigInfo<bool>& m_setting;
const Config::Info<bool>& m_setting;
bool m_reverse;
};

class GraphicsBoolEx : public QRadioButton
{
Q_OBJECT
public:
GraphicsBoolEx(const QString& label, const Config::ConfigInfo<bool>& setting,
bool reverse = false);
GraphicsBoolEx(const QString& label, const Config::Info<bool>& setting, bool reverse = false);

private:
void Update();

const Config::ConfigInfo<bool>& m_setting;
const Config::Info<bool>& m_setting;
bool m_reverse;
};
@@ -10,7 +10,7 @@

#include "DolphinQt/Settings.h"

GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::ConfigInfo<int>& setting)
GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::Info<int>& setting)
: m_setting(setting)
{
addItems(options);
@@ -12,10 +12,10 @@ class GraphicsChoice : public QComboBox
{
Q_OBJECT
public:
GraphicsChoice(const QStringList& options, const Config::ConfigInfo<int>& setting);
GraphicsChoice(const QStringList& options, const Config::Info<int>& setting);

private:
void Update(int choice);

Config::ConfigInfo<int> m_setting;
Config::Info<int> m_setting;
};
@@ -10,7 +10,7 @@

#include "DolphinQt/Settings.h"

GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::ConfigInfo<int>& setting,
GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::Info<int>& setting,
int step)
: QSpinBox(), m_setting(setting)
{
@@ -9,16 +9,16 @@
namespace Config
{
template <typename T>
struct ConfigInfo;
struct Info;
}

class GraphicsInteger : public QSpinBox
{
Q_OBJECT
public:
GraphicsInteger(int minimum, int maximum, const Config::ConfigInfo<int>& setting, int step = 1);
GraphicsInteger(int minimum, int maximum, const Config::Info<int>& setting, int step = 1);
void Update(int value);

private:
const Config::ConfigInfo<int>& m_setting;
const Config::Info<int>& m_setting;
};
@@ -10,7 +10,7 @@

#include "DolphinQt/Settings.h"

GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::ConfigInfo<int>& setting,
GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::Info<int>& setting,
int value)
: QRadioButton(label), m_setting(setting), m_value(value)
{
@@ -12,11 +12,11 @@ class GraphicsRadioInt : public QRadioButton
{
Q_OBJECT
public:
GraphicsRadioInt(const QString& label, const Config::ConfigInfo<int>& setting, int value);
GraphicsRadioInt(const QString& label, const Config::Info<int>& setting, int value);

private:
void Update();

Config::ConfigInfo<int> m_setting;
Config::Info<int> m_setting;
int m_value;
};
@@ -10,8 +10,7 @@

#include "DolphinQt/Settings.h"

GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::ConfigInfo<int>& setting,
int tick)
GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick)
: QSlider(Qt::Horizontal), m_setting(setting)
{
setMinimum(minimum);
@@ -9,16 +9,16 @@
namespace Config
{
template <typename T>
struct ConfigInfo;
struct Info;
}

class GraphicsSlider : public QSlider
{
Q_OBJECT
public:
GraphicsSlider(int minimum, int maximum, const Config::ConfigInfo<int>& setting, int tick = 0);
GraphicsSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick = 0);
void Update(int value);

private:
const Config::ConfigInfo<int>& m_setting;
const Config::Info<int>& m_setting;
};
@@ -31,12 +31,12 @@ namespace Settings
constexpr char DEFAULT_SERVER_ADDRESS[] = "127.0.0.1";
constexpr u16 DEFAULT_SERVER_PORT = 26760;

const Config::ConfigInfo<bool> SERVER_ENABLED{
{Config::System::DualShockUDPClient, "Server", "Enabled"}, false};
const Config::ConfigInfo<std::string> SERVER_ADDRESS{
const Config::Info<bool> SERVER_ENABLED{{Config::System::DualShockUDPClient, "Server", "Enabled"},
false};
const Config::Info<std::string> SERVER_ADDRESS{
{Config::System::DualShockUDPClient, "Server", "IPAddress"}, DEFAULT_SERVER_ADDRESS};
const Config::ConfigInfo<int> SERVER_PORT{{Config::System::DualShockUDPClient, "Server", "Port"},
DEFAULT_SERVER_PORT};
const Config::Info<int> SERVER_PORT{{Config::System::DualShockUDPClient, "Server", "Port"},
DEFAULT_SERVER_PORT};
} // namespace Settings

// Clock type used for querying timeframes
@@ -10,9 +10,9 @@ namespace ciface::DualShockUDPClient
{
namespace Settings
{
extern const Config::ConfigInfo<bool> SERVER_ENABLED;
extern const Config::ConfigInfo<std::string> SERVER_ADDRESS;
extern const Config::ConfigInfo<int> SERVER_PORT;
extern const Config::Info<bool> SERVER_ENABLED;
extern const Config::Info<std::string> SERVER_ADDRESS;
extern const Config::Info<int> SERVER_PORT;
} // namespace Settings

void Init();
@@ -49,7 +49,7 @@ class CommandLineConfigLayerLoader final : public Config::ConfigLayerLoader
if (system)
{
m_values.emplace_back(
Config::ConfigLocation{std::move(*system), std::move(section), std::move(key)},
Config::Location{std::move(*system), std::move(section), std::move(key)},
std::move(value));
}
}
@@ -69,7 +69,7 @@ class CommandLineConfigLayerLoader final : public Config::ConfigLayerLoader
}

private:
std::list<std::tuple<Config::ConfigLocation, std::string>> m_values;
std::list<std::tuple<Config::Location, std::string>> m_values;
};

std::unique_ptr<optparse::OptionParser> CreateParser(ParserOptions options)