mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
VideoCommon: Get rid of the global g_available_video_backends
Replace it with a function-local static that is initialized on first use. This gets rid of a global variable and removes the need for manual initialization in UICommon. This commit also replaces the weird find_if that looks for a non-null unique_ptr with a simple "is vector empty" check considering that none of the pointers can be null by construction.
This commit is contained in:
@ -60,8 +60,7 @@ public:
|
||||
u16 Video_GetBoundingBox(int index);
|
||||
|
||||
static std::string GetDefaultBackendName();
|
||||
static void PopulateList();
|
||||
static void ClearList();
|
||||
static const std::vector<std::unique_ptr<VideoBackendBase>>& GetAvailableBackends();
|
||||
static void ActivateBackend(const std::string& name);
|
||||
|
||||
// Fills the backend_info fields with the capabilities of the selected backend/device.
|
||||
@ -79,5 +78,4 @@ protected:
|
||||
bool m_initialized = false;
|
||||
};
|
||||
|
||||
extern std::vector<std::unique_ptr<VideoBackendBase>> g_available_video_backends;
|
||||
extern VideoBackendBase* g_video_backend;
|
||||
|
Reference in New Issue
Block a user