diff options
author | qwx <qwx@sciops.net> | 2022-08-22 22:13:57 +0000 |
---|---|---|
committer | qwx <qwx@sciops.net> | 2022-08-22 22:13:57 +0000 |
commit | 02ec9f06e426c6b19d4d9368dbe959845aef6928 (patch) | |
tree | 9f0ea99ef81d93b1457a454d98a756647c9a498f /sys/src/games | |
parent | 846debd082dcb0ac7b0297c6d68a0aa382f95de5 (diff) |
games/doom: fix glitchy mouse movement
use all mouse deltas during a tic instead of just the last one, to
prevent extremely annoying stutters and jumps in mouse movement;
adjust filtering/sensitivity, without additional knobs
Diffstat (limited to 'sys/src/games')
-rw-r--r-- | sys/src/games/doom/g_game.c | 4 | ||||
-rw-r--r-- | sys/src/games/doom/i_video.c | 4 | ||||
-rw-r--r-- | sys/src/games/doom/m_menu.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/src/games/doom/g_game.c b/sys/src/games/doom/g_game.c index 77a184046..0b0112a46 100644 --- a/sys/src/games/doom/g_game.c +++ b/sys/src/games/doom/g_game.c @@ -508,8 +508,8 @@ boolean G_Responder (event_t* ev) mousebuttons[0] = ev->data1 & 1; mousebuttons[1] = ev->data1 & 2; mousebuttons[2] = ev->data1 & 4; - mousex = ev->data2*(mouseSensitivity+5)/10; - mousey = ev->data3*(mouseSensitivity+5)/10; + mousex += ev->data2*0.5*(mouseSensitivity+1); + mousey += ev->data3*0.5*(mouseSensitivity+1); return true; // eat events case ev_joystick: diff --git a/sys/src/games/doom/i_video.c b/sys/src/games/doom/i_video.c index 752686086..e2f6d7226 100644 --- a/sys/src/games/doom/i_video.c +++ b/sys/src/games/doom/i_video.c @@ -395,8 +395,8 @@ mouseproc(void) e.type = ev_mouse; e.data1 = m.buttons; - e.data2 = 10*(m.xy.x - om.xy.x); - e.data3 = 10*(om.xy.y - m.xy.y); + e.data2 = m.xy.x - om.xy.x; + e.data3 = om.xy.y - m.xy.y; D_PostEvent(&e); om = m; diff --git a/sys/src/games/doom/m_menu.c b/sys/src/games/doom/m_menu.c index 4215d4d92..b3828189f 100644 --- a/sys/src/games/doom/m_menu.c +++ b/sys/src/games/doom/m_menu.c @@ -945,7 +945,7 @@ void M_DrawOptions(void) W_CacheLumpName(msgNames[showMessages],PU_CACHE)); M_DrawThermo(OptionsDef.x,OptionsDef.y+LINEHEIGHT*(mousesens+1), - 10,mouseSensitivity); + 9,mouseSensitivity); M_DrawThermo(OptionsDef.x,OptionsDef.y+LINEHEIGHT*(scrnsize+1), 9,screenSize); @@ -1099,7 +1099,7 @@ void M_ChangeSensitivity(int choice) mouseSensitivity--; break; case 1: - if (mouseSensitivity < 9) + if (mouseSensitivity < 8) mouseSensitivity++; break; } |