From 5c1b3ac61d7e660a9d1c206dbd0e615d637d3272 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Fri, 3 Feb 2023 20:00:57 +1300 Subject: [PATCH] Hook up Presenter's ConfigChanged function Fixes issue with post-processing not working --- Source/Core/VideoCommon/Present.cpp | 4 +++- Source/Core/VideoCommon/Present.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/Present.cpp b/Source/Core/VideoCommon/Present.cpp index 068c4693fa..181dfea140 100644 --- a/Source/Core/VideoCommon/Present.cpp +++ b/Source/Core/VideoCommon/Present.cpp @@ -31,6 +31,8 @@ static float AspectToWidescreen(float aspect) Presenter::Presenter() { + m_config_changed = + ConfigChangedEvent::Register([this](u32 bits) { ConfigChanged(bits); }, "Presenter"); } Presenter::~Presenter() @@ -176,7 +178,7 @@ void Presenter::SetBackbuffer(SurfaceInfo info) UpdateDrawRectangle(); } -void Presenter::CheckForConfigChanges(u32 changed_bits) +void Presenter::ConfigChanged(u32 changed_bits) { // Check for post-processing shader changes. Done up here as it doesn't affect anything outside // the post-processor. Note that options are applied every frame, so no need to check those. diff --git a/Source/Core/VideoCommon/Present.h b/Source/Core/VideoCommon/Present.h index eee98d0c1a..14d2104a65 100644 --- a/Source/Core/VideoCommon/Present.h +++ b/Source/Core/VideoCommon/Present.h @@ -44,7 +44,7 @@ public: bool Initialize(); - void CheckForConfigChanges(u32 changed_bits); + void ConfigChanged(u32 changed_bits); // Display resolution int GetBackbufferWidth() const { return m_backbuffer_width; } @@ -147,6 +147,8 @@ private: u32 m_last_xfb_width = MAX_XFB_WIDTH; u32 m_last_xfb_stride = 0; u32 m_last_xfb_height = MAX_XFB_HEIGHT; + + Common::EventHook m_config_changed; }; } // namespace VideoCommon