1 /**************************************************************************
2 * hud.h -- hud defines and prototypes (initial draft)
4 * Written by Michele America, started September 1997.
6 * Copyright (C) 1997 Michele F. America - nomimarketing@mail.telepac.pt
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.
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.
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.
23 * (Log is kept at end of this file)
24 **************************************************************************/
31 #include <Aircraft/aircraft.h>
32 #include <Flight/flight.h>
33 #include <Controls/controls.h>
36 /* Instrument types */
37 #define ARTIFICIAL_HORIZON 1
41 #define CONTROL_SURFACES 5
62 /* Ladder constants */
65 #define UPPER_CENTER 3
67 #define CENTER_RIGHT 5
69 #define LOWER_CENTER 7
72 #define SOLID_LINES 10
73 #define DASHED_LINES 11
74 #define DASHED_NEG_LINES 12
76 /* Ladder orientaion */
77 // #define HUD_VERTICAL 1
78 // #define HUD_HORIZONTAL 2
79 // #define HUD_FREEFLOAT 3
81 /* Ladder orientation modes */
83 // #define HUD_RIGHT 2
85 // #define HUD_BOTTOM 2
86 // #define HUD_V_LEFT 1
87 // #define HUD_V_RIGHT 2
88 // #define HUD_H_TOP 1
89 // #define HUD_H_BOTTOM 2
92 /* Ladder sub-types */
94 // #define HUD_NOLIM 2
97 // #define HUD_INSTR_LADDER 1
98 // #define HUD_INSTR_CLADDER 2
99 // #define HUD_INSTR_HORIZON 3
100 // #define HUD_INSTR_LABEL 4
113 double (*load_value)( void );
116 struct HUD_circular_scale {
126 double (*load_value)( void );
139 double (*load_roll)( void );
140 double (*load_pitch)( void );
143 struct HUD_circular_ladder {
151 double (*load_value)( void );
154 #define HORIZON_FIXED 1
155 #define HORIZON_MOVING 2
163 double (*load_value)( void );
166 struct HUD_control_surfaces {
170 double (*load_value)();
173 #define LABEL_COUNTER 1
174 #define LABEL_WARNING 2
186 double (*load_value)( void );
189 union HUD_instr_data {
190 struct HUD_scale scale;
191 struct HUD_circular_scale circ_scale;
192 struct HUD_ladder ladder;
193 struct HUD_circular_ladder circ_ladder;
194 struct HUD_horizon horizon;
195 struct HUD_label label;
196 struct HUD_control_surfaces control_surfaces;
199 typedef struct HUD_instr *HIptr;
205 union HUD_instr_data instr;
212 // struct HUD_instr *instruments;
217 typedef struct HUD *Hptr;
219 Hptr fgHUDInit( struct fgAIRCRAFT cur_aircraft, int color );
220 Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, int hole_len, double (*load_value)( void ) );
221 Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, int div_min, int div_max, \
222 int orientation, int with_min, int min_value, int width_units, double (*load_value)( void ) );
223 Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int justify, \
224 char *pre_str, char *post_str, char *format, double (*load_value)( void ) );
225 Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_height, \
226 int hole_len, int div_units, int label_pos, int max_value, \
227 double (*load_roll)( void ), double (*load_pitch)( void ) );
228 Hptr fgHUDAddControlSurfaces( Hptr hud, int x_pos, int y_pos, double (*get_heading)() );
231 /* struct HUD *fgHUDAddLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \
232 int orientation, int max_value, double *(load_value);
233 struct HUD *fgHUDAddCircularLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \
234 int max_value, double *(load_value) );
235 struct HUD *fgHUDAddNumDisp( Hptr hud, int x_pos, int y_pos, int size, int blink, \
236 char *pre_str, char *post_str, double *(load_value) ); */
237 void fgUpdateHUD( Hptr hud );
238 void fgUpdateHUD2( struct HUD *hud );
245 /* Revision 1.7 1998/02/03 23:20:15 curt
246 /* Lots of little tweaks to fix various consistency problems discovered by
247 /* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
248 /* passed arguments along to the real printf(). Also incorporated HUD changes
249 /* by Michele America.
251 * Revision 1.6 1998/01/22 02:59:30 curt
252 * Changed #ifdef FILE_H to #ifdef _FILE_H
254 * Revision 1.5 1998/01/19 19:27:01 curt
255 * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
256 * This should simplify things tremendously.
258 * Revision 1.4 1998/01/19 18:40:21 curt
259 * Tons of little changes to clean up the code and to remove fatal errors
260 * when building with the c++ compiler.
262 * Revision 1.3 1997/12/30 16:36:41 curt
263 * Merged in Durk's changes ...
265 * Revision 1.2 1997/12/10 22:37:40 curt
266 * Prepended "fg" on the name of all global structures that didn't have it yet.
267 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
269 * Revision 1.1 1997/08/29 18:03:22 curt