diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp index 16c96d7a27..6cb79b2a9a 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp @@ -694,9 +694,11 @@ void WiimotePadConfigDialog::Update(wxTimerEvent& WXUNUSED(event)) // Don't run this the first time int OldNumDIDevices; - if (WiiMoteEmu::NumDIDevices == -1) OldNumDIDevices = InputCommon::SearchDIDevices(); + if (WiiMoteEmu::NumDIDevices == -1) + OldNumDIDevices = InputCommon::SearchDIDevices(); + else // Search for connected devices and update dialog - OldNumDIDevices = WiiMoteEmu::NumDIDevices; + OldNumDIDevices = WiiMoteEmu::NumDIDevices; WiiMoteEmu::NumDIDevices = InputCommon::SearchDIDevices(); // Update if a pad has been connected/disconnected. Todo: Add a better check that also takes into consideration the pad id diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuPad.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuPad.cpp index bcfce2401d..0415e72c20 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuPad.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuPad.cpp @@ -59,6 +59,7 @@ bool LocalSearchDevices(std::vector &_joyinfo, int bool LocalSearchDevicesReset(std::vector &_joyinfo, int &_NumPads) { + PanicAlert("LocalSearchDevicesReset"); DEBUG_LOG(CONSOLE, "LocalSearchDevicesReset"); // Turn off device polling while resetting @@ -130,17 +131,13 @@ bool IsConnected(std::string Name) // ---------------- bool IsPolling() { - return true; - /* if (!SDLPolling || SDL_JoystickEventState(SDL_QUERY) == SDL_ENABLE) return false; else return true; - */ } void EnablePolling(bool Enable) { - /* if (Enable) { SDLPolling = true; @@ -151,7 +148,6 @@ void EnablePolling(bool Enable) SDLPolling = false; SDL_JoystickEventState(SDL_ENABLE); } - */ } // ID to Name diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp index db43475c61..a8df0a168e 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp @@ -175,9 +175,11 @@ void PADConfigDialognJoy::UpdateSlow() // Don't run this the first time int OldNumDIDevices; - if (NumDIDevices == -1) OldNumDIDevices = InputCommon::SearchDIDevices(); + if (NumDIDevices == -1) + OldNumDIDevices = InputCommon::SearchDIDevices(); + else // Search for connected devices and update dialog - OldNumDIDevices = NumDIDevices; + OldNumDIDevices = NumDIDevices; NumDIDevices = InputCommon::SearchDIDevices(); // Update if a pad has been connected/disconnected. Todo: Add a better check that also takes into consideration the pad id diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp index fd65a10b53..2beb4471c6 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp @@ -512,22 +512,17 @@ bool IsConnected(std::string Name) } } -// Earlier versions of SDL could crash if SDL functions were called during SDL_Quit/SDL_Init. I could not get -// such a crash in the new version even with frequent SDL_Quit/SDL_Init so thse functions are disabled now. +// It could be possible to crash SDL.dll if SDL functions are called during SDL_Quit/SDL_Init. Therefore these functions. // ---------------- bool IsPolling() { - return true; - /* if (!SDLPolling || SDL_JoystickEventState(SDL_QUERY) == SDL_ENABLE) return false; else return true; - */ } void EnablePolling(bool Enable) { - /* if (Enable) { SDLPolling = true; @@ -538,7 +533,6 @@ void EnablePolling(bool Enable) SDLPolling = false; SDL_JoystickEventState(SDL_ENABLE); } - */ } // ID to Name