summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
-rw-r--r--Source/Core/VideoCommon/RenderBase.cpp100
1 files changed, 1 insertions, 99 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp
index d324dacac6..e597ee1e82 100644
--- a/Source/Core/VideoCommon/RenderBase.cpp
+++ b/Source/Core/VideoCommon/RenderBase.cpp
@@ -26,19 +26,14 @@
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
-#include "Core/Config/SYSCONFSettings.h"
#include "Core/ConfigManager.h"
#include "Core/System.h"
-#include "VideoCommon/AbstractGfx.h"
#include "VideoCommon/BPFunctions.h"
#include "VideoCommon/BPMemory.h"
-#include "VideoCommon/BoundingBox.h"
-#include "VideoCommon/FrameDumper.h"
#include "VideoCommon/FramebufferManager.h"
#include "VideoCommon/PixelEngine.h"
#include "VideoCommon/Present.h"
-#include "VideoCommon/VertexManagerBase.h"
#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoCommon.h"
#include "VideoCommon/VideoConfig.h"
@@ -48,15 +43,6 @@ std::unique_ptr<Renderer> g_renderer;
Renderer::Renderer() : m_prev_efb_format{PixelFormat::INVALID_FMT}
{
- UpdateWidescreen();
-
- m_config_changed_handle =
- ConfigChangedEvent::Register([this](u32 bits) { OnConfigChanged(bits); }, "Renderer");
-
- // VertexManager doesn't maintain statistics in Wii mode.
- if (!SConfig::GetInstance().bWii)
- m_update_widescreen_handle =
- AfterFrameEvent::Register([this] { UpdateWidescreenHeuristic(); }, "WideScreen Heuristic");
}
Renderer::~Renderer() = default;
@@ -166,85 +152,6 @@ void Renderer::PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num
}
}
-void Renderer::UpdateWidescreen()
-{
- if (SConfig::GetInstance().bWii)
- m_is_game_widescreen = Config::Get(Config::SYSCONF_WIDESCREEN);
-
- // suggested_aspect_mode overrides SYSCONF_WIDESCREEN
- if (g_ActiveConfig.suggested_aspect_mode == AspectMode::Analog)
- m_is_game_widescreen = false;
- else if (g_ActiveConfig.suggested_aspect_mode == AspectMode::AnalogWide)
- m_is_game_widescreen = true;
-
- // If widescreen hack is disabled override game's AR if UI is set to 4:3 or 16:9.
- if (!g_ActiveConfig.bWidescreenHack)
- {
- const auto aspect_mode = g_ActiveConfig.aspect_mode;
- if (aspect_mode == AspectMode::Analog)
- m_is_game_widescreen = false;
- else if (aspect_mode == AspectMode::AnalogWide)
- m_is_game_widescreen = true;
- }
-}
-
-// Heuristic to detect if a GameCube game is in 16:9 anamorphic widescreen mode.
-void Renderer::UpdateWidescreenHeuristic()
-{
- const auto flush_statistics = g_vertex_manager->ResetFlushAspectRatioCount();
-
- // If suggested_aspect_mode (GameINI) is configured don't use heuristic.
- if (g_ActiveConfig.suggested_aspect_mode != AspectMode::Auto)
- return;
-
- UpdateWidescreen();
-
- // If widescreen hack isn't active and aspect_mode (UI) is 4:3 or 16:9 don't use heuristic.
- if (!g_ActiveConfig.bWidescreenHack && (g_ActiveConfig.aspect_mode == AspectMode::Analog ||
- g_ActiveConfig.aspect_mode == AspectMode::AnalogWide))
- return;
-
- // Modify the threshold based on which aspect ratio we're already using:
- // If the game's in 4:3, it probably won't switch to anamorphic, and vice-versa.
- static constexpr u32 TRANSITION_THRESHOLD = 3;
-
- const auto looks_normal = [](auto& counts) {
- return counts.normal_vertex_count > counts.anamorphic_vertex_count * TRANSITION_THRESHOLD;
- };
- const auto looks_anamorphic = [](auto& counts) {
- return counts.anamorphic_vertex_count > counts.normal_vertex_count * TRANSITION_THRESHOLD;
- };
-
- const auto& persp = flush_statistics.perspective;
- const auto& ortho = flush_statistics.orthographic;
-
- const auto ortho_looks_anamorphic = looks_anamorphic(ortho);
-
- if (looks_anamorphic(persp) || ortho_looks_anamorphic)
- {
- // If either perspective or orthographic projections look anamorphic, it's a safe bet.
- m_is_game_widescreen = true;
- }
- else if (looks_normal(persp) || (m_was_orthographically_anamorphic && looks_normal(ortho)))
- {
- // Many widescreen games (or AR/GeckoCodes) use anamorphic perspective projections
- // with NON-anamorphic orthographic projections.
- // This can cause incorrect changes to 4:3 when perspective projections are temporarily not
- // shown. e.g. Animal Crossing's inventory menu.
- // Unless we were in a situation which was orthographically anamorphic
- // we won't consider orthographic data for changes from 16:9 to 4:3.
- m_is_game_widescreen = false;
- }
-
- m_was_orthographically_anamorphic = ortho_looks_anamorphic;
-}
-
-void Renderer::OnConfigChanged(u32 bits)
-{
- if (bits & CONFIG_CHANGE_BIT_ASPECT_RATIO)
- UpdateWidescreen();
-}
-
bool Renderer::UseVertexDepthRange()
{
// We can't compute the depth range in the vertex shader if we don't support depth clamp.
@@ -266,10 +173,5 @@ bool Renderer::UseVertexDepthRange()
void Renderer::DoState(PointerWrap& p)
{
- p.Do(m_is_game_widescreen);
-
- if (p.IsReadMode())
- {
- m_was_orthographically_anamorphic = false;
- }
+ p.Do(m_prev_efb_format);
}