diff options
| author | Léo Lam <leo@leolam.fr> | 2020-05-04 01:21:51 +0200 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2020-05-22 16:54:53 +0200 |
| commit | 8df56cb319fd59ceab1122580fe5a318b0344cf6 (patch) | |
| tree | 022df8fdd397e547373266a230dd94ebea477526 /Source/Core/VideoCommon/VideoBackendBase.cpp | |
| parent | 393ce529af87b1b11877eb6e376c54592f4160ee (diff) | |
Migrate video backend setting to the new config system
Fixes https://bugs.dolphin-emu.org/issues/12087
Diffstat (limited to 'Source/Core/VideoCommon/VideoBackendBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VideoBackendBase.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
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) |
