diff --git a/Source/Core/Common/IniFile.h b/Source/Core/Common/IniFile.h index a4f35fe23b..6f16d74306 100644 --- a/Source/Core/Common/IniFile.h +++ b/Source/Core/Common/IniFile.h @@ -111,7 +111,7 @@ public: // Returns true if key exists in section bool Exists(const std::string& sectionName, const std::string& key) const; - template bool GetIfExists(const std::string& sectionName, const std::string& key, T value) + template bool GetIfExists(const std::string& sectionName, const std::string& key, T* value) { if (Exists(sectionName, key)) return GetOrCreateSection(sectionName)->Get(key, value); @@ -119,6 +119,14 @@ public: return false; } + template bool GetIfExists(const std::string& sectionName, const std::string& key, T* value, T defaultValue) + { + if (Exists(sectionName, key)) + return GetOrCreateSection(sectionName)->Get(key, value, defaultValue); + + return false; + } + bool GetKeys(const std::string& sectionName, std::vector* keys) const; void SetLines(const std::string& sectionName, const std::vector& lines); diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 50486d716a..257cc61fc6 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -41,11 +41,6 @@ VideoConfig::VideoConfig() // disable all features by default backend_info.APIType = API_NONE; backend_info.bSupportsExclusiveFullscreen = false; - - // Game-specific stereoscopy settings - bStereoEFBMonoDepth = false; - iStereoDepthPercentage = 100; - iStereoConvergence = 20; } void VideoConfig::Load(const std::string& ini_file) @@ -207,12 +202,14 @@ void VideoConfig::GameIniLoad() CHECK_SETTING("Video_Enhancements", "MaxAnisotropy", iMaxAnisotropy); // NOTE - this is x in (1 << x) CHECK_SETTING("Video_Enhancements", "PostProcessingShader", sPostProcessingShader); + // These are not overrides, they are per-game stereoscopy parameters, hence no warning + iniFile.GetIfExists("Video_Stereoscopy", "StereoConvergence", &iStereoConvergence, 20); + iniFile.GetIfExists("Video_Stereoscopy", "StereoEFBMonoDepth", &bStereoEFBMonoDepth, false); + iniFile.GetIfExists("Video_Stereoscopy", "StereoDepthPercentage", &iStereoDepthPercentage, 100); + CHECK_SETTING("Video_Stereoscopy", "StereoMode", iStereoMode); CHECK_SETTING("Video_Stereoscopy", "StereoDepth", iStereoDepth); - CHECK_SETTING("Video_Stereoscopy", "StereoConvergence", iStereoConvergence); CHECK_SETTING("Video_Stereoscopy", "StereoSwapEyes", bStereoSwapEyes); - CHECK_SETTING("Video_Stereoscopy", "StereoEFBMonoDepth", bStereoEFBMonoDepth); - CHECK_SETTING("Video_Stereoscopy", "StereoDepthPercentage", iStereoDepthPercentage); CHECK_SETTING("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable); CHECK_SETTING("Video_Hacks", "BBoxEnable", bBBoxEnable);