diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-10-06 17:01:06 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-10-06 17:01:06 +0000 |
| commit | f9162202b0ceb25fae4a0848a4a99dbe1158bd22 (patch) | |
| tree | 1e6350bb0608f2a599e0a303fcf5b18aab691102 /src/engine/client/inp.c | |
| parent | 449146a2753deb657e0ef641bd6065467ef75322 (diff) | |
| download | zcatch-f9162202b0ceb25fae4a0848a4a99dbe1158bd22.tar.gz zcatch-f9162202b0ceb25fae4a0848a4a99dbe1158bd22.zip | |
fixed some C errors
Diffstat (limited to 'src/engine/client/inp.c')
| -rw-r--r-- | src/engine/client/inp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/engine/client/inp.c b/src/engine/client/inp.c index 55cebbfe..6b0ba829 100644 --- a/src/engine/client/inp.c +++ b/src/engine/client/inp.c @@ -3,7 +3,7 @@ #include <engine/system.h> #include <engine/interface.h> -static int keyboard_state[2][1024]; // TODO: fix this!! +static int keyboard_state[2][1024]; /* TODO: fix this!! */ static int keyboard_current = 0; static int keyboard_first = 1; @@ -66,7 +66,6 @@ void inp_mouse_mode_relative() glfwDisable(GLFW_MOUSE_CURSOR); } -//int inp_mouse_scroll() { return input::mouse_scroll(); } int inp_key_pressed(int key) { return keyboard_state[keyboard_current][key]; } int inp_key_was_pressed(int key) { return keyboard_state[keyboard_current^1][key]; } int inp_key_down(int key) { return inp_key_pressed(key)&&!inp_key_was_pressed(key); } @@ -74,15 +73,16 @@ int inp_button_pressed(int button) { return keyboard_state[keyboard_current][but void inp_update() { + int i, v; + if(keyboard_first) { - // make sure to reset + /* make sure to reset */ keyboard_first = 0; inp_update(); } keyboard_current = keyboard_current^1; - int i, v; for(i = 0; i < KEY_LAST; i++) { if (i >= KEY_MOUSE_FIRST) @@ -92,7 +92,7 @@ void inp_update() keyboard_state[keyboard_current][i] = v; } - // handle mouse wheel + /* handle mouse wheel */ i = glfwGetMouseWheel(); keyboard_state[keyboard_current][KEY_MOUSE_WHEEL_UP] = 0; keyboard_state[keyboard_current][KEY_MOUSE_WHEEL_DOWN] = 0; |