Commits

ecsv
committed
f17a1af2013-07-25

Fix saveslot selection for SDL2

The IDs for SDL scancodes don't start from SDL_SCANCODE_0 and end atSDL_SCANCODE_9. Therefore, SDL_SCANCODE_9 is bigger than SDL_SCANCODE_0 (whichviolates a precondition of the key check) and this makes it impossible toselect a saveslot using the numbers on the keyboard.

Using a special (order independent) function which translates to the slot idsavoids this problem and can still be optimized to a simple range check +calculation by the compiler.