]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
change joystick key numbers to start at 768 instead of 1024 (this gives 512 keys...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 10 Feb 2004 21:09:57 +0000 (21:09 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 10 Feb 2004 21:09:57 +0000 (21:09 +0000)
enlarge various key arrays to hold 1024 keys

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3888 d7cf8633-e32d-0410-b094-e92efae38249

keys.c
keys.h

diff --git a/keys.c b/keys.c
index 4d5f4fb392f1cf31f3da789e3114430f0e2d05fc..00b8826fc74d9dc8d51c0e6edcf04ad923d95816 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -50,13 +50,13 @@ int                 key_consoleactive;
 static int     key_count;                                      // incremented every key event
 static int     key_bmap, key_bmap2;
 
-char                           *keybindings[8][256];
-static qboolean                consolekeys[256];       // if true, can't be rebound while in
+char                           *keybindings[8][1024];
+static qboolean                consolekeys[1024];      // if true, can't be rebound while in
                                                                                // console
-static qboolean                menubound[256];         // if true, can't be rebound while in
+static qboolean                menubound[1024];                // if true, can't be rebound while in
                                                                                // menu
-static unsigned int    key_repeats[256];       // if > 1, it is autorepeating
-static qboolean                keydown[256];
+static unsigned int    key_repeats[1024];      // if > 1, it is autorepeating
+static qboolean                keydown[1024];
 
 typedef struct {
        const char      *name;
@@ -734,7 +734,7 @@ Key_Unbindall_f (void)
        int         i, j;
 
        for (j = 0; j < 8; j++)
-               for (i = 0; i < 256; i++)
+               for (i = 0; i < sizeof(keybindings[0])/sizeof(keybindings[0][0]); i++)
                        if (keybindings[j][i])
                                Key_SetBinding (i, j, "");
 }
@@ -786,12 +786,12 @@ Key_WriteBindings (qfile_t *f)
 {
        int         i, j;
 
-       for (i = 0; i < 256; i++)
+       for (i = 0; i < sizeof(keybindings[0])/sizeof(keybindings[0][0]); i++)
                if (keybindings[0][i])
                        FS_Printf (f, "bind %s \"%s\"\n",
                                        Key_KeynumToString (i), keybindings[0][i]);
        for (j = 1; j < 8; j++)
-               for (i = 0; i < 256; i++)
+               for (i = 0; i < sizeof(keybindings[0])/sizeof(keybindings[0][0]); i++)
                        if (keybindings[j][i])
                                FS_Printf (f, "in_bind %d %s \"%s\"\n",
                                                j, Key_KeynumToString (i), keybindings[j][i]);
@@ -1016,7 +1016,7 @@ Key_ClearStates (void)
 {
        int i;
 
-       for (i = 0;i < 256;i++)
+       for (i = 0; i < sizeof(keydown)/sizeof(keydown[0]); i++)
        {
                keydown[i] = false;
                key_repeats[i] = 0;
diff --git a/keys.h b/keys.h
index 0cf98f4799b67f0a59595ff8ac4c085d030dcf68..a9a852e12e3598710c47344fdd7cfe6050962137 100644 (file)
--- a/keys.h
+++ b/keys.h
@@ -127,7 +127,7 @@ extern enum {
 //
 // joystick buttons
 //
-       K_JOY1 = 1024,
+       K_JOY1 = 768,
        K_JOY2,
        K_JOY3,
        K_JOY4,
@@ -173,7 +173,7 @@ extern enum {
 
 typedef enum { key_game, key_message, key_menu } keydest_t;
 
-extern char *keybindings[8][256];
+extern char *keybindings[8][1024];
 extern char key_lines[32][256];
 extern int key_linepos;
 extern int edit_line;