Common: Make HookableEvent use non-static data.

Co-authored-by: Dentomologist <dentomologist@gmail.com>
This commit is contained in:
Jordan Woyak
2025-05-03 02:48:44 -05:00
parent 9c28f19e56
commit f289b06e0d
30 changed files with 263 additions and 175 deletions

View File

@@ -29,7 +29,10 @@ WidescreenManager::WidescreenManager()
"Invalid suggested aspect ratio mode: only Auto, 4:3 and 16:9 are supported");
}
m_config_changed = ConfigChangedEvent::Register(
auto& system = Core::System::GetInstance();
auto& video_events = system.GetVideoEvents();
m_config_changed = video_events.config_changed_event.Register(
[this](u32 bits) {
if (bits & (CONFIG_CHANGE_BIT_ASPECT_RATIO))
{
@@ -45,10 +48,9 @@ WidescreenManager::WidescreenManager()
"Widescreen");
// VertexManager doesn't maintain statistics in Wii mode.
auto& system = Core::System::GetInstance();
if (!system.IsWii())
{
m_update_widescreen = AfterFrameEvent::Register(
m_update_widescreen = video_events.after_frame_event.Register(
[this](Core::System&) { UpdateWidescreenHeuristic(); }, "WideScreen Heuristic");
}
}