Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix saveslot selection for SDL2
The IDs for SDL scancodes don't start from SDL_SCANCODE_0 and end at SDL_SCANCODE_9. Therefore, SDL_SCANCODE_9 is bigger than SDL_SCANCODE_0 (which violates a precondition of the key check) and this makes it impossible to select a saveslot using the numbers on the keyboard. Using a special (order independent) function which translates to the slot ids avoids this problem and can still be optimized to a simple range check + calculation by the compiler.
- Loading branch information
Showing
1 changed file
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters