mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
WiimoteReal: Don't block on refresh
This changes Refresh() to use the existing scanning thread to scan for devices, instead of running the scan on the UI thread and blocking it. Also makes the UI thread not block when Continuous Scanning is disabled and removes duplicated code. Should fix issue 8992. Under the hood: * The scanning thread is now always active, even when continuous scanning is disabled. * The initialize code which waits for Wiimotes to be connected also uses the scanning thread instead of scanning on yet another thread. * The scanning thread now always checks for disconnected devices, to avoid Dolphin thinking a Wiimote is still connected when it isn't. So we now check if we need new Wiimotes or a Balance Board at scan time.
This commit is contained in:
@ -35,8 +35,14 @@ extern unsigned int g_wiimote_sources[MAX_BBMOTES];
|
||||
|
||||
namespace Wiimote
|
||||
{
|
||||
enum class InitializeMode
|
||||
{
|
||||
DO_WAIT_FOR_WIIMOTES,
|
||||
DO_NOT_WAIT_FOR_WIIMOTES,
|
||||
};
|
||||
|
||||
void Shutdown();
|
||||
void Initialize(void* const hwnd, bool wait = false);
|
||||
void Initialize(void* const hwnd, InitializeMode init_mode);
|
||||
void ResetAllWiimotes();
|
||||
void LoadConfig();
|
||||
void Resume();
|
||||
@ -54,7 +60,7 @@ void Update(int _number, bool _connected);
|
||||
|
||||
namespace WiimoteReal
|
||||
{
|
||||
void Initialize(bool wait = false);
|
||||
void Initialize(::Wiimote::InitializeMode init_mode);
|
||||
void Stop();
|
||||
void Shutdown();
|
||||
void Resume();
|
||||
|
Reference in New Issue
Block a user