diff options
author | qwx <qwx@sciops.net> | 2022-08-22 21:56:47 +0000 |
---|---|---|
committer | qwx <qwx@sciops.net> | 2022-08-22 21:56:47 +0000 |
commit | ec8d7cdf024949d73c5f887f23f060cd33c1df28 (patch) | |
tree | 95e94724d4be71bf48a29168626e6e8b766182df | |
parent | 26cc14d67eb7a6c6e8d19d179333f205f98206a0 (diff) |
games/doom: rename mouse use key for what it is and remove double click
one can still play with just the mouse via m_forward, there's no
longer any need for a button to move forward
-rw-r--r-- | sys/src/games/doom/g_game.c | 68 | ||||
-rw-r--r-- | sys/src/games/doom/m_misc.c | 4 |
2 files changed, 4 insertions, 68 deletions
diff --git a/sys/src/games/doom/g_game.c b/sys/src/games/doom/g_game.c index 5d0ef0e39..77a184046 100644 --- a/sys/src/games/doom/g_game.c +++ b/sys/src/games/doom/g_game.c @@ -157,7 +157,7 @@ int autorun; int mousebfire; int mousebstrafe; -int mousebforward; +int mousebuse; int m_forward; int joybfire; @@ -190,13 +190,6 @@ int mousex; int mousey; extern int usemouse; -int dclicktime; -int dclickstate; -int dclicks; -int dclicktime2; -int dclickstate2; -int dclicks2; - // joystick values are repeated int joyxmove; int joyymove; @@ -238,7 +231,6 @@ void G_BuildTiccmd (ticcmd_t* cmd) { int i; boolean strafe; - boolean bstrafe; int speed; int tspeed; int forward; @@ -332,11 +324,7 @@ void G_BuildTiccmd (ticcmd_t* cmd) cmd->buttons |= BT_ATTACK; if (gamekeydown[key_use] || joybuttons[joybuse] ) - { cmd->buttons |= BT_USE; - // clear double clicks if hit use button - dclicks = 0; - } // chainsaw overrides for (i=0 ; i<NUMWEAPONS-1 ; i++) @@ -348,60 +336,8 @@ void G_BuildTiccmd (ticcmd_t* cmd) } // mouse - if (mousebuttons[mousebforward]) - forward += forwardmove[speed]; - - // forward double click - if (mousebuttons[mousebforward] != dclickstate && dclicktime > 1 ) - { - dclickstate = mousebuttons[mousebforward]; - if (dclickstate) - dclicks++; - if (dclicks == 2) - { - cmd->buttons |= BT_USE; - dclicks = 0; - } - else - dclicktime = 0; - } - else - { - dclicktime += ticdup; - if (dclicktime > 20) - { - dclicks = 0; - dclickstate = 0; - } - } - - // strafe double click - bstrafe = - mousebuttons[mousebstrafe] - || joybuttons[joybstrafe]; - if (bstrafe != dclickstate2 && dclicktime2 > 1 ) - { - dclickstate2 = bstrafe; - if (dclickstate2) - dclicks2++; - if (dclicks2 == 2) - { + if (mousebuttons[mousebuse]) cmd->buttons |= BT_USE; - dclicks2 = 0; - } - else - dclicktime2 = 0; - } - else - { - dclicktime2 += ticdup; - if (dclicktime2 > 20) - { - dclicks2 = 0; - dclickstate2 = 0; - } - } - if (m_forward) forward += mousey; if (strafe) diff --git a/sys/src/games/doom/m_misc.c b/sys/src/games/doom/m_misc.c index a19d954c0..876811a9f 100644 --- a/sys/src/games/doom/m_misc.c +++ b/sys/src/games/doom/m_misc.c @@ -162,7 +162,7 @@ extern int key_speed; extern int mousebfire; extern int mousebstrafe; -extern int mousebforward; +extern int mousebuse; extern int m_forward; extern int joybfire; @@ -220,7 +220,7 @@ default_t defaults[] = {"use_mouse",&usemouse, 1}, {"mouseb_fire",&mousebfire,0}, {"mouseb_strafe",&mousebstrafe,1}, - {"mouseb_forward",&mousebforward,2}, + {"mouseb_use",&mousebuse,2}, {"m_forward",&m_forward, 1}, {"use_joystick",&usejoystick, 0}, |