]> icculus.org git repositories - btb/d2x.git/blob - main/controls.h
start refactoring Controls stuff more logically, now that it no longer has anything...
[btb/d2x.git] / main / controls.h
1 /*
2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14 /*
15  *
16  * Header for controls.c
17  *
18  */
19
20
21 #ifndef _CONTROLS_H
22 #define _CONTROLS_H
23
24
25 typedef enum {
26         slide_on,
27         bank_on,
28         rear_view,
29         fire_primary,
30         fire_secondary,
31         fire_flare,
32         drop_bomb,
33         automap,
34         afterburner,
35         cycle_primary,
36         cycle_secondary,
37         headlight,
38         CONTROL_NUM_BUTTONS
39 } control_button;
40
41
42 typedef struct _control_info {
43         fix pitch_time;
44         fix vertical_thrust_time;
45         fix heading_time;
46         fix sideways_thrust_time;
47         fix bank_time;
48         fix forward_thrust_time;
49
50         fix time_held_down[CONTROL_NUM_BUTTONS];
51         fix time_went_down[CONTROL_NUM_BUTTONS];
52         ubyte count[CONTROL_NUM_BUTTONS];
53         ubyte state[CONTROL_NUM_BUTTONS];
54 } control_info;
55
56
57 extern control_info Controls;
58 extern void controls_read_all();
59 extern void controls_init(void);
60
61 //set the cruise speed to zero
62 extern void reset_cruise(void);
63
64 void read_flying_controls( object * obj );
65
66 extern ubyte Controls_stopped;
67 extern ubyte Controls_always_move;
68
69 extern fix Afterburner_charge;
70
71 #endif