2015-05-24 06:55:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								// Copyright 2008 Dolphin Emulator Project
							 | 
						
					
						
							
								
									
										
										
										
											2015-05-18 01:08:10 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								// Licensed under GPLv2+
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-17 23:09:55 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								// Refer to the license.txt file included.
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-08 05:25:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-09-13 08:21:35 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include <cmath>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-07 20:06:58 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "Common/CommonTypes.h"
							 | 
						
					
						
							
								
									
										
										
										
											2014-02-17 05:18:15 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "Common/FileUtil.h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "Common/IniFile.h"
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-06 15:33:08 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "Common/StringUtil.h"
							 | 
						
					
						
							
								
									
										
										
										
											2014-02-17 05:18:15 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "Core/ConfigManager.h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "Core/Core.h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "Core/Movie.h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "VideoCommon/OnScreenDisplay.h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "VideoCommon/VideoCommon.h"
							 | 
						
					
						
							
								
									
										
										
										
											2014-02-19 02:27:20 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "VideoCommon/VideoConfig.h"
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-08 05:25:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-09-13 10:18:01 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								VideoConfig g_Config;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								VideoConfig g_ActiveConfig;
							 | 
						
					
						
							
								
									
										
										
										
											2009-09-13 08:21:35 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2010-06-05 01:38:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void UpdateActiveConfig()
							 | 
						
					
						
							
								
									
										
										
										
											2009-09-13 08:21:35 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{
							 | 
						
					
						
							
								
									
										
										
										
											2013-05-21 19:20:22 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									if (Movie::IsPlayingInput() && Movie::IsConfigSaved())
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										Movie::SetGraphicsConfig();
							 | 
						
					
						
							
								
									
										
										
										
											2009-09-13 08:21:35 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									g_ActiveConfig = g_Config;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-08 05:25:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-09-13 10:18:01 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								VideoConfig::VideoConfig()
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-08 05:25:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{
							 | 
						
					
						
							
								
									
										
										
										
											2009-09-06 15:11:21 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									bRunning = false;
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-18 04:35:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// Exclusive fullscreen flags
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-18 15:04:23 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									bFullscreen = false;
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-18 04:35:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									bExclusiveMode = false;
							 | 
						
					
						
							
								
									
										
										
										
											2010-11-21 14:47:28 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2010-04-04 22:52:27 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									// Needed for the first frame, I think
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									fAspectRatioHackW = 1;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									fAspectRatioHackH = 1;
							 | 
						
					
						
							
								
									
										
										
										
											2010-11-21 14:47:28 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// disable all features by default
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									backend_info.APIType = API_NONE;
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-19 20:18:03 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									backend_info.bSupportsExclusiveFullscreen = false;
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-24 12:01:21 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// Game-specific stereoscopy settings
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-24 23:06:44 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									bStereoEFBMonoDepth = false;
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-21 14:06:16 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									iStereoDepthPercentage = 100;
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-02 15:27:37 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									iStereoConvergenceMinimum = 0;
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-08 05:25:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-03-12 15:33:41 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void VideoConfig::Load(const std::string& ini_file)
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-08 05:25:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{
							 | 
						
					
						
							
								
									
										
										
										
											2010-06-05 01:38:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									IniFile iniFile;
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-25 20:06:45 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									iniFile.Load(ini_file);
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-19 21:51:12 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									IniFile::Section* hardware = iniFile.GetOrCreateSection("Hardware");
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hardware->Get("VSync", &bVSync, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hardware->Get("Adapter", &iAdapter, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									IniFile::Section* settings = iniFile.GetOrCreateSection("Settings");
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("wideScreenHack", &bWidescreenHack, false);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("AspectRatio", &iAspectRatio, (int)ASPECT_AUTO);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("Crop", &bCrop, false);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("UseXFB", &bUseXFB, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("UseRealXFB", &bUseRealXFB, 0);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-15 14:43:31 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("SafeTextureCacheColorSamples", &iSafeTextureCache_ColorSamples, 128);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("ShowFPS", &bShowFPS, false);
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-09 17:03:17 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("LogRenderTimeToFile", &bLogRenderTimeToFile, false);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("OverlayStats", &bOverlayStats, false);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("OverlayProjStats", &bOverlayProjStats, false);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("ShowEFBCopyRegions", &bShowEFBCopyRegions, false);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("DumpTextures", &bDumpTextures, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("HiresTextures", &bHiresTextures, 0);
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-14 23:19:10 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("ConvertHiresTextures", &bConvertHiresTextures, 0);
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-01 23:53:15 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("CacheHiresTextures", &bCacheHiresTextures, 0);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("DumpEFBTarget", &bDumpEFBTarget, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("FreeLook", &bFreeLook, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("UseFFV1", &bUseFFV1, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("EnablePixelLighting", &bEnablePixelLighting, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("FastDepthCalc", &bFastDepthCalc, true);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("MSAA", &iMultisampleMode, 0);
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-01 00:17:24 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("SSAA", &bSSAA, false);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-15 14:43:31 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("EFBScale", &iEFBScale, (int)SCALE_1X); // native
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("TexFmtOverlayEnable", &bTexFmtOverlayEnable, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("WireFrame", &bWireFrame, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("DisableFog", &bDisableFog, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Get("EnableShaderDebugging", &bEnableShaderDebugging, false);
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-26 12:43:49 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Get("BorderlessFullscreen", &bBorderlessFullscreen, false);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enhancements->Get("ForceFiltering", &bForceFiltering, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enhancements->Get("MaxAnisotropy", &iMaxAnisotropy, 0);  // NOTE - this is x in (1 << x)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enhancements->Get("PostProcessingShader", &sPostProcessingShader, "");
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-11 00:53:03 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									enhancements->Get("StereoMode", &iStereoMode, 0);
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-21 14:06:16 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									enhancements->Get("StereoDepth", &iStereoDepth, 20);
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-27 15:28:00 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									enhancements->Get("StereoConvergence", &iStereoConvergence, 20);
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-11 00:53:03 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									enhancements->Get("StereoSwapEyes", &bStereoSwapEyes, false);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-22 05:28:26 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									//currently these settings are not saved in global config, so we could've initialized them directly
							 | 
						
					
						
							
								
									
										
										
										
											2015-10-03 20:31:48 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									for (size_t i = 0; i < oStereoPresets.size(); ++i)
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-22 05:28:26 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									{
							 | 
						
					
						
							
								
									
										
										
										
											2015-10-03 20:31:48 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										enhancements->Get(StringFromFormat("StereoConvergence_%zu", i), &oStereoPresets[i].depth, iStereoConvergence);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										enhancements->Get(StringFromFormat("StereoDepth_%zu", i), &oStereoPresets[i].convergence, iStereoDepth);
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-22 05:28:26 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enhancements->Get("StereoActivePreset", &iStereoActivePreset, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									iStereoConvergence = oStereoPresets[iStereoActivePreset].convergence;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									iStereoDepth = oStereoPresets[iStereoActivePreset].depth;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks");
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hacks->Get("EFBAccessEnable", &bEFBAccessEnable, true);
							 | 
						
					
						
							
								
									
										
										
										
											2015-04-06 02:17:57 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									hacks->Get("BBoxEnable", &bBBoxEnable, false);
							 | 
						
					
						
							
								
									
										
										
										
											2015-07-27 20:04:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									hacks->Get("ForceProgressive", &bForceProgressive, true);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-21 12:08:47 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									hacks->Get("EFBToTextureEnable", &bSkipEFBCopyToRam, true);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									hacks->Get("EFBScaledCopy", &bCopyEFBScaled, true);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hacks->Get("EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false);
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-25 20:06:45 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-07 16:31:03 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									// hacks which are disabled by default
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									iPhackvalue[0] = 0;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									bPerfQueriesEnable = false;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2009-06-04 21:21:07 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									// Load common settings
							 | 
						
					
						
							
								
									
										
										
										
											2010-02-02 21:56:29 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									iniFile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									IniFile::Section* interface = iniFile.GetOrCreateSection("Interface");
							 | 
						
					
						
							
								
									
										
										
										
											2009-06-04 21:21:07 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									bool bTmp;
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									interface->Get("UsePanicHandlers", &bTmp, true);
							 | 
						
					
						
							
								
									
										
										
										
											2009-06-04 21:21:07 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									SetEnableAlert(bTmp);
							 | 
						
					
						
							
								
									
										
										
										
											2013-08-17 23:48:06 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// Shader Debugging causes a huge slowdown and it's easy to forget about it
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// since it's not exposed in the settings dialog. It's only used by
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// developers, so displaying an obnoxious message avoids some confusion and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// is not too annoying/confusing for users.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									//
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// XXX(delroth): This is kind of a bad place to put this, but the current
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// VideoCommon is a mess and we don't have a central initialization
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// function to do these kind of checks. Instead, the init code is
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// triplicated for each video backend.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if (bEnableShaderDebugging)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										OSD::AddMessage("Warning: Shader Debugging is enabled, performance will suffer heavily", 15000);
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-20 19:13:34 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									VerifyValidity();
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-08 05:25:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-23 02:39:14 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void VideoConfig::GameIniLoad()
							 | 
						
					
						
							
								
									
										
										
										
											2009-06-28 16:47:14 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									bool gfx_override_exists = false;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// XXX: Again, bad place to put OSD messages at (see delroth's comment above)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// XXX: This will add an OSD message for each projection hack value... meh
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-07 23:02:49 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#define CHECK_SETTING(section, key, var) do { \
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										decltype(var) temp = var; \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										if (iniFile.GetIfExists(section, key, &var) && var != temp) { \
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-06 15:33:08 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											std::string msg = StringFromFormat("Note: Option \"%s\" is overridden by game ini.", key); \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											OSD::AddMessage(msg, 7500); \
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											gfx_override_exists = true; \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										} \
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-07 23:02:49 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									} while (0)
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-12 13:56:53 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									IniFile iniFile = SConfig::GetInstance().LoadGameIni();
							 | 
						
					
						
							
								
									
										
										
										
											2011-02-13 22:36:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Hardware", "VSync", bVSync);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "wideScreenHack", bWidescreenHack);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "AspectRatio", iAspectRatio);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "Crop", bCrop);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "UseXFB", bUseXFB);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "UseRealXFB", bUseRealXFB);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "HiresTextures", bHiresTextures);
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-14 23:19:10 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "ConvertHiresTextures", bConvertHiresTextures);
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-01 23:53:15 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "CacheHiresTextures", bCacheHiresTextures);
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "EnablePixelLighting", bEnablePixelLighting);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "FastDepthCalc", bFastDepthCalc);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "MSAA", iMultisampleMode);
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-01 00:17:24 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "SSAA", bSSAA);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-08 03:05:12 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									int tmp = -9000;
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "EFBScale", tmp); // integral
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-08 03:11:45 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									if (tmp != -9000)
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-05 17:13:48 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									{
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-08 03:11:45 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if (tmp != SCALE_FORCE_INTEGRAL)
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-24 09:21:54 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-08 03:11:45 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											iEFBScale = tmp;
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-24 09:21:54 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										else // Round down to multiple of native IR
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-05 17:13:48 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-08 03:11:45 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
											switch (iEFBScale)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											case SCALE_AUTO:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												iEFBScale = SCALE_AUTO_INTEGRAL;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												break;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											case SCALE_1_5X:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												iEFBScale = SCALE_1X;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												break;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											case SCALE_2_5X:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												iEFBScale = SCALE_2X;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												break;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											default:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
												break;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											}
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-05 17:13:48 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Settings", "DisableFog", bDisableFog);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Enhancements", "ForceFiltering", bForceFiltering);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Enhancements", "MaxAnisotropy", iMaxAnisotropy);  // NOTE - this is x in (1 << x)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Enhancements", "PostProcessingShader", sPostProcessingShader);
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-11 00:53:03 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Enhancements", "StereoMode", iStereoMode);
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-21 14:06:16 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Enhancements", "StereoDepth", iStereoDepth);
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-24 11:50:35 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Enhancements", "StereoConvergence", iStereoConvergence);
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-11 00:53:03 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Enhancements", "StereoSwapEyes", bStereoSwapEyes);
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-24 12:01:21 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-22 05:28:26 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									//these are not overrides, they are per-game settings, hence no warning
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
							 | 
						
					
						
							
								
									
										
										
										
											2015-10-03 20:31:48 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									for (size_t i = 0; i < oStereoPresets.size(); ++i)
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-22 05:28:26 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									{
							 | 
						
					
						
							
								
									
										
										
										
											2015-10-03 20:31:48 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										enhancements->Get(StringFromFormat("StereoConvergence_%zu", i), &oStereoPresets[i].depth, iStereoConvergence);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										enhancements->Get(StringFromFormat("StereoDepth_%zu", i), &oStereoPresets[i].convergence, iStereoDepth);
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-22 05:28:26 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enhancements->Get("StereoActivePreset", &iStereoActivePreset, 0);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									iStereoConvergence = oStereoPresets[iStereoActivePreset].convergence;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									iStereoDepth = oStereoPresets[iStereoActivePreset].depth;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-24 23:06:44 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Stereoscopy", "StereoEFBMonoDepth", bStereoEFBMonoDepth);
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-21 14:06:16 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Stereoscopy", "StereoDepthPercentage", iStereoDepthPercentage);
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-02 15:27:37 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Stereoscopy", "StereoConvergenceMinimum", iStereoConvergenceMinimum);
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable);
							 | 
						
					
						
							
								
									
										
										
										
											2015-04-06 02:17:57 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Hacks", "BBoxEnable", bBBoxEnable);
							 | 
						
					
						
							
								
									
										
										
										
											2015-07-27 20:04:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Hacks", "ForceProgressive", bForceProgressive);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-21 12:08:47 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Hacks", "EFBToTextureEnable", bSkipEFBCopyToRam);
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-18 12:27:50 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video", "ProjectionHack", iPhackvalue[0]);
							 | 
						
					
						
							
								
									
										
										
										
											2013-09-04 23:21:45 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video", "PH_SZNear", iPhackvalue[1]);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video", "PH_SZFar", iPhackvalue[2]);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video", "PH_ZNear", sPhackvalue[0]);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video", "PH_ZFar", sPhackvalue[1]);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									CHECK_SETTING("Video", "PerfQueriesEnable", bPerfQueriesEnable);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									if (gfx_override_exists)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										OSD::AddMessage("Warning: Opening the graphics configuration will reset settings and might cause issues!", 10000);
							 | 
						
					
						
							
								
									
										
										
										
											2011-02-13 13:42:59 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void VideoConfig::VerifyValidity()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									// TODO: Check iMaxAnisotropy value
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-25 20:06:45 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									if (iAdapter < 0 || iAdapter > ((int)backend_info.Adapters.size() - 1)) iAdapter = 0;
							 | 
						
					
						
							
								
									
										
										
										
											2011-02-13 22:36:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									if (iMultisampleMode < 0 || iMultisampleMode >= (int)backend_info.AAModes.size()) iMultisampleMode = 0;
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-20 19:54:00 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-20 22:14:45 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									if (iStereoMode > 0)
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-20 19:54:00 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									{
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-20 22:14:45 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if (!backend_info.bSupportsGeometryShaders)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											OSD::AddMessage("Stereoscopic 3D isn't supported by your GPU, support for OpenGL 3.2 is required.", 10000);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											iStereoMode = 0;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-29 19:15:31 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										if (bUseXFB && bUseRealXFB)
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-20 22:14:45 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
										{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											OSD::AddMessage("Stereoscopic 3D isn't supported with Real XFB, turning off stereoscopy.", 10000);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
											iStereoMode = 0;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
										}
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-20 19:54:00 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									}
							 | 
						
					
						
							
								
									
										
										
										
											2009-03-20 11:51:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-03-12 15:33:41 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void VideoConfig::Save(const std::string& ini_file)
							 | 
						
					
						
							
								
									
										
										
										
											2008-12-08 05:25:12 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								{
							 | 
						
					
						
							
								
									
										
										
										
											2010-06-05 01:38:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									IniFile iniFile;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									iniFile.Load(ini_file);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									IniFile::Section* hardware = iniFile.GetOrCreateSection("Hardware");
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hardware->Set("VSync", bVSync);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hardware->Set("Adapter", iAdapter);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									IniFile::Section* settings = iniFile.GetOrCreateSection("Settings");
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("AspectRatio", iAspectRatio);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("Crop", bCrop);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("wideScreenHack", bWidescreenHack);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("UseXFB", bUseXFB);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("UseRealXFB", bUseRealXFB);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("SafeTextureCacheColorSamples", iSafeTextureCache_ColorSamples);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("ShowFPS", bShowFPS);
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-09 17:03:17 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Set("LogRenderTimeToFile", bLogRenderTimeToFile);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Set("OverlayStats", bOverlayStats);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("OverlayProjStats", bOverlayProjStats);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("DumpTextures", bDumpTextures);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("HiresTextures", bHiresTextures);
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-14 23:19:10 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Set("ConvertHiresTextures", bConvertHiresTextures);
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-01 23:53:15 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Set("CacheHiresTextures", bCacheHiresTextures);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Set("DumpEFBTarget", bDumpEFBTarget);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("FreeLook", bFreeLook);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("UseFFV1", bUseFFV1);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("EnablePixelLighting", bEnablePixelLighting);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("FastDepthCalc", bFastDepthCalc);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("ShowEFBCopyRegions", bShowEFBCopyRegions);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("MSAA", iMultisampleMode);
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-01 00:17:24 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Set("SSAA", bSSAA);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Set("EFBScale", iEFBScale);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("TexFmtOverlayEnable", bTexFmtOverlayEnable);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("TexFmtOverlayCenter", bTexFmtOverlayCenter);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("Wireframe", bWireFrame);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("DisableFog", bDisableFog);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									settings->Set("EnableShaderDebugging", bEnableShaderDebugging);
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-26 12:43:49 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									settings->Set("BorderlessFullscreen", bBorderlessFullscreen);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enhancements->Set("ForceFiltering", bForceFiltering);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enhancements->Set("MaxAnisotropy", iMaxAnisotropy);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									enhancements->Set("PostProcessingShader", sPostProcessingShader);
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-11 00:53:03 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									enhancements->Set("StereoMode", iStereoMode);
							 | 
						
					
						
							
								
									
										
										
										
											2014-12-21 14:06:16 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									enhancements->Set("StereoDepth", iStereoDepth);
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-24 11:50:35 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									enhancements->Set("StereoConvergence", iStereoConvergence);
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-11 00:53:03 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									enhancements->Set("StereoSwapEyes", bStereoSwapEyes);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks");
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hacks->Set("EFBAccessEnable", bEFBAccessEnable);
							 | 
						
					
						
							
								
									
										
										
										
											2015-04-06 02:17:57 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									hacks->Set("BBoxEnable", bBBoxEnable);
							 | 
						
					
						
							
								
									
										
										
										
											2015-07-27 20:04:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									hacks->Set("ForceProgressive", bForceProgressive);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-21 12:08:47 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									hacks->Set("EFBToTextureEnable", bSkipEFBCopyToRam);
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-16 01:12:43 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									hacks->Set("EFBScaledCopy", bCopyEFBScaled);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hacks->Set("EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-19 21:51:12 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2010-06-05 01:38:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									iniFile.Save(ini_file);
							 | 
						
					
						
							
								
									
										
										
										
											2009-09-13 08:21:35 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-18 20:41:45 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								bool VideoConfig::IsVSync()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{
							 | 
						
					
						
							
								
									
										
										
										
											2014-04-30 12:50:29 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									return bVSync && !Core::GetIsFramelimiterTempDisabled();
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-18 20:41:45 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}
							 |