From e58ba76f07d47aa09e01acf7ead37f7420bb241c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 2 Aug 2017 16:30:34 +0800 Subject: Don't force the aspect ratio in GameINIs Instead, add a SuggestedAspectRatio option which tells Dolphin which aspect ratio to use when the aspect ratio option is set to Auto. --- Source/Core/Core/Config/GraphicsSettings.cpp | 2 ++ Source/Core/Core/Config/GraphicsSettings.h | 1 + Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp | 1 + Source/Core/VideoCommon/VideoConfig.cpp | 6 +++++- 4 files changed, 9 insertions(+), 1 deletion(-) (limited to 'Source/Core') diff --git a/Source/Core/Core/Config/GraphicsSettings.cpp b/Source/Core/Core/Config/GraphicsSettings.cpp index 205fdff401..3f9347c921 100644 --- a/Source/Core/Core/Config/GraphicsSettings.cpp +++ b/Source/Core/Core/Config/GraphicsSettings.cpp @@ -23,6 +23,8 @@ const ConfigInfo GFX_ADAPTER{{System::GFX, "Hardware", "Adapter"}, 0}; const ConfigInfo GFX_WIDESCREEN_HACK{{System::GFX, "Settings", "wideScreenHack"}, false}; const ConfigInfo GFX_ASPECT_RATIO{{System::GFX, "Settings", "AspectRatio"}, static_cast(ASPECT_AUTO)}; +const ConfigInfo GFX_SUGGESTED_ASPECT_RATIO{{System::GFX, "Settings", "SuggestedAspectRatio"}, + static_cast(ASPECT_AUTO)}; const ConfigInfo GFX_CROP{{System::GFX, "Settings", "Crop"}, false}; const ConfigInfo GFX_USE_XFB{{System::GFX, "Settings", "UseXFB"}, false}; const ConfigInfo GFX_USE_REAL_XFB{{System::GFX, "Settings", "UseRealXFB"}, false}; diff --git a/Source/Core/Core/Config/GraphicsSettings.h b/Source/Core/Core/Config/GraphicsSettings.h index 046675d058..a50ee253c0 100644 --- a/Source/Core/Core/Config/GraphicsSettings.h +++ b/Source/Core/Core/Config/GraphicsSettings.h @@ -21,6 +21,7 @@ extern const ConfigInfo GFX_ADAPTER; extern const ConfigInfo GFX_WIDESCREEN_HACK; extern const ConfigInfo GFX_ASPECT_RATIO; +extern const ConfigInfo GFX_SUGGESTED_ASPECT_RATIO; extern const ConfigInfo GFX_CROP; extern const ConfigInfo GFX_USE_XFB; extern const ConfigInfo GFX_USE_REAL_XFB; diff --git a/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp b/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp index 84b6f41267..8613595539 100644 --- a/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp +++ b/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp @@ -71,6 +71,7 @@ static const INIToLocationMap& GetINIToLocationMap() {{"Video_Settings", "wideScreenHack"}, {Config::GFX_WIDESCREEN_HACK.location}}, {{"Video_Settings", "AspectRatio"}, {Config::GFX_ASPECT_RATIO.location}}, + {{"Video_Settings", "SuggestedAspectRatio"}, {Config::GFX_SUGGESTED_ASPECT_RATIO.location}}, {{"Video_Settings", "Crop"}, {Config::GFX_CROP.location}}, {{"Video_Settings", "UseXFB"}, {Config::GFX_USE_XFB.location}}, {{"Video_Settings", "UseRealXFB"}, {Config::GFX_USE_REAL_XFB.location}}, diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 9caab54603..fa6f4dc941 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -56,7 +56,11 @@ void VideoConfig::Refresh() iAdapter = Config::Get(Config::GFX_ADAPTER); bWidescreenHack = Config::Get(Config::GFX_WIDESCREEN_HACK); - iAspectRatio = Config::Get(Config::GFX_ASPECT_RATIO); + const int aspect_ratio = Config::Get(Config::GFX_ASPECT_RATIO); + if (aspect_ratio == ASPECT_AUTO) + iAspectRatio = Config::Get(Config::GFX_SUGGESTED_ASPECT_RATIO); + else + iAspectRatio = aspect_ratio; bCrop = Config::Get(Config::GFX_CROP); bUseXFB = Config::Get(Config::GFX_USE_XFB); bUseRealXFB = Config::Get(Config::GFX_USE_REAL_XFB); -- cgit v1.2.3