1 /**************************************************************************
2 * hud.hxx -- 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 **************************************************************************/
32 # error This library requires C++
36 #include <Aircraft/aircraft.h>
37 #include <Flight/flight.h>
38 #include <Controls/controls.h>
40 // View mode definitions
42 enum VIEW_MODES { HUD_VIEW, PANEL_VIEW, CHASE_VIEW, TOWER_VIEW };
44 // Hud general constants
54 #define ARTIFICIAL_HORIZON 1
82 #define UPPER_CENTER 3
84 #define CENTER_RIGHT 5
86 #define LOWER_CENTER 7
89 #define SOLID_LINES 10
90 #define DASHED_LINES 11
91 #define DASHED_NEG_LINES 12
94 // #define HUD_VERTICAL 1
95 // #define HUD_HORIZONTAL 2
96 // #define HUD_FREEFLOAT 3
98 // Ladder orientation modes
100 // #define HUD_RIGHT 2
102 // #define HUD_BOTTOM 2
103 // #define HUD_V_LEFT 1
104 // #define HUD_V_RIGHT 2
105 // #define HUD_H_TOP 1
106 // #define HUD_H_BOTTOM 2
111 // #define HUD_NOLIM 2
112 // #define HUD_CIRC 3
114 // #define HUD_INSTR_LADDER 1
115 // #define HUD_INSTR_CLADDER 2
116 // #define HUD_INSTR_HORIZON 3
117 // #define HUD_INSTR_LABEL 4
119 // The following structs will become classes with a derivation from
120 // an ABC instrument_pack. Eventually the instruments may well become
121 // dll's. This would open the instrumentation issue to all commers.
125 // Initialization(); // For dynamic scenario settups?
126 // Update(); // Follow the data changes.
127 // Repaint(); // Respond to uncover/panel repaints.
128 // Break(); // Show a frown.
129 // Fix(); // Return to normal appearance and function.
130 // Night_Day(); // Illumination changes appearance/bitmaps.
133 // CLO 2/21/98 - added to fix compile error
139 // CLO 2/21/98 - added to fix compile error
148 // Parametric defined members
157 int modulo; // for compass, etc. Set to 0 for non_modulo scales.
159 double (*load_value)( void );
161 // Pre-calculated members.
164 FG_RECT scrn_pos; // Screen rectangle for inicator
165 // Replaces previous parameters as:
166 // scr_pos -> left,bottom
167 // scr_max -> top, right
168 // scr_min -> left,bottom
170 double half_width_units;
171 }HUD_scale, *pHUDscale;
181 int modulo; // for compass, etc. Set to 0 for non_modulo scales.
182 double (*load_value)( void );
183 }HUD_circular_scale, *pHUD_circscale;
194 double (*load_roll)( void );
195 double (*load_pitch)( void );
196 }HUD_ladder, *pHUDladder;
206 double (*load_value)( void );
207 } HUD_circular_ladder, *pHUDcircladder;
209 #define HORIZON_FIXED 1
210 #define HORIZON_MOVING 2
218 double (*load_roll)( void );
219 double (*load_sideslip)( void );
220 } HUD_horizon, *pHUDhorizon;
224 double(*load_value)(void);
225 } HUD_control_surfaces, *pHUDControlSurfaces;
228 FG_POINT scrn_pos; // ctrl_x, ctrl_y
235 double (*load_value)(void);
236 } HUD_control, *pHUDControl;
237 #define LABEL_COUNTER 1
238 #define LABEL_WARNING 2
249 double (*load_value)( void ); // pointer to routine to get the data
250 } HUD_label, *pHUDlabel;
252 // Removed union HUD_instr_data to evolve this to oop code.
254 typedef enum{ HUDno_instr,
265 typedef struct HUD_INSTR_STRUCT{
269 void *instr; // For now we will cast this pointer accoring to the value
270 // of the type member.
271 struct HUD_INSTR_STRUCT *next;
280 int size; // possibly another name for this ? (michele)
283 Hptr fgHUDInit ( fgAIRCRAFT *cur_aircraft );
285 void fgHUDSetTimeMode( Hptr hud, int time_of_day );
286 void fgHUDSetBrightness( Hptr hud, int brightness );
288 Hptr fgHUDAddHorizon( Hptr hud,
294 double (*load_roll)( void ),
295 double (*load_sideslip)( void ) );
297 Hptr fgHUDAddScale ( Hptr hud, \
310 double (*load_value)( void ) );
312 Hptr fgHUDAddLabel ( Hptr hud, \
321 double (*load_value)( void ) );
323 Hptr fgHUDAddLadder ( Hptr hud, \
332 double (*load_roll)( void ), \
333 double (*load_pitch)( void ) );
335 Hptr fgHUDAddControlSurfaces( Hptr hud, \
338 double (*load_value)( void) );
340 Hptr fgHUDAddControl( Hptr hud, \
349 double (*load_value)( void) );
352 Hptr fgHUDAddLadder ( Hptr hud,
359 double *(load_value);
361 Hptr fgHUDAddCircularLadder( Hptr hud,
367 double *(load_value) );
369 Hptr fgHUDAddNumDisp( Hptr hud,
376 double *(load_value) );
379 void fgUpdateHUD ( Hptr hud );
380 void fgUpdateHUD2( Hptr hud ); // Future use?
386 /* Revision 1.1 1998/04/24 00:45:58 curt
387 /* C++-ifing the code a bit.
389 * Revision 1.15 1998/02/23 19:07:57 curt
390 * Incorporated Durk's Astro/ tweaks. Includes unifying the sun position
391 * calculation code between sun display, and other FG sections that use this
392 * for things like lighting.
394 * Revision 1.14 1998/02/21 14:53:14 curt
395 * Added Charlie's HUD changes.
397 * Revision 1.13 1998/02/20 00:16:22 curt
400 * Revision 1.12 1998/02/19 13:05:52 curt
401 * Incorporated some HUD tweaks from Michelle America.
402 * Tweaked the sky's sunset/rise colors.
403 * Other misc. tweaks.
405 * Revision 1.11 1998/02/16 13:38:42 curt
406 * Integrated changes from Charlie Hotchkiss.
408 * Revision 1.10 1998/02/12 21:59:42 curt
409 * Incorporated code changes contributed by Charlie Hotchkiss
410 * <chotchkiss@namg.us.anritsu.com>
412 * Revision 1.8 1998/02/07 15:29:35 curt
413 * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
414 * <chotchkiss@namg.us.anritsu.com>
416 * Revision 1.7 1998/02/03 23:20:15 curt
417 * Lots of little tweaks to fix various consistency problems discovered by
418 * Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
419 * passed arguments along to the real printf(). Also incorporated HUD changes
420 * by Michele America.
422 * Revision 1.6 1998/01/22 02:59:30 curt
423 * Changed #ifdef FILE_H to #ifdef _FILE_H
425 * Revision 1.5 1998/01/19 19:27:01 curt
426 * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
427 * This should simplify things tremendously.
429 * Revision 1.4 1998/01/19 18:40:21 curt
430 * Tons of little changes to clean up the code and to remove fatal errors
431 * when building with the c++ compiler.
433 * Revision 1.3 1997/12/30 16:36:41 curt
434 * Merged in Durk's changes ...
436 * Revision 1.2 1997/12/10 22:37:40 curt
437 * Prepended "fg" on the name of all global structures that didn't have it yet.
438 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
440 * Revision 1.1 1997/08/29 18:03:22 curt