iamgreaser / iceball

Open-source rewrite of the VOXLAP version of Ace of Spades.
http://iceball.build
GNU General Public License v3.0
113 stars 32 forks source link

Use SDL_GetKeyFromScancode instead of remap_scancodes. Remove a cast from NULL. #258

Closed Rukachan closed 7 years ago

iamgreaser commented 8 years ago

Alright, most important question, have you actually tested this? It's mostly for backwards compat with SDL 1.2, and the actual game code depends on this.

iamgreaser commented 8 years ago

I've had a look through it again, and this will NOT work as-is. SDL_GetKeyFromScancode returns different values for control codes - these are the ones which use SDL_SCANCODE_TO_KEYCODE() which adds (1<<30) to the scancode number. You still need some of the switch block in place.

rakiru commented 8 years ago

I think we should just drop the backwards compatibility hack next time there's another breaking change. Plus, now that we have the dev branch, individual release can be a bit more substantial.

asiekierka commented 8 years ago

@rakiru - Isn't that what the dev branch is for right now? Between adding LuaJIT and Unicode support, we might as well break everything.

iamgreaser commented 8 years ago

@asiekierka The dev branch is mostly so we don't have to bump the version number every time, and it will have to be merged into master at some point anyway.

rakiru commented 8 years ago

Likewise, we'll break backwards compatibility with something at some point, so might as well use it as an opportunity to clean up as much cruft as possible.

asiekierka commented 7 years ago

I think this fix is ultimately pointless, as SDL3 or some other thing might come along and break the scancodes again in the future. We still have to remap them to our own list.