diff options
| author | hrydgard <hrydgard@gmail.com> | 2010-01-13 21:11:02 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2010-01-13 21:11:02 +0000 |
| commit | 2db709aeb683a65744284b7570826e50dcc4adf6 (patch) | |
| tree | b0980b61622e7e9ccd1bdaaa587ad43a10d92089 /Source/Core | |
| parent | dd01e0d41766965f0663fbbf4ae51f4473f7cfa6 (diff) | |
Add "Auto Aspect Ratio" to both graphics plugins. It's the new default, so you can forget about switching aspect manually from now on. In the Auto mode, aspect ratio is automatically set depending on whether it's a Wii or GC game, and whether the global Wii Widescreen setting has been set. There is still the possibility to override, which can be useful for the very few GC games that do support widescreen.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4828 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Src/Core.cpp | 1 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VideoConfig.cpp | 23 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VideoConfig.h | 10 |
3 files changed, 25 insertions, 9 deletions
diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 67260df724..17c8ba38c9 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -324,6 +324,7 @@ THREAD_RETURN EmuThread(void *pArg) VideoInitialize.Fifo_CPUBase = &ProcessorInterface::Fifo_CPUBase; VideoInitialize.Fifo_CPUEnd = &ProcessorInterface::Fifo_CPUEnd; VideoInitialize.Fifo_CPUWritePointer = &ProcessorInterface::Fifo_CPUWritePointer; + VideoInitialize.bAutoAspectIs16_9 = _CoreParameter.bWii ? SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.AR") : false; Plugins.GetVideo()->Initialize(&VideoInitialize); // Call the dll diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp index 100176863f..614811c813 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.cpp +++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp @@ -54,8 +54,7 @@ void VideoConfig::Load(const char *ini_file) iniFile.Get("Settings", "StretchToFit", &bNativeResolution, true); iniFile.Get("Settings", "2xResolution", &b2xResolution, false); iniFile.Get("Settings", "wideScreenHack", &bWidescreenHack, false); - iniFile.Get("Settings", "KeepAR_4_3", &bKeepAR43, true); - iniFile.Get("Settings", "KeepAR_16_9", &bKeepAR169, false); + iniFile.Get("Settings", "AspectRatio", &iAspectRatio, (int)ASPECT_AUTO); iniFile.Get("Settings", "Crop", &bCrop, false); iniFile.Get("Settings", "HideCursor", &bHideCursor, false); iniFile.Get("Settings", "UseXFB", &bUseXFB, 0); @@ -149,8 +148,7 @@ void VideoConfig::Save(const char *ini_file) iniFile.Set("Hardware", "RenderToMainframe", RenderToMainframe); iniFile.Set("Settings", "StretchToFit", bNativeResolution); iniFile.Set("Settings", "2xResolution", b2xResolution); - iniFile.Set("Settings", "KeepAR_4_3", bKeepAR43); - iniFile.Set("Settings", "KeepAR_16_9", bKeepAR169); + iniFile.Set("Settings", "AspectRatio", iAspectRatio); iniFile.Set("Settings", "Crop", bCrop); iniFile.Set("Settings", "wideScreenHack", bWidescreenHack); iniFile.Set("Settings", "HideCursor", bHideCursor); @@ -210,10 +208,19 @@ void ComputeDrawRectangle(int backbuffer_width, int backbuffer_height, bool flip const float WinHeight = FloatGLHeight; // Handle aspect ratio. - if (g_ActiveConfig.bKeepAR43 || g_ActiveConfig.bKeepAR169) + // Default to auto. + bool use16_9 = g_VideoInitialize.bAutoAspectIs16_9; + + // Check for force-settings and override. + if (g_ActiveConfig.iAspectRatio == ASPECT_FORCE_16_9) + use16_9 = true; + else if (g_ActiveConfig.iAspectRatio == ASPECT_FORCE_4_3) + use16_9 = false; + + if (g_ActiveConfig.iAspectRatio != ASPECT_STRETCH) { // The rendering window aspect ratio as a proportion of the 4:3 or 16:9 ratio - float Ratio = (WinWidth / WinHeight) / (g_Config.bKeepAR43 ? (4.0f / 3.0f) : (16.0f / 9.0f)); + float Ratio = (WinWidth / WinHeight) / (!use16_9 ? (4.0f / 3.0f) : (16.0f / 9.0f)); // Check if height or width is the limiting factor. If ratio > 1 the picture is too wide and have to limit the width. if (Ratio > 1.0f) { @@ -234,9 +241,9 @@ void ComputeDrawRectangle(int backbuffer_width, int backbuffer_height, bool flip // Crop the picture from 4:3 to 5:4 or from 16:9 to 16:10. // Output: FloatGLWidth, FloatGLHeight, FloatXOffset, FloatYOffset // ------------------ - if ((g_ActiveConfig.bKeepAR43 || g_ActiveConfig.bKeepAR169) && g_ActiveConfig.bCrop) + if (g_ActiveConfig.iAspectRatio != ASPECT_STRETCH && g_ActiveConfig.bCrop) { - float Ratio = g_Config.bKeepAR43 ? ((4.0f / 3.0f) / (5.0f / 4.0f)) : (((16.0f / 9.0f) / (16.0f / 10.0f))); + float Ratio = !use16_9 ? ((4.0f / 3.0f) / (5.0f / 4.0f)) : (((16.0f / 9.0f) / (16.0f / 10.0f))); // The width and height we will add (calculate this before FloatGLWidth and FloatGLHeight is adjusted) float IncreasedWidth = (Ratio - 1.0f) * FloatGLWidth; float IncreasedHeight = (Ratio - 1.0f) * FloatGLHeight; diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h index e3dd402c5f..359dc549d3 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.h +++ b/Source/Core/VideoCommon/Src/VideoConfig.h @@ -48,6 +48,13 @@ enum MultisampleMode { MULTISAMPLE_CSAA_16XQ, }; +enum AspectMode { + ASPECT_AUTO = 0, + ASPECT_FORCE_16_9 = 1, + ASPECT_FORCE_4_3 = 2, + ASPECT_STRETCH = 3, +}; + class IniFile; // NEVER inherit from this class. @@ -71,7 +78,8 @@ struct VideoConfig bool bNativeResolution, b2xResolution, bRunning; // Should possibly be augmented with 2x, 4x native. bool bWidescreenHack; - bool bKeepAR43, bKeepAR169, bCrop; // Aspect ratio controls. + int iAspectRatio; + bool bCrop; // Aspect ratio controls. bool bUseXFB; bool bAutoScale; // Removes annoying borders without using XFB. Doesn't always work perfectly. |
