sdl: make previous commit compatible with SDL 1.3

This commit is contained in:
plombo 2011-03-30 03:11:34 +00:00
parent 1b5b6ee38d
commit 602b7e82fe
1 changed files with 8 additions and 2 deletions

View File

@ -378,7 +378,6 @@ static void
KeyboardCommands() KeyboardCommands()
{ {
int is_shift, is_alt; int is_shift, is_alt;
SDLMod mod;
char* movie_fname = ""; char* movie_fname = "";
// get the keyboard input // get the keyboard input
@ -401,12 +400,19 @@ KeyboardCommands()
} }
} }
mod = SDL_GetModState(); #if SDL_VERSION_ATLEAST(1, 3, 0)
if(g_keyState[SDL_GetScancodeFromKey(SDLK_LSHIFT)] || g_keyState[SDL_GetScancodeFromKey(SDLK_RSHIFT)])
#else
if(g_keyState[SDLK_LSHIFT] || g_keyState[SDLK_RSHIFT]) if(g_keyState[SDLK_LSHIFT] || g_keyState[SDLK_RSHIFT])
#endif
is_shift = 1; is_shift = 1;
else else
is_shift = 0; is_shift = 0;
#if SDL_VERSION_ATLEAST(1, 3, 0)
if(g_keyState[SDL_GetScancodeFromKey(SDLK_LALT)] || g_keyState[SDL_GetScancodeFromKey(SDLK_RALT)])
#else
if(g_keyState[SDLK_LALT] || g_keyState[SDLK_RALT]) if(g_keyState[SDLK_LALT] || g_keyState[SDLK_RALT])
#endif
is_alt = 1; is_alt = 1;
else else
is_alt = 0; is_alt = 0;