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