From e32215d28ef9e0ed883c5e78e43101c9f0958570 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 9 Jun 2009 20:22:12 +0000 Subject: Make Heretic weapon keys reconfigurable. Subversion-branch: /branches/raven-branch Subversion-revision: 1584 --- src/heretic/d_main.c | 1 + src/heretic/g_game.c | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c index 2026e3c0..cca440ce 100644 --- a/src/heretic/d_main.c +++ b/src/heretic/d_main.c @@ -743,6 +743,7 @@ void D_BindVariables(void) M_BindBaseControls(); M_BindHereticControls(); + M_BindWeaponControls(); M_BindMenuControls(); M_BindMapControls(); diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c index 22c17f13..a256b63b 100644 --- a/src/heretic/g_game.c +++ b/src/heretic/g_game.c @@ -147,6 +147,17 @@ fixed_t forwardmove[2] = { 0x19, 0x32 }; fixed_t sidemove[2] = { 0x18, 0x28 }; fixed_t angleturn[3] = { 640, 1280, 320 }; // + slow turn +static int *weapon_keys[] = +{ + &key_weapon1, + &key_weapon2, + &key_weapon3, + &key_weapon4, + &key_weapon5, + &key_weapon6, + &key_weapon7 +}; + #define SLOWTURNTICS 6 #define NUMKEYS 256 @@ -393,15 +404,18 @@ void G_BuildTiccmd(ticcmd_t * cmd) dclicks = 0; // clear double clicks if hit use button } - for (i = 0; i < NUMWEAPONS - 2; i++) + for (i=0; ibuttons |= BT_CHANGE; - cmd->buttons |= i << BT_WEAPONSHIFT; - break; + cmd->buttons |= BT_CHANGE; + cmd->buttons |= i<