diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2009-05-31 09:44:20 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2009-05-31 09:44:20 +0000 |
| commit | 4bb1df318905f491740f4298c69cda317fb53fcb (patch) | |
| tree | 486c4edf2d6af2089ffab60a7422d5e7abefa891 /src/engine/client/ec_inp.c | |
| parent | b28ede2da2c42643c5aa710a8076f0249d48c9e4 (diff) | |
| download | zcatch-4bb1df318905f491740f4298c69cda317fb53fcb.tar.gz zcatch-4bb1df318905f491740f4298c69cda317fb53fcb.zip | |
moved 0.5 branch to trunk
Diffstat (limited to 'src/engine/client/ec_inp.c')
| -rw-r--r-- | src/engine/client/ec_inp.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/engine/client/ec_inp.c b/src/engine/client/ec_inp.c index 6aae34fc..4aea840a 100644 --- a/src/engine/client/ec_inp.c +++ b/src/engine/client/ec_inp.c @@ -16,26 +16,16 @@ static unsigned char input_state[2][1024] = {{0}, {0}}; static int input_current = 0; static int input_grabbed = 0; -static int input_use_grab = 0; static unsigned int last_release = 0; static unsigned int release_delta = -1; void inp_mouse_relative(int *x, int *y) { - static int last_x = 0, last_y = 0; - static int last_sens = 100.0f; int nx = 0, ny = 0; float sens = config.inp_mousesens/100.0f; - if(last_sens != config.inp_mousesens) - { - last_x = (last_x/(float)last_sens)*(float)config.inp_mousesens; - last_y = (last_y/(float)last_sens)*(float)config.inp_mousesens; - last_sens = config.inp_mousesens; - } - - if(input_use_grab) + if(config.inp_grab) SDL_GetRelativeMouseState(&nx, &ny); else { @@ -101,7 +91,7 @@ void inp_mouse_mode_absolute() { SDL_ShowCursor(1); input_grabbed = 0; - if(input_use_grab) + if(config.inp_grab) SDL_WM_GrabInput(SDL_GRAB_OFF); } @@ -109,7 +99,7 @@ void inp_mouse_mode_relative() { SDL_ShowCursor(0); input_grabbed = 1; - if(input_use_grab) + if(config.inp_grab) SDL_WM_GrabInput(SDL_GRAB_ON); } |