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
61 /* Ladder constants */
64 #define UPPER_CENTER 3
66 #define CENTER_RIGHT 5
68 #define LOWER_CENTER 7
71 #define SOLID_LINES 10
72 #define DASHED_LINES 11
73 #define DASHED_NEG_LINES 12
75 /* Ladder orientaion */
76 // #define HUD_VERTICAL 1
77 // #define HUD_HORIZONTAL 2
78 // #define HUD_FREEFLOAT 3
80 /* Ladder orientation modes */
82 // #define HUD_RIGHT 2
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
91 /* Ladder sub-types */
93 // #define HUD_NOLIM 2
96 // #define HUD_INSTR_LADDER 1
97 // #define HUD_INSTR_CLADDER 2
98 // #define HUD_INSTR_HORIZON 3
99 // #define HUD_INSTR_LABEL 4
112 double (*load_value)( void );
115 struct HUD_circular_scale {
125 double (*load_value)( void );
138 double (*load_roll)( void );
139 double (*load_pitch)( void );
142 struct HUD_circular_ladder {
150 double (*load_value)( void );
153 #define HORIZON_FIXED 1
154 #define HORIZON_MOVING 2
162 double (*load_value)( void );
165 #define LABEL_COUNTER 1
166 #define LABEL_WARNING 2
178 double (*load_value)( void );
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;
190 typedef struct HUD_instr *HIptr;
196 union HUD_instr_data instr;
203 // struct HUD_instr *instruments;
208 typedef struct HUD *Hptr;
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 ) );
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 );
236 /* Revision 1.4 1998/01/19 18:40:21 curt
237 /* Tons of little changes to clean up the code and to remove fatal errors
238 /* when building with the c++ compiler.
240 * Revision 1.3 1997/12/30 16:36:41 curt
241 * Merged in Durk's changes ...
243 * Revision 1.2 1997/12/10 22:37:40 curt
244 * Prepended "fg" on the name of all global structures that didn't have it yet.
245 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
247 * Revision 1.1 1997/08/29 18:03:22 curt