From 10cbe2c82b5e375a558275265977f2a6f2542243 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 19 Aug 2017 22:54:30 +0100 Subject: [PATCH] Turns out the issue was with fullscreen! All I have to do is factor in the resolution/real window size ratio apparently (which was already done before) Also changed movemousex/y to INT32 --- src/sdl/i_video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index d1ec5d44..81acb516 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -606,7 +606,7 @@ static void Impl_HandleKeyboardEvent(SDL_KeyboardEvent evt, Uint32 type) if (event.data1) D_PostEvent(&event); } -static int mousemovex, mousemovey; +static INT32 mousemovex, mousemovey; static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt) { @@ -629,8 +629,8 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt) //event.data3 = -evt.yrel; if (SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window) { - mousemovex += evt.xrel; - mousemovey += -evt.yrel; + mousemovex += (INT32)lround( evt.xrel * ((float)wwidth / (float)realwidth)); + mousemovey += (INT32)lround(-evt.yrel * ((float)wheight / (float)realheight)); SDL_SetWindowGrab(window, SDL_TRUE); } return;