mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +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()};
|
int numJoysticks {SDL_NumJoysticks()};
|
||||||
|
|
||||||
// Make sure that every joystick is actually supported by the GameController API.
|
// Make sure that every joystick is actually supported by the GameController API.
|
||||||
for (int i {0}; i < numJoysticks; ++i)
|
for (int i {0}; i < numJoysticks; ++i) {
|
||||||
if (!SDL_IsGameController(i))
|
if (SDL_IsGameController(i))
|
||||||
--numJoysticks;
|
addControllerByDeviceIndex(nullptr, i);
|
||||||
|
}
|
||||||
for (int i {0}; i < numJoysticks; ++i)
|
|
||||||
addControllerByDeviceIndex(nullptr, i);
|
|
||||||
|
|
||||||
SDL_USER_CECBUTTONDOWN = SDL_RegisterEvents(2);
|
SDL_USER_CECBUTTONDOWN = SDL_RegisterEvents(2);
|
||||||
SDL_USER_CECBUTTONUP = SDL_USER_CECBUTTONDOWN + 1;
|
SDL_USER_CECBUTTONUP = SDL_USER_CECBUTTONDOWN + 1;
|
||||||
|
|
Loading…
Reference in a new issue