From 20c2928c2b157b8a322a128732cd00cabbfa9d6d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 10 Aug 2018 18:39:37 -0400 Subject: video_core; Get rid of global g_toggle_framelimit_enabled variable Instead, we make a struct for renderer settings and allow the renderer to update all of these settings, getting rid of the need for global-scoped variables. This also uncovered a few indirect inclusions for certain headers, which this commit also fixes. --- src/video_core/renderer_base.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/video_core/renderer_base.cpp') diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp index 3ca350243..e87016429 100644 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp @@ -4,18 +4,23 @@ #include #include "core/frontend/emu_window.h" +#include "core/settings.h" #include "video_core/renderer_base.h" #include "video_core/renderer_opengl/gl_rasterizer.h" namespace VideoCore { -RendererBase::RendererBase(EmuWindow& window) : render_window{window} {} +RendererBase::RendererBase(EmuWindow& window) : render_window{window} { + RefreshBaseSettings(); +} + RendererBase::~RendererBase() = default; -void RendererBase::UpdateCurrentFramebufferLayout() { - const Layout::FramebufferLayout& layout = render_window.GetFramebufferLayout(); +void RendererBase::RefreshBaseSettings() { + RefreshRasterizerSetting(); + UpdateCurrentFramebufferLayout(); - render_window.UpdateCurrentFramebufferLayout(layout.width, layout.height); + renderer_settings.use_framelimiter = Settings::values.toggle_framelimit; } void RendererBase::RefreshRasterizerSetting() { @@ -24,4 +29,10 @@ void RendererBase::RefreshRasterizerSetting() { } } +void RendererBase::UpdateCurrentFramebufferLayout() { + const Layout::FramebufferLayout& layout = render_window.GetFramebufferLayout(); + + render_window.UpdateCurrentFramebufferLayout(layout.width, layout.height); +} + } // namespace VideoCore -- cgit v1.2.3