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
101 // The following structs will become classes with a derivation from
102 // an ABC instrument_pack. Eventually the instruments may well become
103 // dll's. This would open the instrumentation issue to all commers.
107 // Initialization(); // For dynamic scenario settups?
108 // Update(); // Follow the data changes.
109 // Repaint(); // Respond to uncover/panel repaints.
110 // Break(); // Show a frown.
111 // Fix(); // Return to normal appearance and function.
112 // Night_Day(); // Illumination changes appearance/bitmaps.
128 double (*load_value)( void );
129 }HUD_scale, *pHUDscale;
141 double (*load_value)( void );
142 }HUD_circular_scale, *pHUD_circscale;
154 double (*load_roll)( void );
155 double (*load_pitch)( void );
156 }HUD_ladder, *pHUDladder;
166 double (*load_value)( void );
167 } HUD_circular_ladder, *pHUDcircladder;
169 #define HORIZON_FIXED 1
170 #define HORIZON_MOVING 2
178 double (*load_value)( void );
179 } HUD_horizon, *pHUDhorizon;
185 double (*load_value)();
186 } HUD_control_surfaces, *pHUDControlSurface;
187 #define LABEL_COUNTER 1
188 #define LABEL_WARNING 2
200 double (*load_value)( void ); // pointer to routine to get the data
201 } HUD_label, *pHUDlabel;
203 // Removed union HUD_instr_data to evolve this to oop code.
205 enum hudinstypes { HUDno_instr,
215 typedef struct HUD_INSTR_STRUCT{
219 void *instr; // For now we will cast this pointer accoring to the value
220 // of the type member.
221 struct HUD_INSTR_STRUCT *next;
230 Hptr fgHUDInit ( fgAIRCRAFT *cur_aircraft );
232 Hptr fgHUDAddHorizon( Hptr hud,
237 double (*load_value)( void ) );
239 Hptr fgHUDAddScale ( Hptr hud, \
251 double (*load_value)( void ) );
253 Hptr fgHUDAddLabel ( Hptr hud, \
262 double (*load_value)( void ) );
264 Hptr fgHUDAddLadder ( Hptr hud, \
273 double (*load_roll)( void ), \
274 double (*load_pitch)( void ) );
276 Hptr fgHUDAddControlSurfaces( Hptr hud,
279 double (*load_value)(void) );
282 Hptr fgHUDAddLadder ( Hptr hud,
289 double *(load_value);
291 Hptr fgHUDAddCircularLadder( Hptr hud,
297 double *(load_value) );
299 Hptr fgHUDAddNumDisp( Hptr hud,
306 double *(load_value) );
309 void fgUpdateHUD ( Hptr hud );
310 void fgUpdateHUD2( Hptr hud ); // Future use?
317 /* Revision 1.8 1998/02/07 15:29:35 curt
318 /* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
319 /* <chotchkiss@namg.us.anritsu.com>
321 * Revision 1.7 1998/02/03 23:20:15 curt
322 * Lots of little tweaks to fix various consistency problems discovered by
323 * Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
324 * passed arguments along to the real printf(). Also incorporated HUD changes
325 * by Michele America.
327 * Revision 1.6 1998/01/22 02:59:30 curt
328 * Changed #ifdef FILE_H to #ifdef _FILE_H
330 * Revision 1.5 1998/01/19 19:27:01 curt
331 * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
332 * This should simplify things tremendously.
334 * Revision 1.4 1998/01/19 18:40:21 curt
335 * Tons of little changes to clean up the code and to remove fatal errors
336 * when building with the c++ compiler.
338 * Revision 1.3 1997/12/30 16:36:41 curt
339 * Merged in Durk's changes ...
341 * Revision 1.2 1997/12/10 22:37:40 curt
342 * Prepended "fg" on the name of all global structures that didn't have it yet.
343 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
345 * Revision 1.1 1997/08/29 18:03:22 curt