Introducing WM_DEVICECHANGE win32callback.

No need to press the "refresh wiimotes" button on pair up anymore, checking the extended pair up box(still experimental) allows u to pair and hook up the wiimote while being ingame. You still need to do the ALT+F5/F6/F7/F8 connect, but you wont need to press the pair up button + refresh button anymore, feel free to test it, its not perfect yes. Just press 1+2 on your Wiimote to pair it up ingame(you need to check the extended pair up box for that feature).
PS I hope I didnt break nonwin32 builds, I gave my best however.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5413 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
snzgoo
2010-04-26 17:51:32 +00:00
parent c344502524
commit c59409b46a
9 changed files with 238 additions and 18 deletions

View File

@ -104,12 +104,17 @@ BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
break;
case DLL_PROCESS_DETACH:
{
#ifdef _WIN32
if (g_Config.bUnpairRealWiimote) WiiMoteReal::WiimotePairUp(true);
if (g_Config.bUnpairRealWiimote){
WiiMoteReal::Shutdown();
WiiMoteReal::WiimotePairUp(true);
}
#endif
#if defined(HAVE_WX) && HAVE_WX
wxUninitialize();
#endif
}
break;
}
@ -159,6 +164,13 @@ void DllDebugger(HWND _hParent, bool Show) {}
void DllConfig(HWND _hParent)
{
#ifdef _WIN32
if (WiiMoteReal::g_AutoPairUpInvisibleWindow == NULL)
{
WiiMoteReal::g_AutoPairUpInvisibleWindow = new Common::Thread(WiiMoteReal::RunInvisibleMessageWindow_ThreadFunc, NULL);
WiiMoteReal::g_AutoPairUpMonitoring = new Common::Thread(WiiMoteReal::PairUp_ThreadFunc, NULL);
}
#endif
if (!g_SearchDeviceDone)
{
// Load settings
@ -168,6 +180,7 @@ void DllConfig(HWND _hParent)
g_SearchDeviceDone = true;
}
#if defined(HAVE_WX) && HAVE_WX
wxWindow *frame = GetParentedWxWindow(_hParent);
m_BasicConfigFrame = new WiimoteBasicConfigDialog(frame);
@ -223,8 +236,16 @@ void Initialize(void *init)
Wiimote connected or not. It takes no time for Wiiuse to check for
connected Wiimotes. */
#if HAVE_WIIUSE
WiiMoteReal::Initialize();
WiiMoteReal::Allocate();
#ifdef _WIN32
if (WiiMoteReal::g_AutoPairUpInvisibleWindow == NULL)
{
WiiMoteReal::g_AutoPairUpInvisibleWindow = new Common::Thread(WiiMoteReal::RunInvisibleMessageWindow_ThreadFunc, NULL);
WiiMoteReal::g_AutoPairUpMonitoring = new Common::Thread(WiiMoteReal::PairUp_ThreadFunc, NULL);
}
#endif
#endif
}
@ -273,6 +294,7 @@ void EmuStateChange(PLUGIN_EMUSTATE newState)
g_EmulatorState = newState;
}
/* This function produce Wiimote Input (reports from the Wiimote) in response
to Output from the Wii. It's called from WII_IPC_HLE_WiiMote.cpp.