mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Fixed an issue where controllers were sometimes not added correctly when there was a mix of supported and unsupported devices present
This commit is contained in:
parent
2356bd248f
commit
39bb28e353
|
@ -110,12 +110,10 @@ void InputManager::init()
|
|||
int numJoysticks {SDL_NumJoysticks()};
|
||||
|
||||
// Make sure that every joystick is actually supported by the GameController API.
|
||||
for (int i {0}; i < numJoysticks; ++i)
|
||||
if (!SDL_IsGameController(i))
|
||||
--numJoysticks;
|
||||
|
||||
for (int i {0}; i < numJoysticks; ++i)
|
||||
addControllerByDeviceIndex(nullptr, i);
|
||||
for (int i {0}; i < numJoysticks; ++i) {
|
||||
if (SDL_IsGameController(i))
|
||||
addControllerByDeviceIndex(nullptr, i);
|
||||
}
|
||||
|
||||
SDL_USER_CECBUTTONDOWN = SDL_RegisterEvents(2);
|
||||
SDL_USER_CECBUTTONUP = SDL_USER_CECBUTTONDOWN + 1;
|
||||
|
|
Loading…
Reference in a new issue