From 8df56cb319fd59ceab1122580fe5a318b0344cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 4 May 2020 01:21:51 +0200 Subject: Migrate video backend setting to the new config system Fixes https://bugs.dolphin-emu.org/issues/12087 --- Source/Core/VideoCommon/VideoBackendBase.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon/VideoBackendBase.cpp') diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index 2c58449e1d..5e7337c767 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -14,9 +14,11 @@ #include "Common/ChunkFile.h" #include "Common/CommonTypes.h" +#include "Common/Config/Config.h" #include "Common/Event.h" #include "Common/Logging/Log.h" +#include "Core/Config/MainSettings.h" #include "Core/ConfigManager.h" #include "Core/Core.h" @@ -245,18 +247,21 @@ void VideoBackendBase::ActivateBackend(const std::string& name) void VideoBackendBase::PopulateBackendInfo() { - // If the core is running, the backend info will have been populated already. - // If we did it here, the UI thread can race with the with the GPU thread. - if (Core::IsRunning()) - return; - // We refresh the config after initializing the backend info, as system-specific settings // such as anti-aliasing, or the selected adapter may be invalid, and should be checked. - ActivateBackend(SConfig::GetInstance().m_strVideoBackend); + ActivateBackend(Config::Get(Config::MAIN_GFX_BACKEND)); g_video_backend->InitBackendInfo(); g_Config.Refresh(); } +void VideoBackendBase::PopulateBackendInfoFromUI() +{ + // If the core is running, the backend info will have been populated already. + // If we did it here, the UI thread can race with the with the GPU thread. + if (!Core::IsRunning()) + PopulateBackendInfo(); +} + void VideoBackendBase::DoState(PointerWrap& p) { if (!SConfig::GetInstance().bCPUThread) -- cgit v1.2.3