]> git.mxchange.org Git - flightgear.git/blob - Cockpit/hud.cxx
C++ ifying ...
[flightgear.git] / Cockpit / hud.cxx
1 // hud.cxx -- hud defines and prototypes
2 //
3 // Written by Michele America, started September 1997.
4 //
5 // Copyright (C) 1997  Michele F. America  - micheleamerica@geocities.com
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22 // (Log is kept at end of this file)
23
24
25 #ifdef HAVE_CONFIG_H
26 #  include <config.h>
27 #endif
28
29 #ifdef HAVE_WINDOWS_H
30 #  include <windows.h>
31 #endif
32
33 #include <GL/glut.h>
34 #include <stdlib.h>
35 #include <string.h>
36
37 #ifdef HAVE_VALUES_H
38 #  include <values.h>  // for MAXINT
39 #endif
40
41 #include <Aircraft/aircraft.hxx>
42 #include <Debug/fg_debug.h>
43 #include <Include/fg_constants.h>
44 #include <Main/options.hxx>
45 #include <Math/fg_random.h>
46 #include <Math/mat3.h>
47 #include <Math/polar3d.hxx>
48 #include <Scenery/scenery.hxx>
49 #include <Time/fg_timer.hxx>
50
51 #if defined ( __sun__ ) || defined ( __sgi )
52 extern "C" {
53   extern void *memmove(void *, const void *, size_t);
54 }
55 #endif
56
57 #include "hud.hxx"
58
59
60
61 // The following routines obtain information concerntin the aircraft's
62 // current state and return it to calling instrument display routines.
63 // They should eventually be member functions of the aircraft.
64 //
65
66 deque< instr_item * > HUD_deque;
67
68 class locRECT {
69   public:
70     RECT rect;
71
72     locRECT( UINT left, UINT top, UINT right, UINT bottom);
73     RECT get_rect(void) { return rect;}
74 };
75
76 locRECT :: locRECT( UINT left, UINT top, UINT right, UINT bottom)
77 {
78   rect.left   =  left;
79   rect.top    =  top;
80   rect.right  =  right;
81   rect.bottom =  bottom;
82
83 }
84 // #define DEBUG
85
86 void drawOneLine( UINT x1, UINT y1, UINT x2, UINT y2)
87 {
88   glBegin(GL_LINES);
89   glVertex2f(x1, y1);
90   glVertex2f(x2, y2);
91   glEnd();
92 }
93
94 void drawOneLine( RECT &rect)
95 {
96   glBegin(GL_LINES);
97   glVertex2f(rect.left, rect.top);
98   glVertex2f(rect.right, rect.bottom);
99   glEnd();
100 }
101
102 //
103 // The following code deals with painting the "instrument" on the display
104 //
105    /* textString - Bitmap font string */
106
107 void textString( int x, int y, char *msg, void *font ){
108         glRasterPos2f(x, y);
109         while (*msg) {
110                 glutBitmapCharacter(font, *msg);
111                 msg++;
112     }
113 }
114
115 /* strokeString - Stroke font string */
116
117 void strokeString(int x, int y, char *msg, void *font, float theta)
118 {
119 int xx;
120 int yy;
121
122         glPushMatrix();
123   glRotatef(theta * RAD_TO_DEG, 0.0, 0.0, 1.0);
124   xx = (int)(x * cos(theta) + y * sin( theta ));
125   yy = (int)(y * cos(theta) - x * sin( theta ));
126         glTranslatef( xx, yy, 0);
127         glScalef(.1, .1, 0.0);
128         while (*msg) {
129                 glutStrokeCharacter(font, *msg);
130                 msg++;
131         }
132         glPopMatrix();
133 }
134
135 //========================= End of Class Implementations===================
136 // fgHUDInit
137 //
138 // Constructs a HUD object and then adds in instruments. At the present
139 // the instruments are hard coded into the routine. Ultimately these need
140 // to be defined by the aircraft's instrumentation records so that the
141 // display for a Piper Cub doesn't show the speed range of a North American
142 // mustange and the engine readouts of a B36!
143 //
144
145 #define INSTRDEFS 21
146
147 int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
148 {
149   instr_item *HIptr;
150   int index;
151
152   fgPrintf( FG_COCKPIT, FG_INFO, "Initializing current aircraft HUD\n" );
153
154   HUD_deque.erase( HUD_deque.begin(), HUD_deque.end());  // empty the HUD deque
155
156 //  hud->code = 1;
157 //  hud->status = 0;
158
159   // For now lets just hardcode the hud here.
160   // In the future, hud information has to come from the same place
161   // aircraft information came from.
162
163 //  fgHUDSetTimeMode( hud, NIGHT );
164 //  fgHUDSetBrightness( hud, BRT_LIGHT );
165
166   index = 0;
167
168   do {
169     switch ( index ) {
170       case 0:     // TBI
171         HIptr = (instr_item *) new fgTBI_instr( 270, 100, 60, 10 );
172         break;
173
174       case 1:     // Artificial Horizon
175         HIptr = (instr_item *) new HudLadder( 240, 195, 120, 180 );
176         break;
177
178       case 2:    // KIAS
179         HIptr = (instr_item *) new hud_card( 130,
180                                              170,
181                                               28,
182                                              200,
183                                              get_speed,
184                                              HUDS_LEFT | HUDS_VERT,
185                                              200.0, 0.0,
186                                              1.0,
187                                              10,  5,
188                                              0,
189                                              0,
190                                              50.0,
191                                              true);
192
193         break;
194
195       case 3:    // Radio Altimeter
196         HIptr = (instr_item *) new hud_card( 420,
197                                              195,
198                                               25,
199                                              150,
200                                              get_agl,
201                                              HUDS_LEFT | HUDS_VERT,
202                                              1000, 0,
203                                              1.0,
204                                              25,    5,
205                                              0,
206                                              0,
207                                              200.0,
208                                              true);
209         break;
210
211       case 4:    // GYRO COMPASS
212         HIptr = (instr_item *) new hud_card( 200,
213                                              375,
214                                              200,
215                                               28,
216                                              get_heading,
217                                              HUDS_TOP,
218                                              360, 0,
219                                                1.0,
220                                                5,   1,
221                                              360,
222                                                0,
223                                               25,
224                                              true);
225         break;
226
227       case 5:    // AMSL
228         HIptr = (instr_item *) new hud_card( 460,
229                                              170,
230                                               35,
231                                              200,
232                                              get_altitude,
233                                              HUDS_RIGHT | HUDS_VERT,
234                                              15000, 0,
235                                              1.0,
236                                              100,  25,
237                                              0,
238                                              0,
239                                              250,
240                                              true);
241         break;
242
243       case 6:
244         HIptr = (instr_item *) new  guage_instr( 250,            // x
245                                                  350,            // y
246                                                  100,            // width
247                                                   20,            // height
248                                                  get_aileronval, // data source
249                                                  HUDS_BOTTOM | HUDS_NOTEXT,
250                                                  100.0,
251                                                  +1.0,
252                                                  -1.0);
253         break;
254
255       case 7:
256         HIptr = (instr_item *) new  guage_instr( 170,             // x
257                                                  225,             // y
258                                                   20,             // width
259                                                  100,             // height
260                                                  get_elevatorval, // data source
261                                                  HUDS_RIGHT | HUDS_VERT | HUDS_NOTEXT,
262                                                 -100.0,           // Scale data
263                                                   +1.0,           // Data Range
264                                                   -1.0);
265         break;
266
267       case 8:
268         HIptr = (instr_item *) new  guage_instr( 250,             // x
269                                                  200,             // y
270                                                  100,             // width
271                                                   20,             // height
272                                                  get_rudderval,   // data source
273                                                  HUDS_TOP | HUDS_NOTEXT,
274                                                  100.0,
275                                                  +1.0,
276                                                  -1.0);
277         break;
278
279       case 9:
280         HIptr = (instr_item *) new  guage_instr( 100,             // x
281                                                  190,
282                                                   20,
283                                                  160,             // height
284                                                  get_throttleval, // data source
285                                                  HUDS_VERT | HUDS_RIGHT | HUDS_NOTEXT,
286                                                  100.0,
287                                                    1.0,
288                                                    0.0);
289         break;
290
291       case 10:    // Digital KIAS
292         HIptr = (instr_item *) new instr_label ( 110,
293                                                  150,
294                                                   40,
295                                                   30,
296                                                  get_speed,
297                                                  "%5.0f",
298                                                  NULL,
299                                                  " Kts",
300                                                  1.0,
301                                                  HUDS_TOP,
302                                                  RIGHT_JUST,
303                                                  SMALL,
304                                                  0,
305                                                  TRUE );
306         break;
307
308       case 11:    // Digital Rate of Climb
309         HIptr = (instr_item *) new instr_label ( 110,
310                                                  135,
311                                                   40,
312                                                   10,
313                                                  get_climb_rate,
314                                                  "%5.0f",
315                                                  " Climb",
316                                                  NULL,
317                                                  1.0,
318                                                  HUDS_TOP,
319                                                  RIGHT_JUST,
320                                                  SMALL,
321                                                  0,
322                                                  TRUE );
323         break;
324
325       case 12:    // Roll indication diagnostic
326         HIptr = (instr_item *) new instr_label ( 110,
327                                                  120,
328                                                   40,
329                                                   10,
330                                                  get_roll,
331                                                  "%5.2f",
332                                                  " Roll",
333                                                  " Deg",
334                                                  1.0,
335                                                  HUDS_TOP,
336                                                  RIGHT_JUST,
337                                                  SMALL,
338                                                  0,
339                                                  TRUE );
340         break;
341
342       case 13:    // Angle of attack diagnostic
343         HIptr = (instr_item *) new instr_label ( 440,
344                                                  150,
345                                                   60,
346                                                   10,
347                                                  get_aoa,
348                                                  "      %5.2f",
349                                                  "AOA",
350                                                  " Deg",
351                                                  1.0,
352                                                  HUDS_TOP,
353                                                  RIGHT_JUST,
354                                                  SMALL,
355                                                  0,
356                                                  TRUE );
357         break;
358
359       case 14:
360         HIptr = (instr_item *) new instr_label ( 440,
361                                                  135,
362                                                   60,
363                                                   10,
364                                                  get_heading,
365                                                  " %5.1f",
366                                                  "Heading ",
367                                                  " Deg",
368                                                  1.0,
369                                                  HUDS_TOP,
370                                                  RIGHT_JUST,
371                                                  SMALL,
372                                                  0,
373                                                  TRUE );
374         break;
375
376       case 15:
377         HIptr = (instr_item *) new instr_label ( 440,
378                                                  120,
379                                                   60,
380                                                   10,
381                                                  get_sideslip,
382                                                  "%5.2f",
383                                                  "Sideslip ",
384                                                  NULL,
385                                                  1.0,
386                                                  HUDS_TOP,
387                                                  RIGHT_JUST,
388                                                  SMALL,
389                                                  0,
390                                                  TRUE );
391         break;
392
393       case 16:
394         HIptr = (instr_item *) new instr_label( 440,
395                                                 100,
396                                                  60,
397                                                  10,
398                                                 get_throttleval,
399                                                 "%5.2f",
400                                                 "Throttle ",
401                                                 NULL,
402                                                  1.0,
403                                                 HUDS_TOP,
404                                                 RIGHT_JUST,
405                                                 SMALL,
406                                                 0,
407                                                 TRUE );
408         break;
409
410       case 17:
411         HIptr = (instr_item *) new instr_label( 440,
412                                                  85,
413                                                  60,
414                                                  10,
415                                                 get_elevatorval,
416                                                 "%5.2f",
417                                                 "Elevator ",
418                                                 NULL,
419                                                  1.0,
420                                                 HUDS_TOP,
421                                                 RIGHT_JUST,
422                                                 SMALL,
423                                                 0,
424                                                 TRUE );
425         break;
426
427       case 18:
428         HIptr = (instr_item *) new instr_label( 440,
429                                                  60,
430                                                  60,
431                                                  10,
432                                                 get_aileronval,
433                                                 "%5.2f",
434                                                 "Aileron  ",
435                                                 NULL,
436                                                  1.0,
437                                                 HUDS_TOP,
438                                                 RIGHT_JUST,
439                                                 SMALL,
440                                                 0,
441                                                 TRUE );
442         break;
443
444
445       case 19:
446         HIptr = (instr_item *) new instr_label( 10,
447                                                 10,
448                                                 60,
449                                                 10,
450                                                  get_frame_rate,
451                                                 "%.1f",
452                                                 "Frame rate = ",
453                                                 NULL,
454                                                  1.0,
455                                                 HUDS_TOP,
456                                                 RIGHT_JUST,
457                                                 SMALL,
458                                                 0,
459                                                 TRUE );
460         break;
461
462       case 20:
463           switch( current_options.get_tris_or_culled() ) {
464           case 0:
465               HIptr = (instr_item *) new instr_label( 10,
466                                                       25,
467                                                       90,
468                                                       10,
469                                                       get_vfc_tris_drawn,
470                                                       "%.0f",
471                                                       "Tris Rendered = ",
472                                                       NULL,
473                                                       1.0,
474                                                       HUDS_TOP,
475                                                       RIGHT_JUST,
476                                                       SMALL,
477                                                       0,
478                                                       TRUE );
479               break;
480           case 1:
481               HIptr = (instr_item *) new instr_label( 10,
482                                                       25,
483                                                       90,
484                                                       10,
485                                                       get_vfc_ratio,
486                                                       "%.2f",
487                                                       "VFC Ratio = ",
488                                                       NULL,
489                                                       1.0,
490                                                       HUDS_TOP,
491                                                       RIGHT_JUST,
492                                                       SMALL,
493                                                       0,
494                                                       TRUE );
495               break;
496           }
497           break;
498
499       case 21:
500         HIptr = (instr_item *) new instr_label( 10,
501                                                 40,
502                                                 90,
503                                                 10,
504                                                 get_fov,
505                                                 "%.1f",
506                                                 "FOV = ",
507                                                 NULL,
508                                                 1.0,
509                                                 HUDS_TOP,
510                                                 RIGHT_JUST,
511                                                 SMALL,
512                                                 0,
513                                                 TRUE );
514         break;
515
516       default:
517         HIptr = 0;;
518       }
519     if( HIptr ) {                   // Anything to install?
520       HUD_deque.insert( HUD_deque.begin(), HIptr);
521       }
522     index++;
523     }
524   while( HIptr );
525
526   return 0;  // For now. Later we may use this for an error code.
527 }
528
529 int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ )
530 {
531     instr_item *HIptr;
532     int index;
533
534     fgPrintf( FG_COCKPIT, FG_INFO, "Initializing current aircraft HUD\n" );
535
536     HUD_deque.erase( HUD_deque.begin(), HUD_deque.end());
537
538     //  hud->code = 1;
539     //  hud->status = 0;
540
541     // For now lets just hardcode the hud here.
542     // In the future, hud information has to come from the same place
543     // aircraft information came from.
544
545     //  fgHUDSetTimeMode( hud, NIGHT );
546     //  fgHUDSetBrightness( hud, BRT_LIGHT );
547
548     //  index = 0;
549     index = 19;  
550
551     instr_item* p;
552
553     p = new instr_label( 10, 10, 60, 10,
554                          get_frame_rate,
555                          "%.1f",
556                          "Frame rate = ",
557                          NULL,
558                          1.0,
559                          HUDS_TOP,
560                          RIGHT_JUST,
561                          SMALL,
562                          0,
563                          TRUE );
564     HUD_deque.push_front( p );
565
566     if ( current_options.get_tris_or_culled() == 0 )
567         p = new instr_label( 10, 25, 90, 10,
568                              get_vfc_tris_drawn,
569                              "%.0f",
570                              "Tris Rendered = ",
571                              NULL,
572                              1.0,
573                              HUDS_TOP,
574                              RIGHT_JUST,
575                              SMALL,
576                              0,
577                              TRUE );
578     else
579         p = new instr_label( 10, 25, 90, 10,
580                              get_vfc_ratio,
581                              "%.2f",
582                              "VFC Ratio = ",
583                              NULL,
584                              1.0,
585                              HUDS_TOP,
586                              RIGHT_JUST,
587                              SMALL,
588                              0,
589                              TRUE );
590     HUD_deque.push_front( p );
591
592     p = new instr_label( 10, 40, 90, 10,
593                          get_fov,
594                          "%.1f",
595                          "FOV = ",
596                          NULL,
597                          1.0,
598                          HUDS_TOP,
599                          RIGHT_JUST,
600                          SMALL,
601                          0,
602                          TRUE );
603     HUD_deque.push_front( p );
604
605     const int x_pos = 480;
606     p = new instr_label( x_pos, 40, 40, 30,
607                          get_speed,
608                          "%5.0f",
609                          "Airspeed ",
610                          " Kts",
611                          1.0,
612                          HUDS_TOP,
613                          RIGHT_JUST,
614                          SMALL,
615                          0,
616                          TRUE );
617     HUD_deque.push_front( p );
618
619     p = new instr_label( x_pos, 25, 40, 10,
620                          get_altitude,
621                          "%5.0f",
622                          "Altitude ",
623                          " m",
624                          1.0,
625                          HUDS_TOP,
626                          RIGHT_JUST,
627                          SMALL,
628                          0,
629                          TRUE );
630     HUD_deque.push_front( p );
631
632     p = new instr_label( x_pos, 10, 60, 10,
633                          get_heading,
634                          "%5.1f",
635                          "Heading  ",
636                          " Deg",
637                          1.0,
638                          HUDS_TOP,
639                          RIGHT_JUST,
640                          SMALL,
641                          0,
642                          TRUE );
643     HUD_deque.push_front( p );
644
645     return 0;  // For now. Later we may use this for an error code.
646 }
647
648 int global_day_night_switch = DAY;
649
650 void HUD_brightkey( bool incr_bright )
651 {
652 instr_item *pHUDInstr = HUD_deque[0];
653 int brightness        = pHUDInstr->get_brightness();
654
655   if( current_options.get_hud_status() ) {
656     if( incr_bright ) {
657       switch (brightness) {
658         case BRT_LIGHT:
659               current_options.set_hud_status(0);
660           break;
661
662         case BRT_MEDIUM:
663           brightness = BRT_LIGHT;
664           break;
665
666         case BRT_DARK:
667           brightness = BRT_MEDIUM;
668           break;
669
670         case BRT_BLACK:
671           brightness = BRT_DARK;
672           break;
673
674         default:
675           brightness = BRT_BLACK;
676         }
677       }
678     else {
679       switch (brightness) {
680         case BRT_LIGHT:
681           brightness = BRT_MEDIUM;
682           break;
683
684         case BRT_MEDIUM:
685           brightness = BRT_DARK;
686           break;
687
688         case BRT_DARK:
689           brightness = BRT_BLACK;
690           break;
691
692         case BRT_BLACK:
693         default:
694               current_options.set_hud_status(0);
695         }
696       }
697     }
698   else {
699     current_options.set_hud_status(1);
700     if( incr_bright ) {
701       if( DAY == global_day_night_switch ) {
702         brightness = BRT_BLACK;
703         }
704       else {
705         brightness = BRT_DARK;
706         global_day_night_switch = DAY;
707         }
708       }
709     else {
710       if( NIGHT == global_day_night_switch ) {
711         brightness = BRT_DARK;
712         }
713       else {
714         brightness = BRT_MEDIUM;
715         global_day_night_switch = NIGHT;
716         }
717       }
718     }
719   pHUDInstr->SetBrightness( brightness );
720 }
721
722 // fgUpdateHUD
723 //
724 // Performs a once around the list of calls to instruments installed in
725 // the HUD object with requests for redraw. Kinda. It will when this is
726 // all C++.
727 //
728 void fgUpdateHUD( void ) {
729   int i;
730   int brightness;
731 //  int day_night_sw = current_aircraft.controls->day_night_switch;
732   int day_night_sw = global_day_night_switch;
733   int hud_displays = HUD_deque.size();
734   instr_item *pHUDInstr;
735
736   if( !hud_displays ) {  // Trust everyone, but ALWAYS cut the cards!
737     return;
738     }
739
740   pHUDInstr = HUD_deque[0];
741   brightness = pHUDInstr->get_brightness();
742 //  brightness = HUD_deque.at(0)->get_brightness();
743
744   glMatrixMode(GL_PROJECTION);
745   glPushMatrix();
746
747   glLoadIdentity();
748   gluOrtho2D(0, 640, 0, 480);
749   glMatrixMode(GL_MODELVIEW);
750   glPushMatrix();
751   glLoadIdentity();
752
753   glColor3f(1.0, 1.0, 1.0);
754   glIndexi(7);
755
756   glDisable(GL_DEPTH_TEST);
757   glDisable(GL_LIGHTING);
758
759   glLineWidth(1);
760
761   deque < instr_item * > :: iterator current = HUD_deque.begin();
762   deque < instr_item * > :: iterator last = HUD_deque.end();
763
764   for ( ; current != last; ++current ) {
765     pHUDInstr = *current;
766
767     // for( i = hud_displays; i; --i) { // Draw everything
768     // if( HUD_deque.at(i)->enabled()) {
769     // pHUDInstr = HUD_deque[i - 1];
770     if( pHUDInstr->enabled()) {
771                                    // We should to respond to a dial instead
772                                    // or as well to the of time of day. Of
773                                    // course, we have no dial!
774       if( day_night_sw == DAY) {
775         switch (brightness) {
776           case BRT_LIGHT:
777             glColor3f (0.1, 0.9, 0.1);
778             break;
779
780           case BRT_MEDIUM:
781             glColor3f (0.1, 0.7, 0.0);
782             break;
783
784           case BRT_DARK:
785             glColor3f (0.0, 0.5, 0.0);
786             break;
787
788           case BRT_BLACK:
789             glColor3f( 0.0, 0.0, 0.0);
790             break;
791
792           default:;
793             }
794           }
795         else {
796           if( day_night_sw == NIGHT) {
797             switch (brightness) {
798               case BRT_LIGHT:
799                 glColor3f (0.9, 0.1, 0.1);
800                 break;
801
802               case BRT_MEDIUM:
803                 glColor3f (0.7, 0.0, 0.1);
804                 break;
805
806               case BRT_DARK:
807               default:
808                 glColor3f (0.5, 0.0, 0.0);
809               }
810             }
811           else {     // Just in case default
812             glColor3f (0.1, 0.9, 0.1);
813             }
814           }
815     //  fgPrintf( FG_COCKPIT, FG_DEBUG, "HUD Code %d  Status %d\n",
816     //            hud->code, hud->status );
817       pHUDInstr->draw();
818 //      HUD_deque.at(i)->draw(); // Responsible for broken or fixed variants.
819                               // No broken displays honored just now.
820       }
821     }
822
823   glEnable(GL_DEPTH_TEST);
824   glEnable(GL_LIGHTING);
825   glMatrixMode(GL_PROJECTION);
826   glPopMatrix();
827   glMatrixMode(GL_MODELVIEW);
828   glPopMatrix();
829 }
830
831 // $Log$
832 // Revision 1.25  1998/10/17 01:33:57  curt
833 // C++ ifying ...
834 //
835 // Revision 1.24  1998/10/16 23:27:25  curt
836 // C++-ifying.
837 //
838 // Revision 1.23  1998/10/16 00:53:00  curt
839 // Mods to display a bit more info when mini-hud is active.
840 //
841 // Revision 1.22  1998/09/29 14:56:31  curt
842 // c++-ified comments.
843 //
844 // Revision 1.21  1998/09/29 02:01:07  curt
845 // Added a "rate of climb" indicator.
846 //
847 // Revision 1.20  1998/08/24 20:05:16  curt
848 // Added a second minimalistic HUD.
849 // Added code to display the number of triangles rendered.
850 //
851 // Revision 1.19  1998/07/30 23:44:05  curt
852 // Tweaks for sgi building.
853 //
854 // Revision 1.18  1998/07/20 12:47:55  curt
855 // Replace the hud rendering for loop (which linearly searches the the hud
856 // list to find the entry with the proper position) with a simple linear
857 // traversal using an "iterator."
858 //
859 // Revision 1.17  1998/07/13 21:28:02  curt
860 // Converted the aoa scale to a radio altimeter.
861 //
862 // Revision 1.16  1998/07/13 21:00:47  curt
863 // Integrated Charlies latest HUD updates.
864 // Wrote access functions for current fgOPTIONS.
865 //
866 // Revision 1.15  1998/07/08 14:41:08  curt
867 // Renamed polar3d.h to polar3d.hxx
868 //
869 // Revision 1.14  1998/07/06 21:31:20  curt
870 // Removed an extraneous ^M.
871 //
872 // Revision 1.13  1998/07/03 13:16:28  curt
873 // Added Charlie Hotchkiss's HUD updates and improvementes.
874 //
875 // Revision 1.11  1998/06/05 18:17:10  curt
876 // Added the declaration of memmove needed by the stl which apparently
877 // solaris only defines for cc compilations and not for c++ (__STDC__)
878 //
879 // Revision 1.10  1998/05/17 16:58:12  curt
880 // Added a View Frustum Culling ratio display to the hud.
881 //
882 // Revision 1.9  1998/05/16 13:04:14  curt
883 // New updates from Charlie Hotchkiss.
884 //
885 // Revision 1.8  1998/05/13 18:27:54  curt
886 // Added an fov to hud display.
887 //
888 // Revision 1.7  1998/05/11 18:13:11  curt
889 // Complete C++ rewrite of all cockpit code by Charlie Hotchkiss.
890 //
891 // Revision 1.22  1998/04/18 04:14:02  curt
892 // Moved fg_debug.c to it's own library.
893 //
894 // Revision 1.21  1998/04/03 21:55:28  curt
895 // Converting to Gnu autoconf system.
896 // Tweaks to hud.c
897 //
898 // Revision 1.20  1998/03/09 22:48:40  curt
899 // Minor "formatting" tweaks.
900 //
901 // Revision 1.19  1998/02/23 20:18:28  curt
902 // Incorporated Michele America's hud changes.
903 //
904 // Revision 1.18  1998/02/21 14:53:10  curt
905 // Added Charlie's HUD changes.
906 //
907 // Revision 1.17  1998/02/20 00:16:21  curt
908 // Thursday's tweaks.
909 //
910 // Revision 1.16  1998/02/19 13:05:49  curt
911 // Incorporated some HUD tweaks from Michelle America.
912 // Tweaked the sky's sunset/rise colors.
913 // Other misc. tweaks.
914 //
915 // Revision 1.15  1998/02/16 13:38:39  curt
916 // Integrated changes from Charlie Hotchkiss.
917 //
918 // Revision 1.14  1998/02/12 21:59:41  curt
919 // Incorporated code changes contributed by Charlie Hotchkiss
920 // <chotchkiss@namg.us.anritsu.com>
921 //
922 // Revision 1.12  1998/02/09 15:07:48  curt
923 // Minor tweaks.
924 //
925 // Revision 1.11  1998/02/07 15:29:34  curt
926 // Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
927 // <chotchkiss@namg.us.anritsu.com>
928 //
929 // Revision 1.10  1998/02/03 23:20:14  curt
930 // Lots of little tweaks to fix various consistency problems discovered by
931 // Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
932 // passed arguments along to the real printf().  Also incorporated HUD changes
933 // by Michele America.
934 //
935 // Revision 1.9  1998/01/31 00:43:04  curt
936 // Added MetroWorks patches from Carmen Volpe.
937 //
938 // Revision 1.8  1998/01/27 00:47:51  curt
939 // Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
940 // system and commandline/config file processing code.
941 //
942 // Revision 1.7  1998/01/19 18:40:20  curt
943 // Tons of little changes to clean up the code and to remove fatal errors
944 // when building with the c++ compiler.
945 //
946 // Revision 1.6  1997/12/15 23:54:34  curt
947 // Add xgl wrappers for debugging.
948 // Generate terrain normals on the fly.
949 //
950 // Revision 1.5  1997/12/10 22:37:39  curt
951 // Prepended "fg" on the name of all global structures that didn't have it yet.
952 // i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
953 //
954 // Revision 1.4  1997/09/23 00:29:32  curt
955 // Tweaks to get things to compile with gcc-win32.
956 //
957 // Revision 1.3  1997/09/05 14:17:26  curt
958 // More tweaking with stars.
959 //
960 // Revision 1.2  1997/09/04 02:17:30  curt
961 // Shufflin' stuff.
962 //
963 // Revision 1.1  1997/08/29 18:03:22  curt
964 // Initial revision.
965 //