diff options
| author | MerryMage <MerryMage@users.noreply.github.com> | 2017-05-18 13:58:57 +0100 |
|---|---|---|
| committer | MerryMage <MerryMage@users.noreply.github.com> | 2017-06-03 18:11:58 +0100 |
| commit | d75b536fd7809dab10bb2e0194312673e977a3fe (patch) | |
| tree | 01ca8f90aaa2f3f6b405fc7ed5f8e8bce61c03f9 | |
| parent | 332747857e9a542d91ef8d4f4ca3e14d3a8fb368 (diff) | |
Config: Add GFX ConfigInfo
| -rw-r--r-- | Source/Core/Core/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | Source/Core/Core/Config/Config.h | 9 | ||||
| -rw-r--r-- | Source/Core/Core/Config/GraphicsSettings.cpp | 135 | ||||
| -rw-r--r-- | Source/Core/Core/Config/GraphicsSettings.h | 108 | ||||
| -rw-r--r-- | Source/Core/Core/Core.vcxproj | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Core.vcxproj.filters | 2 |
6 files changed, 257 insertions, 0 deletions
diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index e5ba06faac..cdb5f5305c 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -26,6 +26,7 @@ set(SRCS Boot/Boot_WiiWAD.cpp Boot/ElfReader.cpp Config/Config.cpp + Config/GraphicsSettings.cpp ConfigLoaders/BaseConfigLoader.cpp ConfigLoaders/GameConfigLoader.cpp ConfigLoaders/IsSettingSaveable.cpp diff --git a/Source/Core/Core/Config/Config.h b/Source/Core/Core/Config/Config.h index bd31fe22b2..846f016c25 100644 --- a/Source/Core/Core/Config/Config.h +++ b/Source/Core/Core/Config/Config.h @@ -78,4 +78,13 @@ void SetCurrent(const ConfigInfo<T>& info, const T& value) Set<T>(LayerType::CurrentRun, info, value); } +template <typename T> +void SetBaseOrCurrent(const ConfigInfo<T>& info, const T& value) +{ + if (GetActiveLayerForConfig(info) == LayerType::Base) + Set<T>(LayerType::Base, info, value); + else + Set<T>(LayerType::CurrentRun, info, value); +} + } // namespace Config diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp new file mode 100644 index 0000000000..dcde16a17d --- /dev/null +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -0,0 +1,135 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include <string> + +#include "Core/Config/Config.h" +#include "Core/Config/GraphicsSettings.h" +#include "VideoCommon/VideoConfig.h" + +namespace Config +{ +// Configuration Information + +// Graphics.Hardware + +const ConfigInfo<bool> GFX_VSYNC{{System::GFX, "Hardware", "VSync"}, false}; +const ConfigInfo<int> GFX_ADAPTER{{System::GFX, "Hardware", "Adapter"}, 0}; + +// Graphics.Settings + +const ConfigInfo<bool> GFX_WIDESCREEN_HACK{{System::GFX, "Settings", "wideScreenHack"}, false}; +const ConfigInfo<int> GFX_ASPECT_RATIO{{System::GFX, "Settings", "AspectRatio"}, + static_cast<int>(ASPECT_AUTO)}; +const ConfigInfo<bool> GFX_CROP{{System::GFX, "Settings", "Crop"}, false}; +const ConfigInfo<bool> GFX_USE_XFB{{System::GFX, "Settings", "UseXFB"}, false}; +const ConfigInfo<bool> GFX_USE_REAL_XFB{{System::GFX, "Settings", "UseRealXFB"}, false}; +const ConfigInfo<int> GFX_SAFE_TEXTURE_CACHE_COLOR_SAMPLES{ + {System::GFX, "Settings", "SafeTextureCacheColorSamples"}, 128}; +const ConfigInfo<bool> GFX_SHOW_FPS{{System::GFX, "Settings", "ShowFPS"}, false}; +const ConfigInfo<bool> GFX_SHOW_NETPLAY_PING{{System::GFX, "Settings", "ShowNetPlayPing"}, false}; +const ConfigInfo<bool> GFX_SHOW_NETPLAY_MESSAGES{{System::GFX, "Settings", "ShowNetPlayMessages"}, + false}; +const ConfigInfo<bool> GFX_LOG_RENDER_TIME_TO_FILE{{System::GFX, "Settings", "LogRenderTimeToFile"}, + false}; +const ConfigInfo<bool> GFX_OVERLAY_STATS{{System::GFX, "Settings", "OverlayStats"}, false}; +const ConfigInfo<bool> GFX_OVERLAY_PROJ_STATS{{System::GFX, "Settings", "OverlayProjStats"}, false}; +const ConfigInfo<bool> GFX_DUMP_TEXTURES{{System::GFX, "Settings", "DumpTextures"}, false}; +const ConfigInfo<bool> GFX_HIRES_TEXTURES{{System::GFX, "Settings", "HiresTextures"}, false}; +const ConfigInfo<bool> GFX_CONVERT_HIRES_TEXTURES{{System::GFX, "Settings", "ConvertHiresTextures"}, + false}; +const ConfigInfo<bool> GFX_CACHE_HIRES_TEXTURES{{System::GFX, "Settings", "CacheHiresTextures"}, + false}; +const ConfigInfo<bool> GFX_DUMP_EFB_TARGET{{System::GFX, "Settings", "DumpEFBTarget"}, false}; +const ConfigInfo<bool> GFX_DUMP_FRAMES_AS_IMAGES{{System::GFX, "Settings", "DumpFramesAsImages"}, + false}; +const ConfigInfo<bool> GFX_FREE_LOOK{{System::GFX, "Settings", "FreeLook"}, false}; +const ConfigInfo<bool> GFX_USE_FFV1{{System::GFX, "Settings", "UseFFV1"}, false}; +const ConfigInfo<std::string> GFX_DUMP_FORMAT{{System::GFX, "Settings", "DumpFormat"}, "avi"}; +const ConfigInfo<std::string> GFX_DUMP_CODEC{{System::GFX, "Settings", "DumpCodec"}, ""}; +const ConfigInfo<std::string> GFX_DUMP_PATH{{System::GFX, "Settings", "DumpPath"}, ""}; +const ConfigInfo<int> GFX_BITRATE_KBPS{{System::GFX, "Settings", "BitrateKbps"}, 2500}; +const ConfigInfo<bool> GFX_INTERNAL_RESOLUTION_FRAME_DUMPS{ + {System::GFX, "Settings", "InternalResolutionFrameDumps"}, false}; +const ConfigInfo<bool> GFX_ENABLE_GPU_TEXTURE_DECODING{ + {System::GFX, "Settings", "EnableGPUTextureDecoding"}, false}; +const ConfigInfo<bool> GFX_ENABLE_PIXEL_LIGHTING{{System::GFX, "Settings", "EnablePixelLighting"}, + false}; +const ConfigInfo<bool> GFX_FAST_DEPTH_CALC{{System::GFX, "Settings", "FastDepthCalc"}, true}; +const ConfigInfo<int> GFX_MSAA{{System::GFX, "Settings", "MSAA"}, 1}; +const ConfigInfo<bool> GFX_SSAA{{System::GFX, "Settings", "SSAA"}, false}; +const ConfigInfo<int> GFX_EFB_SCALE{{System::GFX, "Settings", "EFBScale"}, + static_cast<int>(SCALE_1X)}; +const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_ENABLE{{System::GFX, "Settings", "TexFmtOverlayEnable"}, + false}; +const ConfigInfo<bool> GFX_TEXFMT_OVERLAY_CENTER{{System::GFX, "Settings", "TexFmtOverlayCenter"}, + false}; +const ConfigInfo<bool> GFX_ENABLE_WIREFRAME{{System::GFX, "Settings", "WireFrame"}, false}; +const ConfigInfo<bool> GFX_DISABLE_FOG{{System::GFX, "Settings", "DisableFog"}, false}; +const ConfigInfo<bool> GFX_BORDERLESS_FULLSCREEN{{System::GFX, "Settings", "BorderlessFullscreen"}, + false}; +const ConfigInfo<bool> GFX_ENABLE_VALIDATION_LAYER{ + {System::GFX, "Settings", "EnableValidationLayer"}, false}; +const ConfigInfo<bool> GFX_BACKEND_MULTITHREADING{ + {System::GFX, "Settings", "BackendMultithreading"}, true}; +const ConfigInfo<int> GFX_COMMAND_BUFFER_EXECUTE_INTERVAL{ + {System::GFX, "Settings", "CommandBufferExecuteInterval"}, 100}; +const ConfigInfo<bool> GFX_SHADER_CACHE{{System::GFX, "Settings", "ShaderCache"}, true}; + +const ConfigInfo<bool> GFX_SW_ZCOMPLOC{{System::GFX, "Settings", "SWZComploc"}, true}; +const ConfigInfo<bool> GFX_SW_ZFREEZE{{System::GFX, "Settings", "SWZFreeze"}, true}; +const ConfigInfo<bool> GFX_SW_DUMP_OBJECTS{{System::GFX, "Settings", "SWDumpObjects"}, false}; +const ConfigInfo<bool> GFX_SW_DUMP_TEV_STAGES{{System::GFX, "Settings", "SWDumpTevStages"}, false}; +const ConfigInfo<bool> GFX_SW_DUMP_TEV_TEX_FETCHES{{System::GFX, "Settings", "SWDumpTevTexFetches"}, + false}; +const ConfigInfo<int> GFX_SW_DRAW_START{{System::GFX, "Settings", "SWDrawStart"}, 0}; +const ConfigInfo<int> GFX_SW_DRAW_END{{System::GFX, "Settings", "SWDrawEnd"}, 100000}; + +// Graphics.Enhancements + +const ConfigInfo<bool> GFX_ENHANCE_FORCE_FILTERING{{System::GFX, "Enhancements", "ForceFiltering"}, + false}; +const ConfigInfo<int> GFX_ENHANCE_MAX_ANISOTROPY{{System::GFX, "Enhancements", "MaxAnisotropy"}, 0}; +const ConfigInfo<std::string> GFX_ENHANCE_POST_SHADER{ + {System::GFX, "Enhancements", "PostProcessingShader"}, ""}; +const ConfigInfo<bool> GFX_ENHANCE_FORCE_TRUE_COLOR{{System::GFX, "Enhancements", "ForceTrueColor"}, + true}; + +// Graphics.Stereoscopy + +const ConfigInfo<int> GFX_STEREO_MODE{{System::GFX, "Stereoscopy", "StereoMode"}, 0}; +const ConfigInfo<int> GFX_STEREO_DEPTH{{System::GFX, "Stereoscopy", "StereoDepth"}, 20}; +const ConfigInfo<int> GFX_STEREO_CONVERGENCE_PERCENTAGE{ + {System::GFX, "Stereoscopy", "StereoConvergencePercentage"}, 100}; +const ConfigInfo<bool> GFX_STEREO_SWAP_EYES{{System::GFX, "Stereoscopy", "StereoSwapEyes"}, false}; +const ConfigInfo<int> GFX_STEREO_CONVERGENCE{{System::GFX, "Stereoscopy", "StereoConvergence"}, 20}; +const ConfigInfo<bool> GFX_STEREO_EFB_MONO_DEPTH{{System::GFX, "Stereoscopy", "StereoEFBMonoDepth"}, + false}; +const ConfigInfo<int> GFX_STEREO_DEPTH_PERCENTAGE{ + {System::GFX, "Stereoscopy", "StereoDepthPercentage"}, 100}; + +// Graphics.Hacks + +const ConfigInfo<bool> GFX_HACK_EFB_ACCESS_ENABLE{{System::GFX, "Hacks", "EFBAccessEnable"}, true}; +const ConfigInfo<bool> GFX_HACK_BBOX_ENABLE{{System::GFX, "Hacks", "BBoxEnable"}, false}; +const ConfigInfo<bool> GFX_HACK_BBOX_PREFER_STENCIL_IMPLEMENTATION{ + {System::GFX, "Hacks", "BBoxPreferStencilImplementation"}, false}; +const ConfigInfo<bool> GFX_HACK_FORCE_PROGRESSIVE{{System::GFX, "Hacks", "ForceProgressive"}, true}; +const ConfigInfo<bool> GFX_HACK_SKIP_EFB_COPY_TO_RAM{{System::GFX, "Hacks", "EFBToTextureEnable"}, + true}; +const ConfigInfo<bool> GFX_HACK_COPY_EFB_ENABLED{{System::GFX, "Hacks", "EFBScaledCopy"}, true}; +const ConfigInfo<bool> GFX_HACK_EFB_EMULATE_FORMAT_CHANGES{ + {System::GFX, "Hacks", "EFBEmulateFormatChanges"}, false}; +const ConfigInfo<bool> GFX_HACK_VERTEX_ROUDING{{System::GFX, "Hacks", "VertexRounding"}, false}; + +// Graphics.GameSpecific + +const ConfigInfo<int> GFX_PROJECTION_HACK{{System::GFX, "GameSpecific", "ProjectionHack"}, 0}; +const ConfigInfo<int> GFX_PROJECTION_HACK_SZNEAR{{System::GFX, "GameSpecific", "PH_SZNear"}, 0}; +const ConfigInfo<int> GFX_PROJECTION_HACK_SZFAR{{System::GFX, "GameSpecific", "PH_SZFar"}, 0}; +const ConfigInfo<int> GFX_PROJECTION_HACK_ZNEAR{{System::GFX, "GameSpecific", "PH_ZNear"}, 0}; +const ConfigInfo<int> GFX_PROJECTION_HACK_ZFAR{{System::GFX, "GameSpecific", "PH_ZFar"}, 0}; +const ConfigInfo<bool> GFX_PERF_QUERIES_ENABLE{{System::GFX, "GameSpecific", "PerfQueriesEnable"}, + false}; +} // namespace Config diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h new file mode 100644 index 0000000000..7ff7b2b667 --- /dev/null +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -0,0 +1,108 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include <string> + +#include "Core/Config/Config.h" + +namespace Config +{ +// Configuration Information + +// Graphics.Hardware + +extern const ConfigInfo<bool> GFX_VSYNC; +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<bool> GFX_CROP; +extern const ConfigInfo<bool> GFX_USE_XFB; +extern const ConfigInfo<bool> GFX_USE_REAL_XFB; +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_CONVERT_HIRES_TEXTURES; +extern const ConfigInfo<bool> GFX_CACHE_HIRES_TEXTURES; +extern const ConfigInfo<bool> GFX_DUMP_EFB_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_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<int> GFX_MSAA; +extern const ConfigInfo<bool> GFX_SSAA; +extern const ConfigInfo<int> GFX_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_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; + +// 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; + +// Graphics.Stereoscopy + +extern const ConfigInfo<int> 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; + +// Graphics.Hacks + +extern const ConfigInfo<bool> GFX_HACK_EFB_ACCESS_ENABLE; +extern const ConfigInfo<bool> GFX_HACK_BBOX_ENABLE; +extern const ConfigInfo<bool> GFX_HACK_BBOX_PREFER_STENCIL_IMPLEMENTATION; +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_COPY_EFB_ENABLED; +extern const ConfigInfo<bool> GFX_HACK_EFB_EMULATE_FORMAT_CHANGES; +extern const ConfigInfo<bool> GFX_HACK_VERTEX_ROUDING; + +// Graphics.GameSpecific + +extern const ConfigInfo<int> GFX_PROJECTION_HACK; +extern const ConfigInfo<int> GFX_PROJECTION_HACK_SZNEAR; +extern const ConfigInfo<int> GFX_PROJECTION_HACK_SZFAR; +extern const ConfigInfo<int> GFX_PROJECTION_HACK_ZNEAR; +extern const ConfigInfo<int> GFX_PROJECTION_HACK_ZFAR; +extern const ConfigInfo<bool> GFX_PERF_QUERIES_ENABLE; + +} // namespace Config diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj index d1c648a78d..5c75dbd778 100644 --- a/Source/Core/Core/Core.vcxproj +++ b/Source/Core/Core/Core.vcxproj @@ -57,6 +57,7 @@ <ClCompile Include="Boot\Boot_WiiWAD.cpp" /> <ClCompile Include="Boot\ElfReader.cpp" /> <ClCompile Include="Config\Config.cpp" /> + <ClCompile Include="Config\GraphicsSettings.cpp" /> <ClCompile Include="ConfigLoaders\BaseConfigLoader.cpp" /> <ClCompile Include="ConfigLoaders\GameConfigLoader.cpp" /> <ClCompile Include="ConfigLoaders\IsSettingSaveable.cpp" /> @@ -310,6 +311,7 @@ <ClInclude Include="Boot\ElfReader.h" /> <ClInclude Include="Boot\ElfTypes.h" /> <ClInclude Include="Config\Config.h" /> + <ClInclude Include="Config\GraphicsSettings.h" /> <ClInclude Include="ConfigLoaders\BaseConfigLoader.h" /> <ClInclude Include="ConfigLoaders\GameConfigLoader.h" /> <ClInclude Include="ConfigLoaders\IsSettingSaveable.h" /> diff --git a/Source/Core/Core/Core.vcxproj.filters b/Source/Core/Core/Core.vcxproj.filters index 8f9a620aa8..ebeb6b2fca 100644 --- a/Source/Core/Core/Core.vcxproj.filters +++ b/Source/Core/Core/Core.vcxproj.filters @@ -857,6 +857,7 @@ <Filter>ConfigLoader</Filter> </ClCompile> <ClCompile Include="Config\Config.cpp" /> + <ClCompile Include="Config\GraphicsSettings.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="BootManager.h" /> @@ -1491,6 +1492,7 @@ <Filter>ConfigLoader</Filter> </ClInclude> <ClInclude Include="Config\Config.h" /> + <ClInclude Include="Config\GraphicsSettings.h" /> <ClInclude Include="ConfigLoaders\IsSettingSaveable.h"> <Filter>ConfigLoader</Filter> </ClInclude> |
