summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VideoConfig.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2025-11-04 13:57:08 -0600
committerGitHub <noreply@github.com>2025-11-04 13:57:08 -0600
commit7d617878e0a4d61bd1362cb5069b86e82be4723f (patch)
treec4fac7cdff7aeacf983ba65ba0ea8bc1ed9a8f4b /Source/Core/VideoCommon/VideoConfig.cpp
parent947ed4aaf69714d6df0209bf1c55bd419ab8a3a3 (diff)
parentf289b06e0db8bba6a3491d6e3cf0c2dd1b7a29fa (diff)
Merge pull request #13626 from jordan-woyak/non-global-hookable-event
Common: Make HookableEvent use non-static data.
Diffstat (limited to 'Source/Core/VideoCommon/VideoConfig.cpp')
-rw-r--r--Source/Core/VideoCommon/VideoConfig.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp
index 0214dab9dd..63d061e684 100644
--- a/Source/Core/VideoCommon/VideoConfig.cpp
+++ b/Source/Core/VideoCommon/VideoConfig.cpp
@@ -38,6 +38,7 @@ VideoConfig g_ActiveConfig;
BackendInfo g_backend_info;
static std::optional<CPUThreadConfigCallback::ConfigChangedCallbackID>
s_config_changed_callback_id = std::nullopt;
+static Common::EventHook s_check_config_event;
static bool IsVSyncActive(bool enabled)
{
@@ -218,8 +219,16 @@ void VideoConfig::VerifyValidity()
}
}
+void VideoConfig::Init()
+{
+ s_check_config_event = GetVideoEvents().after_frame_event.Register(
+ [](Core::System&) { CheckForConfigChanges(); }, "CheckForConfigChanges");
+}
+
void VideoConfig::Shutdown()
{
+ s_check_config_event.reset();
+
if (!s_config_changed_callback_id.has_value())
return;
@@ -390,10 +399,7 @@ void CheckForConfigChanges()
}
// Notify all listeners
- ConfigChangedEvent::Trigger(changed_bits);
+ GetVideoEvents().config_changed_event.Trigger(changed_bits);
// TODO: Move everything else to the ConfigChanged event
}
-
-static Common::EventHook s_check_config_event = AfterFrameEvent::Register(
- [](Core::System&) { CheckForConfigChanges(); }, "CheckForConfigChanges");