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