summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexShaderManager.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2017-04-10 11:30:34 +1200
committerGitHub <noreply@github.com>2017-04-10 11:30:34 +1200
commite6476b805e4420c5400d1b655de3f1790f93b4b4 (patch)
tree0482f9ba79f9b68763381051ccc528237b3f5d3d /Source/Core/VideoCommon/VertexShaderManager.cpp
parentc6b553b6d26bc91c0ce49c43790733d6755156d9 (diff)
parentd10d09ccc1eae227db5be0d2908c7aec5610e6a1 (diff)
Merge pull request #5008 from ligfx/aspectheuristic
VideoCommon: rework anamorphic widescreen heuristic
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexShaderManager.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp
index 76a91e0f05..8818c7f387 100644
--- a/Source/Core/VideoCommon/VertexShaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexShaderManager.cpp
@@ -92,23 +92,6 @@ static float PHackValue(std::string sValue)
return f;
}
-// Due to the BT.601 standard which the GameCube is based on being a compromise
-// between PAL and NTSC, neither standard gets square pixels. They are each off
-// by ~9% in opposite directions.
-// Just in case any game decides to take this into account, we do both these
-// tests with a large amount of slop.
-static bool AspectIs4_3(float width, float height)
-{
- float aspect = fabsf(width / height);
- return fabsf(aspect - 4.0f / 3.0f) < 4.0f / 3.0f * 0.11; // within 11% of 4:3
-}
-
-static bool AspectIs16_9(float width, float height)
-{
- float aspect = fabsf(width / height);
- return fabsf(aspect - 16.0f / 9.0f) < 16.0f / 9.0f * 0.11; // within 11% of 16:9
-}
-
void UpdateProjectionHack(int iPhackvalue[], std::string sPhackvalue[])
{
float fhackvalue1 = 0, fhackvalue2 = 0;
@@ -470,18 +453,6 @@ void VertexShaderManager::SetConstants()
g_fProjectionMatrix[14] = -1.0f;
g_fProjectionMatrix[15] = 0.0f;
- // Heuristic to detect if a GameCube game is in 16:9 anamorphic widescreen mode.
- if (!SConfig::GetInstance().bWii)
- {
- bool viewport_is_4_3 = AspectIs4_3(xfmem.viewport.wd, xfmem.viewport.ht);
- if (AspectIs16_9(rawProjection[2], rawProjection[0]) && viewport_is_4_3)
- Core::g_aspect_wide = true; // Projection is 16:9 and viewport is 4:3, we are rendering
- // an anamorphic widescreen picture
- else if (AspectIs4_3(rawProjection[2], rawProjection[0]) && viewport_is_4_3)
- Core::g_aspect_wide =
- false; // Project and viewports are both 4:3, we are rendering a normal image.
- }
-
SETSTAT_FT(stats.gproj_0, g_fProjectionMatrix[0]);
SETSTAT_FT(stats.gproj_1, g_fProjectionMatrix[1]);
SETSTAT_FT(stats.gproj_2, g_fProjectionMatrix[2]);