From e3de3ba5162f7ddd5005911124d4333e140fd984 Mon Sep 17 00:00:00 2001 From: navewindre Date: Thu, 27 Nov 2025 17:19:02 +0100 Subject: bunch o stuff --- src/util/input.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/util/input.cpp') diff --git a/src/util/input.cpp b/src/util/input.cpp index 225b696..284ebfe 100644 --- a/src/util/input.cpp +++ b/src/util/input.cpp @@ -27,8 +27,8 @@ void input_on_event( SDL_Event* e ) { case SDL_MOUSEMOTION: { input.mouse.pos.x = (F32)e->motion.x; input.mouse.pos.y = (F32)e->motion.y; - input.mouse.pos_delta.x += (F32)e->motion.xrel; - input.mouse.pos_delta.y += (F32)e->motion.yrel; + input.mouse.pos_delta.x += (F32)e->motion.xrel * input.mpitch; + input.mouse.pos_delta.y += (F32)e->motion.yrel * input.myaw; } break; case SDL_KEYDOWN: { input.keys[e->key.keysym.sym & 0xff] = 1; @@ -79,8 +79,12 @@ void input_frame_end() { input.mouse.wheel = 0; } +U8 input_is_key_down( U32 key ) { + return input.keys[key]; +} + void input_capture_mouse( bool capture ) { input_reset_mouse_accumulator(); - input.mouse_captured = capture; + input.mouselock = capture; SDL_SetRelativeMouseMode( capture ? SDL_TRUE : SDL_FALSE ); } -- cgit v1.2.3