]> icculus.org git repositories - btb/d2x.git/blob - arch/sdl/joydefs.c
copied joydefs_config from linux/joydefs.c - controls menu now works
[btb/d2x.git] / arch / sdl / joydefs.c
1 /*
2  * $Source: /cvs/cvsroot/d2x/arch/sdl/joydefs.c,v $
3  * $Revision: 1.2 $
4  * $Author: bradleyb $
5  * $Date: 2001-11-14 03:29:39 $
6  *
7  * SDL joystick support
8  *
9  * $Log: not supported by cvs2svn $
10  * Revision 1.1  2001/10/24 09:25:05  bradleyb
11  * Moved input stuff to arch subdirs, as in d1x.
12  *
13  * Revision 1.1  2001/10/10 03:01:29  bradleyb
14  * Replacing win32 joystick (broken) with SDL joystick (stubs)
15  *
16  *
17  */
18
19 #ifdef HAVE_CONFIG_H
20 #include <conf.h>
21 #endif
22
23 #include "joydefs.h"
24 #include "newmenu.h"
25 #include "config.h"
26 #include "text.h"
27 #include "kconfig.h"
28
29 int joydefs_calibrate_flag = 0;
30
31 void joydefs_calibrate()
32 {
33 }
34
35 void joydef_menuset_1(int nitems, newmenu_item * items, int *last_key, int citem )
36 {
37 }
38
39 void joydefs_config()
40 {
41         newmenu_item m[13];
42         int i, i1=5, j, nitems=7;
43
44         m[0].type = NM_TYPE_RADIO; m[0].text = "KEYBOARD"; m[0].value = 0; m[0].group = 0;
45         m[1].type = NM_TYPE_RADIO; m[1].text = "JOYSTICK"; m[1].value = 0; m[1].group = 0;
46         m[2].type = NM_TYPE_RADIO; m[2].text = "MOUSE"; m[2].value = 0; m[2].group = 0;
47         m[3].type = NM_TYPE_TEXT; m[3].text="";
48         m[4].type = NM_TYPE_MENU; m[4].text="CUSTOMIZE ABOVE";
49         m[5].type = NM_TYPE_MENU; m[5].text="CUSTOMIZE KEYBOARD";
50         m[6].type = NM_TYPE_MENU; m[6].text="CUSTOMIZE D1X KEYS";
51
52         do {
53
54                 i = Config_control_type;
55                 if(i==CONTROL_MOUSE) i = 2;
56                 m[i].value=1;
57
58                 i1 = newmenu_do1( NULL, TXT_CONTROLS, nitems, m, joydef_menuset_1, i1 );
59
60                 for (j = 0; j <= 2; j++)
61                         if (m[j].value)
62                                 Config_control_type = j;
63                 i = Config_control_type;
64                 if (Config_control_type == 2)
65                         Config_control_type = CONTROL_MOUSE;
66
67                 switch(i1)      {
68                 case 4: 
69                         kconfig (i, m[i].text);
70                         break;
71                 case 5: 
72                         kconfig(0, "KEYBOARD"); 
73                         break;
74                 case 6:
75                         kconfig(3, "D1X KEYS");
76                         break;
77                 } 
78
79         } while(i1>-1);
80
81 }