瀏覽代碼

core: port everything to SDL 1.3.

legacy
Sam Hocevar sam 13 年之前
父節點
當前提交
71844c65bb
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. +4
    -0
      src/input.cpp

+ 4
- 0
src/input.cpp 查看文件

@@ -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…
取消
儲存