From 18a8d8a3b2ab7eeade733bd587531b4dac830a29 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 28 Sep 2008 17:16:51 +0000 Subject: Expand number of joystick buttons supported by Heretic to the number supported by Chocolate Doom. Subversion-branch: /branches/raven-branch Subversion-revision: 1304 --- src/heretic/g_game.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c index 364d25ea..54218087 100644 --- a/src/heretic/g_game.c +++ b/src/heretic/g_game.c @@ -164,7 +164,7 @@ int dclicktime2, dclickstate2, dclicks2; #define MAX_JOY_BUTTONS 20 int joyxmove, joyymove; // joystick values are repeated -boolean joyarray[5]; +boolean joyarray[MAX_JOY_BUTTONS + 1]; boolean *joybuttons = &joyarray[1]; // allow [-1] int savegameslot; @@ -774,6 +774,15 @@ void G_DoLoadLevel(void) memset(joybuttons, 0, sizeof(joybuttons)); } +static void SetJoyButtons(unsigned int buttons_mask) +{ + int i; + + for (i=0; idata1 & 1; - joybuttons[1] = ev->data1 & 2; - joybuttons[2] = ev->data1 & 4; - joybuttons[3] = ev->data1 & 8; + SetJoyButtons(ev->data1); joyxmove = ev->data2; joyymove = ev->data3; return (true); // eat events -- cgit v1.2.3