File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/) since version
66## [ Unreleased]
77### Fixed
88- Ignore the locale when encoding file paths outside of Windows.
9+ - Fix performance when calling joystick functions.
910
1011## [ 16.2.1] - 2023-09-24
1112### Fixed
Original file line number Diff line number Diff line change @@ -363,7 +363,10 @@ def _touchpad(self) -> bool:
363363
364364def init () -> None :
365365 """Initialize SDL's joystick and game controller subsystems."""
366- tcod .sdl .sys .init (tcod .sdl .sys .Subsystem .JOYSTICK | tcod .sdl .sys .Subsystem .GAMECONTROLLER )
366+ CONTROLLER_SYSTEMS = tcod .sdl .sys .Subsystem .JOYSTICK | tcod .sdl .sys .Subsystem .GAMECONTROLLER
367+ if tcod .sdl .sys .Subsystem (lib .SDL_WasInit (CONTROLLER_SYSTEMS )) == CONTROLLER_SYSTEMS :
368+ return # Already initialized
369+ tcod .sdl .sys .init (CONTROLLER_SYSTEMS )
367370
368371
369372def _get_number () -> int :
You can’t perform that action at this time.
0 commit comments