Merge pull request #60 from DanielGibson/fix-sdl2

Fix compiling with SDL2 release
This commit is contained in:
Robert Beckebans 2013-08-13 14:10:07 -07:00
commit cfbbcd6fe6

View file

@ -887,7 +887,13 @@ sysEvent_t Sys_GetEvent()
if( key == 0 )
{
#if SDL_VERSION_ATLEAST(2, 0, 0)
// SDL2 has no ev.key.keysym.unicode anymore.. but the scancode should work well enough for console
if( ev.type == SDL_KEYDOWN ) // FIXME: don't complain if this was an ASCII char and the console is open?
common->Warning( "unmapped SDL key %d scancode %d", ev.key.keysym.sym, ev.key.keysym.scancode );
return res_none;
#else
unsigned char uc = ev.key.keysym.unicode & 0xff;
// check if its an unmapped console key
if( uc == Sys_GetConsoleKey( false ) || uc == Sys_GetConsoleKey( true ) )
@ -901,6 +907,7 @@ sysEvent_t Sys_GetEvent()
common->Warning( "unmapped SDL key %d (0x%x) scancode %d", ev.key.keysym.sym, ev.key.keysym.unicode, ev.key.keysym.scancode );
return res_none;
}
#endif
}
}