]> icculus.org git repositories - btb/d2x.git/blob - main/kconfig.h
move old per-file change logs into new file ChangeLog-old
[btb/d2x.git] / main / kconfig.h
1 /* $Id: kconfig.h,v 1.5 2004-08-28 23:17:45 schaffner Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 /*
16  *
17  * Prototypes for reading controls
18  *
19  */
20
21
22 #ifndef _KCONFIG_H
23 #define _KCONFIG_H
24
25 #include "config.h"
26 #include "gamestat.h"
27
28 typedef struct _control_info {
29         fix pitch_time;
30         fix vertical_thrust_time;
31         fix heading_time;
32         fix sideways_thrust_time;
33         fix bank_time;
34         fix forward_thrust_time;
35
36         ubyte rear_view_down_count;
37         ubyte rear_view_down_state;
38
39         ubyte fire_primary_down_count;
40         ubyte fire_primary_state;
41         ubyte fire_secondary_state;
42         ubyte fire_secondary_down_count;
43         ubyte fire_flare_down_count;
44
45         ubyte drop_bomb_down_count;
46
47         ubyte automap_down_count;
48         ubyte automap_state;
49
50         //vms_angvec heading;
51         //char oem_message[64];
52
53         ubyte afterburner_state;
54         ubyte cycle_primary_count;
55         ubyte cycle_secondary_count;
56         ubyte headlight_count;
57 } control_info;
58
59 typedef struct ext_control_info {
60         fix pitch_time;
61         fix vertical_thrust_time;
62         fix heading_time;
63         fix sideways_thrust_time;
64         fix bank_time;
65         fix forward_thrust_time;
66
67         ubyte rear_view_down_count;
68         ubyte rear_view_down_state;
69
70         ubyte fire_primary_down_count;
71         ubyte fire_primary_state;
72         ubyte fire_secondary_state;
73         ubyte fire_secondary_down_count;
74         ubyte fire_flare_down_count;
75
76         ubyte drop_bomb_down_count;
77
78         ubyte automap_down_count;
79         ubyte automap_state;
80
81         //vms_angvec heading;               // for version >=1.0
82         //char oem_message[64];         // for version >=1.0
83
84         //vms_vector ship_pos           // for version >=2.0
85         //vms_matrix ship_orient        // for version >=2.0
86
87         //ubyte cycle_primary_count     // for version >=3.0
88         //ubyte cycle_secondary_count   // for version >=3.0
89         //ubyte afterburner_state       // for version >=3.0
90         //ubyte headlight_count         // for version >=3.0
91
92         // everything below this line is for version >=4.0
93
94         //ubyte headlight_state
95
96         //int primary_weapon_flags
97         //int secondary_weapon_flags
98         //ubyte Primary_weapon_selected
99         //ubyte Secondary_weapon_selected
100
101         //vms_vector force_vector
102         //vms_matrix force_matrix
103         //int joltinfo[3]
104         //int x_vibrate_info[2]
105         //int y_vibrate_info[2]
106
107         //int x_vibrate_clear
108         //int y_vibrate_clear
109
110         //ubyte game_status;
111
112         //ubyte keyboard[128];          // scan code array, not ascii
113         //ubyte current_guidebot_command;
114
115         //ubyte Reactor_blown
116
117 } ext_control_info;
118
119 typedef struct advanced_ext_control_info {
120         fix pitch_time;
121         fix vertical_thrust_time;
122         fix heading_time;
123         fix sideways_thrust_time;
124         fix bank_time;
125         fix forward_thrust_time;
126
127         ubyte rear_view_down_count;
128         ubyte rear_view_down_state;
129
130         ubyte fire_primary_down_count;
131         ubyte fire_primary_state;
132         ubyte fire_secondary_state;
133         ubyte fire_secondary_down_count;
134         ubyte fire_flare_down_count;
135
136         ubyte drop_bomb_down_count;
137
138         ubyte automap_down_count;
139         ubyte automap_state;
140
141         // everything below this line is for version >=1.0
142
143         vms_angvec heading;
144         char oem_message[64];
145
146         // everything below this line is for version >=2.0
147
148         vms_vector ship_pos;
149         vms_matrix ship_orient;
150
151         // everything below this line is for version >=3.0
152
153         ubyte cycle_primary_count;
154         ubyte cycle_secondary_count;
155         ubyte afterburner_state;
156         ubyte headlight_count;
157
158         // everything below this line is for version >=4.0
159
160         int primary_weapon_flags;
161         int secondary_weapon_flags;
162         ubyte current_primary_weapon;
163         ubyte current_secondary_weapon;
164
165         vms_vector force_vector;
166         vms_matrix force_matrix;
167         int joltinfo[3];
168         int x_vibrate_info[2];
169         int y_vibrate_info[2];
170
171         int x_vibrate_clear;
172         int y_vibrate_clear;
173
174         ubyte game_status;
175
176         ubyte headlight_state;
177         ubyte current_guidebot_command;
178
179         ubyte keyboard[128];    // scan code array, not ascii
180
181         ubyte Reactor_blown;
182
183 } advanced_ext_control_info;
184
185 extern ubyte ExtGameStatus;
186 extern control_info Controls;
187 extern void controls_read_all();
188 extern void kconfig(int n, char *title);
189
190 // added on 2/4/99 by Victor Rachels to add new keys menu
191 #define NUM_D2X_CONTROLS    20
192 #define MAX_D2X_CONTROLS    40
193
194 extern ubyte kconfig_d2x_settings[MAX_D2X_CONTROLS];
195 extern ubyte default_kconfig_d2x_settings[MAX_D2X_CONTROLS];
196 // end this section addition - VR
197
198 #define NUM_KEY_CONTROLS    57
199 #define NUM_OTHER_CONTROLS  31
200 #define MAX_CONTROLS        60          // there are actually 48, so this leaves room for more
201
202 extern ubyte kconfig_settings[CONTROL_MAX_TYPES][MAX_CONTROLS];
203 extern ubyte default_kconfig_settings[CONTROL_MAX_TYPES][MAX_CONTROLS];
204
205 extern char *control_text[CONTROL_MAX_TYPES];
206
207 extern void kc_set_controls();
208
209 // Tries to use vfx1 head tracking.
210 void kconfig_sense_init();
211
212 //set the cruise speed to zero
213 extern void reset_cruise(void);
214
215 extern int kconfig_is_axes_used(int axis);
216
217 extern void kconfig_init_external_controls(int intno, int address);
218
219 // the following methods added by WraithX, 4/17/00
220 extern int isJoyRotationKey(int test_key);       //tells if "test_key" is setup for rotation on the joy
221 extern int isMouseRotationKey(int test_key);     //tells if "test_key" is setup for rotation on the mouse
222 extern int isKeyboardRotationKey(int test_key);  //tells if "test_key" is setup for rotation on the keyboard
223 // end addition - WraithX
224
225 #endif /* _KCONFIG_H */