Skip to content

Commit

Permalink
Fixed gamepads
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Chermenin committed May 23, 2021
1 parent c689079 commit 708ad2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions systemstub_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,10 @@ void SystemStub_SDL::init(const char *title, int w, int h, bool fullscreen, int
_controller = 0;
if (SDL_NumJoysticks() > 0) {
SDL_GameControllerAddMapping(Resource::_controllerMapping);
_joystick = SDL_JoystickOpen(kJoystickIndex);
if (SDL_IsGameController(kJoystickIndex)) {
_controller = SDL_GameControllerOpen(kJoystickIndex);
}
if (!_controller) {
_joystick = SDL_JoystickOpen(kJoystickIndex);
}
}
_screenshot = 1;
}
Expand Down Expand Up @@ -671,6 +669,8 @@ void SystemStub_SDL::processEvent(const SDL_Event &ev, bool &paused) {
case 3:
_pi.backspace = pressed;
break;
case 9:
_pi.escape = pressed;
}
}
break;
Expand Down

0 comments on commit 708ad2f

Please sign in to comment.