mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 09:39:46 -06:00
Merge pull request #4839 from leoetlino/better-warnings
Be less annoying when usbdk is not installed
This commit is contained in:
@ -30,7 +30,6 @@ void Init()
|
||||
VideoBackendBase::PopulateList();
|
||||
WiimoteReal::LoadSettings();
|
||||
GCAdapter::Init();
|
||||
USBUtils::Init();
|
||||
VideoBackendBase::ActivateBackend(SConfig::GetInstance().m_strVideoBackend);
|
||||
|
||||
SetEnableAlert(SConfig::GetInstance().bUsePanicHandlers);
|
||||
@ -42,7 +41,6 @@ void Shutdown()
|
||||
WiimoteReal::Shutdown();
|
||||
VideoBackendBase::ClearList();
|
||||
SConfig::Shutdown();
|
||||
USBUtils::Shutdown();
|
||||
LogManager::Shutdown();
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
#ifdef __LIBUSB__
|
||||
#include <libusb.h>
|
||||
@ -14,6 +15,7 @@
|
||||
#include "UICommon/USBUtils.h"
|
||||
|
||||
#ifdef __LIBUSB__
|
||||
static std::once_flag s_tried_libusb_init;
|
||||
static std::shared_ptr<libusb_context> s_libusb_context;
|
||||
#endif
|
||||
|
||||
@ -36,25 +38,12 @@ static const std::map<std::pair<u16, u16>, std::string> s_wii_peripherals = {{
|
||||
|
||||
namespace USBUtils
|
||||
{
|
||||
void Init()
|
||||
{
|
||||
#ifdef __LIBUSB__
|
||||
s_libusb_context = LibusbContext::Get();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
#ifdef __LIBUSB__
|
||||
s_libusb_context = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
std::map<std::pair<u16, u16>, std::string> GetInsertedDevices()
|
||||
{
|
||||
std::map<std::pair<u16, u16>, std::string> devices;
|
||||
|
||||
#ifdef __LIBUSB__
|
||||
std::call_once(s_tried_libusb_init, []() { s_libusb_context = LibusbContext::Get(); });
|
||||
if (!s_libusb_context)
|
||||
return devices;
|
||||
|
||||
|
@ -12,9 +12,6 @@
|
||||
|
||||
namespace USBUtils
|
||||
{
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
std::map<std::pair<u16, u16>, std::string> GetInsertedDevices();
|
||||
std::string GetDeviceName(std::pair<u16, u16> vid_pid);
|
||||
} // namespace USBUtils
|
||||
|
Reference in New Issue
Block a user