ref: 26cc14d67eb7a6c6e8d19d179333f205f98206a0
parent: 1fca5f75797af9c8c78d4cd022c41b22040de29a
author: qwx <qwx@sciops.net>
date: Mon Aug 22 17:39:26 EDT 2022
games/doom: add optional autorun
--- a/sys/src/games/doom/g_game.c
+++ b/sys/src/games/doom/g_game.c
@@ -153,6 +153,7 @@
int key_use;
int key_strafe;
int key_speed;
+int autorun;
int mousebfire;
int mousebstrafe;
@@ -254,7 +255,7 @@
strafe = gamekeydown[key_strafe] || mousebuttons[mousebstrafe]
|| joybuttons[joybstrafe];
- speed = gamekeydown[key_speed] || joybuttons[joybspeed];
+ speed = autorun || gamekeydown[key_speed] || joybuttons[joybspeed];
forward = side = 0;
--- a/sys/src/games/doom/m_misc.c
+++ b/sys/src/games/doom/m_misc.c
@@ -173,6 +173,7 @@
extern int viewwidth;
extern int viewheight;
+extern int autorun;
extern int mouseSensitivity;
extern int showMessages;
@@ -214,6 +215,7 @@
{"key_use",&key_use, ' '},
{"key_strafe",&key_strafe, KEY_RALT},
{"key_speed",&key_speed, KEY_RSHIFT},
+ {"autorun",&autorun, 0},
{"use_mouse",&usemouse, 1},
{"mouseb_fire",&mousebfire,0},