mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
This should fix Issue 1982 & Issue 2042
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4908 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -211,17 +211,24 @@ void Close_Devices()
|
||||
PAD_RumbleClose();
|
||||
/* Close all devices carefully. We must check that we are not accessing any undefined
|
||||
vector elements or any bad devices */
|
||||
for (int i = 0; i < 4; i++)
|
||||
if (SDL_WasInit(0))
|
||||
{
|
||||
if (SDL_WasInit(0) && joyinfo.size() > (u32)PadMapping[i].ID)
|
||||
if (PadState[i].joy && joyinfo.at(PadMapping[i].ID).Good)
|
||||
if(SDL_JoystickOpened(PadMapping[i].ID))
|
||||
for (int i = 0; i < NumPads; i++)
|
||||
{
|
||||
if (joyinfo.at(i).joy)
|
||||
{
|
||||
if(SDL_JoystickOpened(i))
|
||||
{
|
||||
SDL_JoystickClose(PadState[i].joy);
|
||||
PadState[i].joy = NULL;
|
||||
INFO_LOG(WIIMOTE, "Shut down Joypad: %i", i);
|
||||
SDL_JoystickClose(joyinfo.at(i).joy);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
PadState[i].joy = NULL;
|
||||
|
||||
// Clear the physical device info
|
||||
joyinfo.clear();
|
||||
NumPads = 0;
|
||||
@ -478,9 +485,9 @@ bool Search_Devices(std::vector<InputCommon::CONTROLLER_INFO> &_joyinfo, int &_N
|
||||
// Update the PadState[].joy handle
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (joyinfo.size() > (u32)PadMapping[i].ID)
|
||||
if (_NumPads > (u32)PadMapping[i].ID)
|
||||
if(joyinfo.at(PadMapping[i].ID).Good)
|
||||
PadState[i].joy = SDL_JoystickOpen(PadMapping[i].ID);
|
||||
PadState[i].joy = joyinfo.at(PadMapping[i].ID).joy;
|
||||
}
|
||||
|
||||
return Success;
|
||||
|
Reference in New Issue
Block a user