]> git.mxchange.org Git - flightgear.git/blob - Cockpit/hud.h
1425c74f97345c06f878df8690d4c7a42b3a22cb
[flightgear.git] / Cockpit / hud.h
1 /**************************************************************************
2  * hud.h -- hud defines and prototypes (initial draft)
3  *
4  * Written by Michele America, started September 1997.
5  *
6  * Copyright (C) 1997  Michele F. America  - nomimarketing@mail.telepac.pt
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  *
22  * $Id$
23  * (Log is kept at end of this file)
24  **************************************************************************/
25
26
27 #ifndef HUD_H
28 #define HUD_H
29
30
31 #include <Aircraft/aircraft.h>
32 #include <Flight/flight.h>
33 #include <Controls/controls.h>
34
35
36 /* Instrument types */
37 #define ARTIFICIAL_HORIZON      1
38 #define SCALE                           2
39 #define LADDER                          3
40 #define LABEL                           4
41
42 /* Scale constants */
43 #define HORIZONTAL                      1
44 #define TOP                                     2
45 #define BOTTOM                          3
46 #define VERTICAL                        4
47 #define LEFT                            5
48 #define RIGHT                           6
49 #define LIMIT                           7
50 #define NOLIMIT                         8
51
52 /* Label constants */
53 #define SMALL                           1
54 #define LARGE                           2
55 #define BLINK                           3
56 #define NOBLINK                         4
57 #define LEFT_JUST                       5
58 #define CENTER_JUST                     6
59 #define RIGHT_JUST                      7
60
61 /* Ladder constants */
62 #define NONE                            1
63 #define UPPER_LEFT                      2
64 #define UPPER_CENTER            3
65 #define UPPER_RIGHT                     4
66 #define CENTER_RIGHT            5
67 #define LOWER_RIGHT                     6
68 #define LOWER_CENTER            7
69 #define LOWER_LEFT                      8
70 #define CENTER_LEFT                     9
71 #define SOLID_LINES                     10
72 #define DASHED_LINES            11
73 #define DASHED_NEG_LINES        12
74
75 /* Ladder orientaion */
76 // #define HUD_VERTICAL        1
77 // #define HUD_HORIZONTAL               2
78 // #define HUD_FREEFLOAT                3
79
80 /* Ladder orientation modes */
81 // #define HUD_LEFT             1
82 // #define HUD_RIGHT            2
83 // #define HUD_TOP              1
84 // #define HUD_BOTTOM           2
85 // #define HUD_V_LEFT                   1
86 // #define HUD_V_RIGHT          2
87 // #define HUD_H_TOP            1
88 // #define HUD_H_BOTTOM         2
89
90
91 /* Ladder sub-types */
92 // #define HUD_LIM                              1
93 // #define HUD_NOLIM                    2
94 // #define HUD_CIRC                     3
95
96 // #define HUD_INSTR_LADDER     1
97 // #define HUD_INSTR_CLADDER    2
98 // #define HUD_INSTR_HORIZON    3
99 // #define HUD_INSTR_LABEL              4
100
101 struct HUD_scale {
102         int type;
103         int scr_pos;
104         int scr_min;
105         int scr_max;
106         int div_min;
107         int div_max;
108         int orientation;
109         int with_minimum;
110         int minimum_value;
111         int width_units;
112         double (*load_value)( void );
113 };
114
115 struct HUD_circular_scale {
116         int type;
117         int scr_pos;
118         int scr_min;
119         int scr_max;
120         int div_min;
121         int div_max;
122         int orientation;
123         int label_position;
124         int width_units;
125         double (*load_value)( void );
126 };
127
128 struct HUD_ladder {
129         int type;
130         int x_pos;
131         int y_pos;
132         int scr_width;
133         int scr_height;
134         int scr_hole;
135         int div_units;
136         int label_position;
137         int width_units;
138         double (*load_roll)( void );
139         double (*load_pitch)( void );
140 };
141
142 struct HUD_circular_ladder {
143         int scr_min;
144         int scr_max;
145         int div_min;
146         int div_max;
147         int orientation;
148         int label_position;
149         int width_units;
150         double (*load_value)( void );
151 };
152
153 #define HORIZON_FIXED   1
154 #define HORIZON_MOVING  2
155
156 struct HUD_horizon {
157         int type;
158         int x_pos;
159         int y_pos;
160         int scr_width;
161         int scr_hole;
162         double (*load_value)( void );
163 };
164
165 #define LABEL_COUNTER   1
166 #define LABEL_WARNING   2
167
168 struct HUD_label {
169         int type;
170         int x_pos;
171         int y_pos;
172         int size;
173         int blink;
174         int justify;
175         char *pre_str;
176         char *post_str;
177         char *format;
178         double (*load_value)( void );
179 };
180
181 union HUD_instr_data {
182         struct HUD_scale scale;
183         struct HUD_circular_scale circ_scale;
184         struct HUD_ladder ladder;
185         struct HUD_circular_ladder circ_ladder;
186         struct HUD_horizon horizon;
187         struct HUD_label label;
188 };
189
190 typedef struct HUD_instr *HIptr;
191
192 struct HUD_instr {
193         int type;
194         int sub_type;
195         int orientation;
196         union HUD_instr_data instr;
197         int color;
198         HIptr next;
199 };
200
201 struct HUD {
202         int code;
203         // struct HUD_instr *instruments;
204         HIptr instruments;
205         int status;
206 };
207
208 typedef struct HUD *Hptr;
209
210 Hptr fgHUDInit( struct fgAIRCRAFT cur_aircraft, int color );
211 Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, int hole_len, double (*load_value)( void ) );
212 Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, int div_min, int div_max, \
213                                         int orientation, int with_min, int min_value, int width_units, double (*load_value)( void ) );
214 Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int justify, \
215                                         char *pre_str, char *post_str, char *format, double (*load_value)( void ) );
216 Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_height, \
217                                         int hole_len, int div_units, int label_pos, int max_value, \
218                                         double (*load_roll)( void ), double (*load_pitch)( void ) );
219                                         
220                                         
221                                         
222 /* struct HUD *fgHUDAddLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \
223                                         int orientation, int max_value, double *(load_value);
224 struct HUD *fgHUDAddCircularLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \
225                                         int max_value, double *(load_value) );
226 struct HUD *fgHUDAddNumDisp( Hptr hud, int x_pos, int y_pos, int size, int blink, \
227                                         char *pre_str, char *post_str, double *(load_value) ); */
228 void fgUpdateHUD( Hptr hud );
229 void fgUpdateHUD2( struct HUD *hud );
230
231
232 #endif /* HUD_H */
233
234
235 /* $Log$
236 /* Revision 1.5  1998/01/19 19:27:01  curt
237 /* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
238 /* This should simplify things tremendously.
239 /*
240  * Revision 1.4  1998/01/19 18:40:21  curt
241  * Tons of little changes to clean up the code and to remove fatal errors
242  * when building with the c++ compiler.
243  *
244  * Revision 1.3  1997/12/30 16:36:41  curt
245  * Merged in Durk's changes ...
246  *
247  * Revision 1.2  1997/12/10 22:37:40  curt
248  * Prepended "fg" on the name of all global structures that didn't have it yet.
249  * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
250  *
251  * Revision 1.1  1997/08/29 18:03:22  curt
252  * Initial revision.
253  *
254  */