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 **************************************************************************/
30 #include <Aircraft/aircraft.h>
31 #include <Flight/flight.h>
32 #include <Controls/controls.h>
34 // View mode definitions
36 enum VIEW_MODES { HUD_VIEW, PANEL_VIEW, CHASE_VIEW, TOWER_VIEW };
38 // Hud general constants
48 #define ARTIFICIAL_HORIZON 1
76 #define UPPER_CENTER 3
78 #define CENTER_RIGHT 5
80 #define LOWER_CENTER 7
83 #define SOLID_LINES 10
84 #define DASHED_LINES 11
85 #define DASHED_NEG_LINES 12
88 // #define HUD_VERTICAL 1
89 // #define HUD_HORIZONTAL 2
90 // #define HUD_FREEFLOAT 3
92 // Ladder orientation modes
94 // #define HUD_RIGHT 2
96 // #define HUD_BOTTOM 2
97 // #define HUD_V_LEFT 1
98 // #define HUD_V_RIGHT 2
99 // #define HUD_H_TOP 1
100 // #define HUD_H_BOTTOM 2
105 // #define HUD_NOLIM 2
106 // #define HUD_CIRC 3
108 // #define HUD_INSTR_LADDER 1
109 // #define HUD_INSTR_CLADDER 2
110 // #define HUD_INSTR_HORIZON 3
111 // #define HUD_INSTR_LABEL 4
113 // The following structs will become classes with a derivation from
114 // an ABC instrument_pack. Eventually the instruments may well become
115 // dll's. This would open the instrumentation issue to all commers.
119 // Initialization(); // For dynamic scenario settups?
120 // Update(); // Follow the data changes.
121 // Repaint(); // Respond to uncover/panel repaints.
122 // Break(); // Show a frown.
123 // Fix(); // Return to normal appearance and function.
124 // Night_Day(); // Illumination changes appearance/bitmaps.
127 // CLO 2/21/98 - added to fix compile error
133 // CLO 2/21/98 - added to fix compile error
142 // Parametric defined members
151 int modulo; // for compass, etc. Set to 0 for non_modulo scales.
153 double (*load_value)( void );
155 // Pre-calculated members.
158 FG_RECT scrn_pos; // Screen rectangle for inicator
159 // Replaces previous parameters as:
160 // scr_pos -> left,bottom
161 // scr_max -> top, right
162 // scr_min -> left,bottom
164 double half_width_units;
165 }HUD_scale, *pHUDscale;
175 int modulo; // for compass, etc. Set to 0 for non_modulo scales.
176 double (*load_value)( void );
177 }HUD_circular_scale, *pHUD_circscale;
188 double (*load_roll)( void );
189 double (*load_pitch)( void );
190 }HUD_ladder, *pHUDladder;
200 double (*load_value)( void );
201 } HUD_circular_ladder, *pHUDcircladder;
203 #define HORIZON_FIXED 1
204 #define HORIZON_MOVING 2
212 double (*load_roll)( void );
213 double (*load_sideslip)( void );
214 } HUD_horizon, *pHUDhorizon;
218 double(*load_value)(void);
219 } HUD_control_surfaces, *pHUDControlSurfaces;
222 FG_POINT scrn_pos; // ctrl_x, ctrl_y
229 double (*load_value)(void);
230 } HUD_control, *pHUDControl;
231 #define LABEL_COUNTER 1
232 #define LABEL_WARNING 2
243 double (*load_value)( void ); // pointer to routine to get the data
244 } HUD_label, *pHUDlabel;
246 // Removed union HUD_instr_data to evolve this to oop code.
248 typedef enum{ HUDno_instr,
259 typedef struct HUD_INSTR_STRUCT{
263 void *instr; // For now we will cast this pointer accoring to the value
264 // of the type member.
265 struct HUD_INSTR_STRUCT *next;
274 int size; // possibly another name for this ? (michele)
277 Hptr fgHUDInit ( fgAIRCRAFT *cur_aircraft );
279 void fgHUDSetTimeMode( Hptr hud, int time_of_day );
280 void fgHUDSetBrightness( Hptr hud, int brightness );
282 Hptr fgHUDAddHorizon( Hptr hud,
288 double (*load_roll)( void ),
289 double (*load_sideslip)( void ) );
291 Hptr fgHUDAddScale ( Hptr hud, \
304 double (*load_value)( void ) );
306 Hptr fgHUDAddLabel ( Hptr hud, \
315 double (*load_value)( void ) );
317 Hptr fgHUDAddLadder ( Hptr hud, \
326 double (*load_roll)( void ), \
327 double (*load_pitch)( void ) );
329 Hptr fgHUDAddControlSurfaces( Hptr hud, \
332 double (*load_value)( void) );
334 Hptr fgHUDAddControl( Hptr hud, \
343 double (*load_value)( void) );
346 Hptr fgHUDAddLadder ( Hptr hud,
353 double *(load_value);
355 Hptr fgHUDAddCircularLadder( Hptr hud,
361 double *(load_value) );
363 Hptr fgHUDAddNumDisp( Hptr hud,
370 double *(load_value) );
373 void fgUpdateHUD ( Hptr hud );
374 void fgUpdateHUD2( Hptr hud ); // Future use?
380 /* Revision 1.15 1998/02/23 19:07:57 curt
381 /* Incorporated Durk's Astro/ tweaks. Includes unifying the sun position
382 /* calculation code between sun display, and other FG sections that use this
383 /* for things like lighting.
385 * Revision 1.14 1998/02/21 14:53:14 curt
386 * Added Charlie's HUD changes.
388 * Revision 1.13 1998/02/20 00:16:22 curt
391 * Revision 1.12 1998/02/19 13:05:52 curt
392 * Incorporated some HUD tweaks from Michelle America.
393 * Tweaked the sky's sunset/rise colors.
394 * Other misc. tweaks.
396 * Revision 1.11 1998/02/16 13:38:42 curt
397 * Integrated changes from Charlie Hotchkiss.
399 * Revision 1.10 1998/02/12 21:59:42 curt
400 * Incorporated code changes contributed by Charlie Hotchkiss
401 * <chotchkiss@namg.us.anritsu.com>
403 * Revision 1.8 1998/02/07 15:29:35 curt
404 * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
405 * <chotchkiss@namg.us.anritsu.com>
407 * Revision 1.7 1998/02/03 23:20:15 curt
408 * Lots of little tweaks to fix various consistency problems discovered by
409 * Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
410 * passed arguments along to the real printf(). Also incorporated HUD changes
411 * by Michele America.
413 * Revision 1.6 1998/01/22 02:59:30 curt
414 * Changed #ifdef FILE_H to #ifdef _FILE_H
416 * Revision 1.5 1998/01/19 19:27:01 curt
417 * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
418 * This should simplify things tremendously.
420 * Revision 1.4 1998/01/19 18:40:21 curt
421 * Tons of little changes to clean up the code and to remove fatal errors
422 * when building with the c++ compiler.
424 * Revision 1.3 1997/12/30 16:36:41 curt
425 * Merged in Durk's changes ...
427 * Revision 1.2 1997/12/10 22:37:40 curt
428 * Prepended "fg" on the name of all global structures that didn't have it yet.
429 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
431 * Revision 1.1 1997/08/29 18:03:22 curt