diff options
author | Sigrid Solveig Haflínudóttir <sigrid@ftrv.se> | 2022-08-19 16:48:02 +0000 |
---|---|---|
committer | Sigrid Solveig Haflínudóttir <sigrid@ftrv.se> | 2022-08-19 16:48:02 +0000 |
commit | 418131d326ab033789a25c0c5cddd5aa776e8f27 (patch) | |
tree | e48a05a0448ce7096a8d3941912ef3f938b85a8e /sys/src/games | |
parent | 21ae833386940c7414ecaaf1012c0ec87f0088e5 (diff) |
games/doom: add "m_forward" cvar to disable vertical motion move; actually implement use_mouse
Diffstat (limited to 'sys/src/games')
-rw-r--r-- | sys/src/games/doom/g_game.c | 7 | ||||
-rw-r--r-- | sys/src/games/doom/i_video.c | 3 | ||||
-rw-r--r-- | sys/src/games/doom/m_misc.c | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/sys/src/games/doom/g_game.c b/sys/src/games/doom/g_game.c index 6741498c0..0c08aa354 100644 --- a/sys/src/games/doom/g_game.c +++ b/sys/src/games/doom/g_game.c @@ -157,6 +157,7 @@ int key_speed; int mousebfire; int mousebstrafe; int mousebforward; +int m_forward; int joybfire; int joybstrafe; @@ -186,6 +187,7 @@ boolean* mousebuttons = &mousearray[1]; // allow [-1] // mouse values are used once int mousex; int mousey; +extern int usemouse; int dclicktime; int dclickstate; @@ -399,7 +401,8 @@ void G_BuildTiccmd (ticcmd_t* cmd) } } - forward += mousey; + if (m_forward) + forward += mousey; if (strafe) side += mousex*2; else @@ -563,6 +566,8 @@ boolean G_Responder (event_t* ev) return false; // always let key up events filter down case ev_mouse: + if (!usemouse) + return true; mousebuttons[0] = ev->data1 & 1; mousebuttons[1] = ev->data1 & 2; mousebuttons[2] = ev->data1 & 4; diff --git a/sys/src/games/doom/i_video.c b/sys/src/games/doom/i_video.c index 098f58b2c..0d1cddea9 100644 --- a/sys/src/games/doom/i_video.c +++ b/sys/src/games/doom/i_video.c @@ -11,6 +11,7 @@ static int resized; static int mouseactive; +extern int usemouse; static Rectangle grabout; static Point center; @@ -160,7 +161,7 @@ void I_MouseEnable(int on) static char nocurs[2*4+2*2*16]; static int fd = -1; - if(mouseactive == on) + if(mouseactive == on || !usemouse) return; if(mouseactive = on){ if((fd = open("/dev/cursor", ORDWR|OCEXEC)) < 0) diff --git a/sys/src/games/doom/m_misc.c b/sys/src/games/doom/m_misc.c index 3d9988d46..840934ed7 100644 --- a/sys/src/games/doom/m_misc.c +++ b/sys/src/games/doom/m_misc.c @@ -163,6 +163,7 @@ extern int key_speed; extern int mousebfire; extern int mousebstrafe; extern int mousebforward; +extern int m_forward; extern int joybfire; extern int joybstrafe; @@ -218,6 +219,7 @@ default_t defaults[] = {"mouseb_fire",&mousebfire,0}, {"mouseb_strafe",&mousebstrafe,1}, {"mouseb_forward",&mousebforward,2}, + {"m_forward",&m_forward, 1}, {"use_joystick",&usejoystick, 0}, {"joyb_fire",&joybfire,0}, |