Browse Source

core: port everything to SDL 1.3.

legacy
Sam Hocevar sam 13 years ago
parent
commit
71844c65bb
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/input.cpp

+ 4
- 0
src/input.cpp View File

@@ -63,7 +63,11 @@ vec2 Input::GetAxis(int axis)

#if defined USE_SDL
/* Simulate a joystick using the keyboard. This SDL call is free. */
#if SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION >= 3
Uint8 *keystate = SDL_GetKeyboardState(NULL);
#else
Uint8 *keystate = SDL_GetKeyState(NULL);
#endif
int left = keystate[SDLK_d] - (keystate[SDLK_a] | keystate[SDLK_q]);
int up = (keystate[SDLK_w] | keystate[SDLK_z]) - keystate[SDLK_s] ;
ret.x += left;


Loading…
Cancel
Save