diff options
| author | Scott Mansell <phiren@gmail.com> | 2015-08-01 13:18:47 +1200 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2015-08-01 13:21:53 +1200 |
| commit | 615e5db0cbda4afad3ee940f6c160c1ece963c36 (patch) | |
| tree | 38ea93a0c3c5e3e480257679c6a5352108a95d8c /Source/Core/VideoCommon/VertexShaderManager.cpp | |
| parent | fc4ba3adee4b8480c63b148ed4582f4a916c669f (diff) | |
Make the GameCube game widescreen heuristic smarter.
The last heuristic wasn't quite smart enough and had a few
false positives in Mario Kart: Double Dash and Metroid prime 2.
Now we only activate if the game is rendering a 16:9
projection to a 4:3 viewport.
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderManager.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index a6bab1aabf..83e112021e 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -428,9 +428,11 @@ void VertexShaderManager::SetConstants() // Just in case any game decides to take this into account, we do these tests // with a large amount of slop. float aspect = fabsf(rawProjection[2] / rawProjection[0]); - if (fabsf(aspect - 16.0f/9.0f) < 16.0f/9.0f * 0.11) // within 11% of 16:9 + float viewport_aspect = fabsf(xfmem.viewport.wd / xfmem.viewport.ht); + bool viewport_is_4_3 = fabsf(viewport_aspect - 4.0f/3.0f) < 4.0f/3.0f * 0.11; + if (fabsf(aspect - 16.0f/9.0f) < 16.0f/9.0f * 0.11 && viewport_is_4_3) // within 11% of 16:9 g_aspect_wide = true; - else if (fabsf(aspect - 4.0f/3.0f) < 4.0f/3.0f * 0.11) // within 11% of 4:3 + else if (fabsf(aspect - 4.0f/3.0f) < 4.0f/3.0f * 0.11 && viewport_is_4_3) // within 11% of 4:3 g_aspect_wide = false; } |
