mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 22:56:52 +01:00
Removing wait for real Wiimote connection
when * opening the Wiimote configuration dialog * booting from the emulated program entry point rather than a state because * it doesn't have meaning in these scenarios * it has meaning when booting from a state
This commit is contained in:
parent
e36757bec1
commit
fd4a4410e5
@ -391,7 +391,7 @@ void EmuThread()
|
|||||||
// Load and Init Wiimotes - only if we are booting in wii mode
|
// Load and Init Wiimotes - only if we are booting in wii mode
|
||||||
if (g_CoreStartupParameter.bWii)
|
if (g_CoreStartupParameter.bWii)
|
||||||
{
|
{
|
||||||
Wiimote::Initialize(g_pWindowHandle);
|
Wiimote::Initialize(g_pWindowHandle, !g_stateFileName.empty());
|
||||||
|
|
||||||
// Activate wiimotes which don't have source set to "None"
|
// Activate wiimotes which don't have source set to "None"
|
||||||
for (unsigned int i = 0; i != MAX_BBMOTES; ++i)
|
for (unsigned int i = 0; i != MAX_BBMOTES; ++i)
|
||||||
|
@ -38,7 +38,7 @@ void Shutdown()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if plugin isn't initialized, init and load config
|
// if plugin isn't initialized, init and load config
|
||||||
void Initialize(void* const hwnd)
|
void Initialize(void* const hwnd, bool wait)
|
||||||
{
|
{
|
||||||
// add 4 wiimotes
|
// add 4 wiimotes
|
||||||
for (unsigned int i = WIIMOTE_CHAN_0; i<MAX_BBMOTES; ++i)
|
for (unsigned int i = WIIMOTE_CHAN_0; i<MAX_BBMOTES; ++i)
|
||||||
@ -50,7 +50,7 @@ void Initialize(void* const hwnd)
|
|||||||
|
|
||||||
g_plugin.LoadConfig(false);
|
g_plugin.LoadConfig(false);
|
||||||
|
|
||||||
WiimoteReal::Initialize();
|
WiimoteReal::Initialize(wait);
|
||||||
|
|
||||||
// reload Wiimotes with our settings
|
// reload Wiimotes with our settings
|
||||||
if (Movie::IsPlayingInput() || Movie::IsRecordingInput())
|
if (Movie::IsPlayingInput() || Movie::IsRecordingInput())
|
||||||
|
@ -35,7 +35,7 @@ namespace Wiimote
|
|||||||
{
|
{
|
||||||
|
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
void Initialize(void* const hwnd);
|
void Initialize(void* const hwnd, bool wait = false);
|
||||||
void Resume();
|
void Resume();
|
||||||
void Pause();
|
void Pause();
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ void Update(int _number);
|
|||||||
namespace WiimoteReal
|
namespace WiimoteReal
|
||||||
{
|
{
|
||||||
|
|
||||||
void Initialize();
|
void Initialize(bool wait = false);
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
void Resume();
|
void Resume();
|
||||||
void Pause();
|
void Pause();
|
||||||
|
@ -538,7 +538,7 @@ void LoadSettings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// config dialog calls this when some settings change
|
// config dialog calls this when some settings change
|
||||||
void Initialize()
|
void Initialize(bool wait)
|
||||||
{
|
{
|
||||||
if (SConfig::GetInstance().m_WiimoteContinuousScanning)
|
if (SConfig::GetInstance().m_WiimoteContinuousScanning)
|
||||||
g_wiimote_scanner.StartScanning();
|
g_wiimote_scanner.StartScanning();
|
||||||
@ -551,6 +551,8 @@ void Initialize()
|
|||||||
g_wiimote_scanner.WantBB(0 != CalculateWantedBB());
|
g_wiimote_scanner.WantBB(0 != CalculateWantedBB());
|
||||||
|
|
||||||
// wait for connection because it should exist before state load
|
// wait for connection because it should exist before state load
|
||||||
|
if (wait)
|
||||||
|
{
|
||||||
int timeout = 100;
|
int timeout = 100;
|
||||||
std::vector<Wiimote*> found_wiimotes;
|
std::vector<Wiimote*> found_wiimotes;
|
||||||
Wiimote* found_board = NULL;
|
Wiimote* found_board = NULL;
|
||||||
@ -563,6 +565,7 @@ void Initialize()
|
|||||||
timeout--;
|
timeout--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (g_real_wiimotes_initialized)
|
if (g_real_wiimotes_initialized)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user