1 /**************************************************************************
2 * hud.cxx -- hud defines and prototypes
4 * Written by Michele America, started September 1997.
6 * Copyright (C) 1997 Michele F. America - micheleamerica@geocities.com
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * (Log is kept at end of this file)
24 **************************************************************************/
40 # include <values.h> // for MAXINT
43 #include <Aircraft/aircraft.h>
44 #include <Debug/fg_debug.h>
45 #include <Include/fg_constants.h>
46 #include <Math/fg_random.h>
47 #include <Math/mat3.h>
48 #include <Math/polar3d.h>
49 #include <Scenery/scenery.hxx>
50 #include <Time/fg_timer.hxx>
51 #include <Weather/weather.h>
58 extern void *memmove(void *, const void *, size_t);
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.
68 //using namespace std;
77 instr_ptr ( instr_item * pHudInstr = 0) : pHI( pHudInstr){}
78 ~instr_ptr() { if( pHI ) delete pHI; }
79 instr_ptr & operator = (const instr_ptr & rhs);
80 instr_ptr( const instr_ptr & image );
85 operator = ( const instr_ptr & rhs )
87 if( !(this == &rhs )) {
88 pHI = new instr_item( *(rhs.pHI));
94 instr_ptr ( const instr_ptr & image ) :
96 pHI = new instr_item( *(image.pHI));
99 deque< instr_item * > HUD_deque;
105 locRECT( UINT left, UINT top, UINT right, UINT bottom);
106 RECT get_rect(void) { return rect;}
109 locRECT :: locRECT( UINT left, UINT top, UINT right, UINT bottom)
114 rect.bottom = bottom;
119 // #define drawOneLine(x1,y1,x2,y2) glBegin(GL_LINES);
120 // glVertex2f ((x1),(y1)); glVertex2f ((x2),(y2)); glEnd();
123 void drawOneLine( UINT x1, UINT y1, UINT x2, UINT y2)
131 void drawOneLine( RECT &rect)
134 glVertex2f(rect.left, rect.top);
135 glVertex2f(rect.right, rect.bottom);
140 // The following code deals with painting the "instrument" on the display
142 /* textString - Bitmap font string */
144 static void textString(int x, int y, char *msg, void *font)
148 glutBitmapCharacter(font, *msg);
153 /* strokeString - Stroke font string */
155 static void strokeString(int x, int y, char *msg, void *font)
158 glTranslatef(x, y, 0);
159 glScalef(.04, .04, .04);
161 glutStrokeCharacter(font, *msg);
170 // Abstract Base Class instr_item
172 UINT instr_item :: instances; // Initial value of zero
174 // constructor ( No default provided )
177 instr_item( RECT scr_pos,
178 DBLFNPTR data_source,
179 ReadOriented orientation,
181 handle ( ++instances ),
182 scrn_pos ( scr_pos ),
183 load_value_fn ( data_source ),
184 oriented ( orientation ),
185 is_enabled ( working ),
187 brightness ( BRT_DARK )
189 int hitemp, widetemp;
192 // Check for inverted rect coords. We must have top/right > bottom
193 // left corners or derived classes will draw their boxes very oddly.
194 // This is the only place we can reliably validate this data. Note
195 // that the box may be entirely or partly located off the screen.
196 // This needs consideration and possibly a member function to move
197 // the box, a keen idea for supporting "editing" of the HUD.
198 if( scrn_pos.top < scrn_pos.bottom ) {
199 xtemp = scrn_pos.bottom;
200 scrn_pos.bottom = scrn_pos.top;
201 scrn_pos.top = xtemp;
203 if( scrn_pos.left > scrn_pos.right ) {
204 xtemp = scrn_pos.left;
205 scrn_pos.left = scrn_pos.right;
206 scrn_pos.right = xtemp;
209 // Insure that the midpoint marker will fall exactly at the
210 // middle of the bar.
211 if( !((scr_pos.top-scr_pos.bottom) % 2)) {
214 if( !((scr_pos.right - scr_pos.left ) % 2)) {
217 // Set up convenience values for centroid of the box and
218 // the span values according to orientation
220 hitemp = scr_pos.top - scr_pos.bottom;
221 widetemp = scr_pos.right - scr_pos.left;
222 if((orientation == ReadTOP) || (orientation == ReadBOTTOM)) {
228 // Here we work out the centroid for the corrected box.
229 mid_span.x = scr_pos.left + ((scr_pos.right - scr_pos.left) >> 1);
230 mid_span.y = scr_pos.bottom + ((scr_pos.top - scr_pos.bottom) >> 1);
235 instr_item ( const instr_item & image ):
236 handle ( ++instances ),
237 scrn_pos ( image.scrn_pos ),
238 load_value_fn( image.load_value_fn),
239 oriented ( image.oriented ),
240 is_enabled ( image.is_enabled ),
241 broken ( image.broken ),
242 brightness ( image.brightness ),
243 scr_span ( image.scr_span ),
244 mid_span ( image.mid_span )
248 // assignment operator
250 instr_item & instr_item :: operator = ( const instr_item & rhs )
252 if( !(this == &rhs )) { // Not an identity assignment
253 scrn_pos = rhs.scrn_pos;
254 load_value_fn = rhs.load_value_fn;
255 oriented = rhs.oriented;
256 is_enabled = rhs.is_enabled;
258 brightness = rhs.brightness;
265 instr_item :: ~instr_item ()
277 // break_display This is emplaced to provide hooks for making
278 // instruments unreliable. The default behavior is
279 // to simply not display, but more sophisticated behavior is available
280 // by over riding the function which is virtual in this class.
283 break_display ( bool bad )
290 SetBrightness ( int level )
292 brightness = level; // This is all we will do for now. Later the
293 // brightness levels will be sensitive both to
294 // the control knob and the outside light levels
295 // to emulated night vision effects.
298 UINT instr_item :: get_Handle( void )
303 //======================= Top of instr_label class =========================
305 instr_label( RECT region,
306 DBLFNPTR data_source,
307 const char *label_format,
308 const char *pre_label_string,
309 const char *post_label_string,
310 ReadOriented orientation,
311 fgLabelJust justification,
315 instr_item( region, data_source,
316 orientation, working ),
317 pformat ( label_format ),
318 pre_str ( pre_label_string ),
319 post_str ( post_label_string ),
320 justify ( justification ),
321 fontSize ( font_size ),
326 // I put this in to make it easy to construct a class member using the current
330 instr_label :: ~instr_label()
335 instr_label :: instr_label( const instr_label & image) :
336 instr_item((const instr_item &)image),
337 pformat ( image.pformat ),
338 pre_str ( image.pre_str ),
339 post_str ( image.post_str ),
340 blink ( image.blink )
344 instr_label & instr_label ::operator = (const instr_label & rhs )
346 if( !(this == &rhs)) {
347 instr_item::operator = (rhs);
348 pformat = rhs.pformat;
349 fontSize = rhs.fontSize;
351 justify = rhs.justify;
352 pre_str = rhs.pre_str;
353 post_str = rhs.post_str;
360 // draw Draws a label anywhere in the HUD
364 draw( void ) // Required method in base class
366 char format_buffer[80];
367 char label_buffer[80];
370 RECT scrn_rect = get_location();
372 if( pre_str != NULL) {
373 if( post_str != NULL ) {
374 sprintf( format_buffer, "%s%s%s", pre_str, pformat, post_str );
377 sprintf( format_buffer, "%s%s", pre_str, pformat );
381 if( post_str != NULL ) {
382 sprintf( format_buffer, "%s%s", pformat, post_str );
384 } // else do nothing if both pre and post strings are nulls. Interesting.
386 sprintf( label_buffer, format_buffer, get_value() );
388 fgPrintf( FG_COCKPIT, FG_DEBUG, format_buffer );
389 fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
390 fgPrintf( FG_COCKPIT, FG_DEBUG, label_buffer );
391 fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
393 lenstr = strlen( label_buffer );
395 posincr = 0; // default to RIGHT_JUST ... center located calc: -lenstr*8;
397 if( justify == CENTER_JUST ) {
398 posincr = - (lenstr << 2); // -lenstr*4;
401 if( justify == LEFT_JUST ) {
402 posincr = - (lenstr << 8); // 0;
406 if( fontSize == SMALL ) {
407 textString( scrn_rect.left + posincr, scrn_rect.bottom,
408 label_buffer, GLUT_BITMAP_8_BY_13);
411 if( fontSize == LARGE ) {
412 textString( scrn_rect.left + posincr, scrn_rect.bottom,
413 label_buffer, GLUT_BITMAP_9_BY_15);
418 //============== Top of instr_scale class memeber definitions ===============
421 // 1. instr_scales divide the specified location into half and then
422 // the half opposite the read direction in half again. A bar is
423 // then drawn along the second divider. Scale ticks are drawn
424 // between the middle and quarter section lines (minor division
425 // markers) or just over the middle line.
427 // 2. This class was not intended to be instanciated. See moving_scale
428 // and guage_instr classes.
429 //============================================================================
431 instr_scale ( RECT the_box,
441 instr_item( the_box, load_fn, orient, working),
442 range_shown ( show_range ),
443 Maximum_value( maxValue ),
444 Minimum_value( minValue ),
445 Maj_div ( major_divs ),
446 Min_div ( minor_divs ),
451 scale_factor = (double)get_span() / range_shown;
452 if( show_range < 0 ) {
453 range_shown = -range_shown;
455 temp = (Maximum_value - Minimum_value) / 100;
456 if( range_shown < temp ) {
462 instr_scale( const instr_scale & image ) :
463 instr_item( (const instr_item &) image),
464 range_shown ( image.range_shown ),
465 Maximum_value( image.Maximum_value ),
466 Minimum_value( image.Minimum_value ),
467 Maj_div ( image.Maj_div ),
468 Min_div ( image.Min_div ),
469 Modulo ( image.Modulo ),
470 scale_factor ( image.scale_factor )
474 instr_scale & instr_scale :: operator = (const instr_scale & rhs )
476 if( !(this == &rhs)) {
477 instr_item::operator = (rhs);
478 Minimum_value = rhs.Minimum_value;
479 Maximum_value = rhs.Maximum_value;
480 Maj_div = rhs.Maj_div;
481 Min_div = rhs.Min_div;
483 scale_factor = rhs.scale_factor;
484 range_shown = rhs.range_shown;
489 instr_scale :: ~ instr_scale () {}
491 //========== Top of moving_scale_instr class member definitions =============
494 moving_scale( RECT the_box,
495 DBLFNPTR data_source,
496 ReadOriented orientation,
504 instr_scale( the_box,
505 data_source, orientation,
507 max_value, min_value,
508 major_divs, minor_divs, modulus,
510 val_span ( value_span)
512 half_width_units = range_to_show() / 2.0;
519 moving_scale( const moving_scale & image):
520 instr_scale( (const instr_scale & ) image)
524 moving_scale & moving_scale ::
525 operator = (const moving_scale & rhs )
527 if( !( this == &rhs)){
528 instr_scale::operator = (rhs);
534 draw( void ) // (HUD_scale * pscale )
543 POINT mid_scr = get_centroid();
544 POINT bias_bar; // eliminates some orientation checks
545 double cur_value = get_value();
546 RECT scrn_rect = get_location();
547 ReadOriented orientation = get_orientation();
549 vmin = cur_value - half_width_units; // width units == needle travel
550 vmax = cur_value + half_width_units; // or picture unit span.
553 if( (orientation == ReadLEFT) ||( orientation == ReadRIGHT)) // Vertical scale
555 if( orientation == ReadLEFT ) { // Calculate x marker offset
556 marker_x = scrn_rect.left - 6;
557 bias_bar.x = ((scrn_rect.right - mid_scr.x)>>1) + mid_scr.x;
559 else { // We'll default this for now.
560 marker_x = mid_scr.x; // scrn_rect.right;
561 bias_bar.x = ((mid_scr.x - scrn_rect.left)>>1) + scrn_rect.left;
564 // Draw the basic markings for the scale...
566 drawOneLine( bias_bar.x, // Vertical scale bar
572 if( orientation == ReadLEFT )
575 drawOneLine( bias_bar.x, // Bottom tick bar
580 drawOneLine( bias_bar.x, // Top tick bar
585 drawOneLine( scrn_rect.right, // Middle tick bar /Index
592 drawOneLine( bias_bar.x,
597 drawOneLine( bias_bar.x,
602 drawOneLine( scrn_rect.left,
608 // Work through from bottom to top of scale. Calculating where to put
609 // minor and major ticks.
611 for( i = (int)vmin; i <= (int)vmax; i++ )
613 // if( sub_type == LIMIT ) { // Don't show ticks
614 condition = (i >= min_val()); // below Minimum value.
617 // if( sub_type == NOLIMIT ) {
621 if( condition ) // Show a tick if necessary
623 // Calculate the location of this tick
624 marker_y = scrn_rect.bottom + (int)((i - vmin) * factor());
626 // Block calculation artifact from drawing ticks below min coordinate.
627 // Calculation here accounts for text height.
629 if( marker_y < (scrn_rect.bottom + 4)) { // Magic number!!!
633 if( (i%div_min()) == 0) {
634 // if( orientation == ReadLEFT )
636 // drawOneLine( marker_x + 3, marker_y, marker_x + 6, marker_y );
637 drawOneLine( bias_bar.x, marker_y, mid_scr.x, marker_y );
640 // if( orientation == ReadRIGHT )
642 // drawOneLine( marker_x, marker_y, marker_x + 3, marker_y );
643 // drawOneLine( bias_bar.x, marker_y, mid_scr.x, marker_y );
649 if( (i%div_max()) == 0 ) {
650 // drawOneLine( marker_x, marker_y,
651 // marker_x + 6, marker_y );
653 disp_val = i % modulo();
655 disp_val += modulo();
661 sprintf( TextScale, "%d", disp_val );
662 if( orientation == ReadLEFT ) {
663 drawOneLine( mid_scr.x - 3, marker_y, bias_bar.x, marker_y );
665 textString( marker_x - 8 * strlen(TextScale) - 2, marker_y - 4,
666 TextScale, GLUT_BITMAP_8_BY_13 );
669 drawOneLine( mid_scr.x + 3, marker_y, bias_bar.x, marker_y );
670 textString( marker_x + 10, marker_y - 4,
671 TextScale, GLUT_BITMAP_8_BY_13 );
672 } // Else read oriented right
673 } // End if modulo division by major interval is zero
674 } // End if major interval divisor non-zero
675 } // End if condition
676 } // End for range of i from vmin to vmax
677 } // End if VERTICAL SCALE TYPE
678 else { // Horizontal scale by default
680 if( orientation == ReadTOP ) {
681 bias_bar.y = ((mid_scr.y - scrn_rect.bottom)>>1 ) + scrn_rect.bottom;
682 marker_y = bias_bar.y; // Don't use now
684 else { // We will assume no other possibility at this time.
685 bias_bar.y = ((scrn_rect.top - mid_scr.y)>>1 ) + mid_scr.y;
686 marker_y = bias_bar.y; // Don't use now
689 drawOneLine( scrn_rect.left,
694 if( orientation == ReadTOP )
696 drawOneLine( scrn_rect.left,
701 drawOneLine( scrn_rect.right,
706 drawOneLine( mid_scr.x,
713 if( orientation == ReadBOTTOM )
715 drawOneLine( scrn_rect.left,
720 drawOneLine( scrn_rect.right,
725 drawOneLine( mid_scr.x,
732 for( i = (int)vmin; i <= (int)vmax; i++ ) // increment is faster than addition
734 // if( sub_type == LIMIT ) {
735 condition = (i >= min_val());
738 // if( sub_type == NOLIMIT ) {
743 marker_x = scrn_rect.left + (int)((i - vmin) * factor());
745 if( (i%(int)div_min()) == 0 ) {
746 // if( orientation == ReadTOP )
748 // drawOneLine( marker_x, marker_y, marker_x, marker_y + 3 );
749 drawOneLine( marker_x, bias_bar.y, marker_x, mid_scr.y );
752 // drawOneLine( marker_x, marker_y + 3, marker_x, marker_y + 6 );
753 // drawOneLine( marker_x, bias_bar.y, marker_x, mid_scr.y );
758 if( (i%(int)div_max())==0 )
761 disp_val = i % modulo();
763 disp_val += modulo();
769 sprintf( TextScale, "%d", disp_val );
770 if( orientation == ReadTOP )
772 // drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
773 drawOneLine( marker_x, mid_scr.y + 3,marker_x, bias_bar.y );
774 textString ( marker_x - 4 * strlen(TextScale), marker_y + 14,
775 TextScale, GLUT_BITMAP_8_BY_13 );
778 // drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
779 drawOneLine( marker_x, mid_scr.y - 3,marker_x, bias_bar.y );
780 textString ( marker_x - 4 * strlen(TextScale), mid_scr.y - 14,
781 TextScale, GLUT_BITMAP_8_BY_13 );
791 //============== Top of guage_instr class member definitions ==============
794 guage_instr( RECT the_box,
796 ReadOriented readway,
803 instr_scale( the_box,
805 maxValue, maxValue, minValue,
806 major_divs, minor_divs,
818 guage_instr( const guage_instr & image):
819 instr_scale( (instr_scale &) image)
823 guage_instr & guage_instr ::
824 operator = (const guage_instr & rhs )
826 if( !(this == &rhs)) {
827 instr_scale::operator = (rhs);
832 // As implemented, draw only correctly draws a horizontal or vertical
833 // scale. It should contain a variation that permits clock type displays.
834 // Now is supports "tickless" displays such as control surface indicators.
835 // This routine should be worked over before using. Current value would be
836 // fetched and not used if not commented out. Clearly that is intollerable.
838 void guage_instr :: draw (void)
846 double vmin = min_val();
847 double vmax = max_val();
848 POINT mid_scr = get_centroid();
849 // double cur_value = get_value();
850 RECT scrn_rect = get_location();
851 ReadOriented orientation = get_orientation();
853 if( (orientation == ReadLEFT) ||( orientation == ReadRIGHT)) // Vertical scale
855 mid_scr = get_centroid();
856 if( orientation == ReadLEFT ) // Calculate x marker offset
857 marker_x = scrn_rect.left - 6;
858 else // We'll default this for now.
859 marker_x = scrn_rect.right;
861 // Draw the basic markings for the scale...
863 if( orientation == ReadLEFT )
866 drawOneLine( scrn_rect.right - 3, // Bottom tick bar
871 drawOneLine( scrn_rect.right - 3, // Top tick bar
877 drawOneLine( scrn_rect.right,
882 drawOneLine( scrn_rect.right,
888 // Work through from bottom to top of scale. Calculating where to put
889 // minor and major ticks.
891 for( i = (int)vmin; i <= (int)vmax; i++ )
893 // Calculate the location of this tick
894 marker_y = scrn_rect.bottom + (int)((i - vmin) * factor());
897 if( (i%div_min()) == 0) {
898 if( orientation == ReadLEFT )
900 drawOneLine( marker_x + 3, marker_y, marker_x + 6, marker_y );
903 drawOneLine( marker_x, marker_y, marker_x + 3, marker_y );
908 if( (i%div_max()) == 0 ) {
909 drawOneLine( marker_x, marker_y,
910 marker_x + 6, marker_y );
912 disp_val = i % modulo();
914 disp_val += modulo();
920 sprintf( TextScale, "%d", disp_val );
921 if( orientation == ReadLEFT ) {
922 textString( marker_x - 8 * strlen(TextScale) - 2, marker_y - 4,
923 TextScale, GLUT_BITMAP_8_BY_13 );
926 if( orientation == ReadRIGHT ) {
927 textString( marker_x + 10, marker_y - 4,
928 TextScale, GLUT_BITMAP_8_BY_13 );
932 } // End if condition
933 } // End for range of i from vmin to vmax
934 } // End if VERTICAL SCALE TYPE
935 else { // Horizontal scale by default
937 if( orientation == ReadTOP ) {
938 marker_y = scrn_rect.bottom;
941 if( orientation == ReadBOTTOM ) {
942 marker_y = scrn_rect.bottom - 6;
945 drawOneLine( scrn_rect.left,
950 if( orientation == ReadTOP )
952 drawOneLine( scrn_rect.left,
955 scrn_rect.bottom + 3 );
957 drawOneLine( scrn_rect.right,
960 scrn_rect.bottom + 6 );
963 if( orientation == ReadBOTTOM )
965 drawOneLine( scrn_rect.left,
968 scrn_rect.bottom - 6 );
970 drawOneLine( scrn_rect.right,
973 scrn_rect.bottom - 6 );
977 for( i = (int)vmin; i <= (int)vmax; i++ ) // increment is faster than addition
979 marker_x = scrn_rect.left + (int)((i - vmin) * factor());
981 if( (i%div_min()) == 0 ) {
982 if( orientation == ReadTOP )
984 drawOneLine( marker_x, marker_y, marker_x, marker_y + 3 );
987 if( orientation == ReadBOTTOM )
989 drawOneLine( marker_x, marker_y + 3, marker_x, marker_y + 6 );
992 } // End if minor tick called for.
993 } // End if minor ticks are of interest
995 if( (i%div_max())==0 )
997 // Modulo implies a "clock" style instrument. Needs work.
999 disp_val = i % modulo();
1001 disp_val += modulo();
1004 else { // Scale doesn't roll around.
1007 sprintf( TextScale, "%d", disp_val );
1008 if( orientation == ReadTOP )
1010 drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
1011 textString ( marker_x - 4 * strlen(TextScale), marker_y + 14,
1012 TextScale, GLUT_BITMAP_8_BY_13 );
1015 if( orientation == ReadBOTTOM )
1017 drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
1018 textString ( marker_x - 4 * strlen(TextScale), marker_y - 14,
1019 TextScale, GLUT_BITMAP_8_BY_13 );
1021 } // End else if not ReadTOP
1022 } // End if major division point.
1023 } // End if major divisions of interest.
1029 //============ Top of dual_instr_item class member definitions ============
1032 dual_instr_item ( RECT the_box,
1033 DBLFNPTR chn1_source,
1034 DBLFNPTR chn2_source,
1036 ReadOriented readway ):
1037 instr_item( the_box, chn1_source, readway, working),
1038 alt_data_source( chn2_source )
1043 dual_instr_item( const dual_instr_item & image) :
1044 instr_item ((instr_item &) image ),
1045 alt_data_source( image.alt_data_source)
1049 dual_instr_item & dual_instr_item ::
1050 operator = (const dual_instr_item & rhs )
1052 if( !(this == &rhs)) {
1053 instr_item::operator = (rhs);
1054 alt_data_source = rhs.alt_data_source;
1059 //============ Top of fgTBI_instr class member definitions ==============
1062 fgTBI_instr( RECT the_box,
1063 DBLFNPTR chn1_source,
1064 DBLFNPTR chn2_source,
1069 dual_instr_item( the_box,
1074 BankLimit (maxBankAngle),
1075 SlewLimit (maxSlipAngle),
1076 scr_hole (gap_width )
1080 fgTBI_instr :: ~fgTBI_instr() {}
1082 fgTBI_instr :: fgTBI_instr( const fgTBI_instr & image):
1083 dual_instr_item( (const dual_instr_item &) image),
1084 BankLimit( image.BankLimit),
1085 SlewLimit( image.SlewLimit),
1086 scr_hole ( image.scr_hole )
1090 fgTBI_instr & fgTBI_instr ::
1091 operator = (const fgTBI_instr & rhs )
1093 if( !(this == &rhs)) {
1094 dual_instr_item::operator = (rhs);
1095 BankLimit = rhs.BankLimit;
1096 SlewLimit = rhs.SlewLimit;
1097 scr_hole = rhs.scr_hole;
1103 // Draws a Turn Bank Indicator on the screen
1106 void fgTBI_instr :: draw( void )
1110 int x_t_inc1, y_t_inc1;
1112 int d_bottom_x, d_bottom_y;
1113 int d_right_x, d_right_y;
1114 int d_top_x, d_top_y;
1115 int d_left_x, d_left_y;
1117 int inc_b_x, inc_b_y;
1118 int inc_r_x, inc_r_y;
1119 int inc_t_x, inc_t_y;
1120 int inc_l_x, inc_l_y;
1121 RECT My_box = get_location();
1122 POINT centroid = get_centroid();
1123 int tee_height = My_box.top - My_box.bottom; // Hack, hack.
1125 // struct fgFLIGHT *f = ¤t_aircraft.flight;
1126 double sin_bank, cos_bank;
1127 double bank_angle, sideslip_angle;
1128 double ss_const; // sideslip angle pixels per rad
1130 bank_angle = current_ch2(); // Roll limit +/- 30 degrees
1131 if( bank_angle < -FG_PI_2/3 ) {
1132 bank_angle = -FG_PI_2/3;
1133 }else if( bank_angle > FG_PI_2/3 ) {
1134 bank_angle = FG_PI_2/3;
1136 sideslip_angle = current_ch1(); // Sideslip limit +/- 20 degrees
1137 if( sideslip_angle < -FG_PI/9 ) {
1138 sideslip_angle = -FG_PI/9;
1139 } else if( sideslip_angle > FG_PI/9 ) {
1140 sideslip_angle = FG_PI/9;
1143 // sin_bank = sin( FG_2PI-FG_Phi );
1144 // cos_bank = cos( FG_2PI-FG_Phi );
1145 sin_bank = sin(FG_2PI-bank_angle);
1146 cos_bank = cos(FG_2PI-bank_angle);
1148 x_inc1 = (int)(get_span() * cos_bank);
1149 y_inc1 = (int)(get_span() * sin_bank);
1150 x_inc2 = (int)(scr_hole * cos_bank);
1151 y_inc2 = (int)(scr_hole * sin_bank);
1153 x_t_inc1 = (int)(tee_height * sin_bank);
1154 y_t_inc1 = (int)(tee_height * cos_bank);
1157 d_bottom_y = (int)(-scr_hole);
1158 d_right_x = (int)(scr_hole);
1161 d_top_y = (int)(scr_hole);
1162 d_left_x = (int)(-scr_hole);
1165 ss_const = (get_span()*2)/(FG_2PI/9); // width represents 40 degrees
1167 d_bottom_x += (int)(sideslip_angle*ss_const);
1168 d_right_x += (int)(sideslip_angle*ss_const);
1169 d_left_x += (int)(sideslip_angle*ss_const);
1170 d_top_x += (int)(sideslip_angle*ss_const);
1172 inc_b_x = (int)(d_bottom_x*cos_bank-d_bottom_y*sin_bank);
1173 inc_b_y = (int)(d_bottom_x*sin_bank+d_bottom_y*cos_bank);
1174 inc_r_x = (int)(d_right_x*cos_bank-d_right_y*sin_bank);
1175 inc_r_y = (int)(d_right_x*sin_bank+d_right_y*cos_bank);
1176 inc_t_x = (int)(d_top_x*cos_bank-d_top_y*sin_bank);
1177 inc_t_y = (int)(d_top_x*sin_bank+d_top_y*cos_bank);
1178 inc_l_x = (int)(d_left_x*cos_bank-d_left_y*sin_bank);
1179 inc_l_y = (int)(d_left_x*sin_bank+d_left_y*cos_bank);
1183 drawOneLine( centroid.x - x_inc1, centroid.y - y_inc1, \
1184 centroid.x + x_inc1, centroid.y + y_inc1 );
1188 drawOneLine( centroid.x - x_inc1, centroid.y - y_inc1, \
1189 centroid.x - x_inc2, centroid.y - y_inc2 );
1190 drawOneLine( centroid.x + x_inc2, centroid.y + y_inc2, \
1191 centroid.x + x_inc1, centroid.y + y_inc1 );
1195 drawOneLine( centroid.x + x_inc2, \
1196 centroid.y + y_inc2, \
1197 centroid.x + x_inc2 + x_t_inc1, \
1198 centroid.y + y_inc2 - y_t_inc1 );
1199 drawOneLine( centroid.x - x_inc2, \
1200 centroid.y - y_inc2, \
1201 centroid.x - x_inc2 + x_t_inc1, \
1202 centroid.y - y_inc2 - y_t_inc1 );
1204 // draw sideslip diamond (it is not yet positioned correctly )
1205 drawOneLine( centroid.x + inc_b_x, \
1206 centroid.y + inc_b_y, \
1207 centroid.x + inc_r_x, \
1208 centroid.y + inc_r_y );
1209 drawOneLine( centroid.x + inc_r_x, \
1210 centroid.y + inc_r_y, \
1211 centroid.x + inc_t_x, \
1212 centroid.y + inc_t_y );
1213 drawOneLine( centroid.x + inc_t_x, \
1214 centroid.y + inc_t_y, \
1215 centroid.x + inc_l_x, \
1216 centroid.y + inc_l_y );
1217 drawOneLine( centroid.x + inc_l_x, \
1218 centroid.y + inc_l_y, \
1219 centroid.x + inc_b_x, \
1220 centroid.y + inc_b_y );
1224 //====================== Top of HudLadder Class =======================
1226 HudLadder( RECT the_box,
1227 DBLFNPTR ptch_source,
1228 DBLFNPTR roll_source,
1235 dual_instr_item( the_box,
1240 width_units ( span_units ),
1241 div_units ( major_div < 0? -major_div: major_div ),
1242 minor_div ( minor_div ),
1243 label_pos ( lbl_pos ),
1244 scr_hole ( screen_hole ),
1245 vmax ( span_units/2 ),
1248 if( !width_units ) {
1251 factor = (double)get_span() / (double) width_units;
1260 HudLadder( const HudLadder & image ) :
1261 dual_instr_item( (dual_instr_item &) image),
1262 width_units ( image.width_units ),
1263 div_units ( image.div_units ),
1264 label_pos ( image.label_pos ),
1265 scr_hole ( image.scr_hole ),
1266 vmax ( image.vmax ),
1267 vmin ( image.vmin ),
1268 factor ( image.factor )
1271 HudLadder & HudLadder ::
1272 operator = ( const HudLadder & rhs )
1274 if( !(this == &rhs)) {
1275 (dual_instr_item &)(*this) = (dual_instr_item &)rhs;
1276 width_units = rhs.width_units;
1277 div_units = rhs.div_units;
1278 label_pos = rhs.label_pos;
1279 scr_hole = rhs.scr_hole;
1282 factor = rhs.factor;
1288 // Draws a climb ladder in the center of the HUD
1291 void HudLadder :: draw( void )
1293 double roll_value, pitch_value;
1300 int new_x_ini, new_x_end;
1301 int new_y_ini, new_y_end;
1303 POINT centroid = get_centroid();
1304 RECT box = get_location();
1305 int half_span = (box.right - box.left) >> 1;
1306 char TextLadder[80];
1309 roll_value = current_ch2();
1310 pitch_value = current_ch1() * RAD_TO_DEG;
1312 vmin = (int)(pitch_value - (double)width_units/2.0);
1313 vmax = (int)(pitch_value + (double)width_units/2.0);
1315 scr_min = box.bottom; // centroid.y - ((box.top - box.bottom) >> 1);
1316 // scr_max = box.top; // scr_min + (box.top - box.bottom);
1317 // marker_x = centroid.x - half_span;
1320 drawOneLine( centroid.x - 5, centroid.y, centroid.x, centroid.y + 5);
1321 drawOneLine( centroid.x, centroid.y + 5, centroid.x + 5, centroid.y);
1322 drawOneLine( centroid.x + 5, centroid.y, centroid.x, centroid.y - 5);
1323 drawOneLine( centroid.x, centroid.y - 5, centroid.x - 5, centroid.y);
1325 for( i=(int)vmin; i<=(int)vmax; i+=1 )
1330 marker_y = scr_min + (int)((i-vmin)*factor);
1332 if( i%div_units==0 )
1334 sprintf( TextLadder, "%d", i );
1338 x_ini = centroid.x - half_span;
1341 x_ini = centroid.x - half_span - 10;
1344 x_end = centroid.x + half_span;
1346 new_x_ini = centroid.x + (int)( \
1347 (x_ini - centroid.x) * cos(roll_value) - \
1348 (y_ini - centroid.y) * sin(roll_value));
1349 new_y_ini = centroid.y + (int)( \
1350 (x_ini - centroid.x) * sin(roll_value) + \
1351 (y_ini - centroid.y) * cos(roll_value));
1352 new_x_end = centroid.x + (int)( \
1353 (x_end - centroid.x) * cos(roll_value) - \
1354 (y_end - centroid.y) * sin(roll_value));
1355 new_y_end = centroid.y + (int)( \
1356 (x_end - centroid.x) * sin(roll_value) + \
1357 (y_end - centroid.y) * cos(roll_value));
1361 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
1365 glEnable(GL_LINE_STIPPLE);
1366 glLineStipple( 1, 0x00FF );
1367 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
1368 glDisable(GL_LINE_STIPPLE);
1370 textString( new_x_ini - 8 * strlen(TextLadder) - 8,
1372 TextLadder, GLUT_BITMAP_8_BY_13 );
1373 textString( new_x_end + 10,
1375 TextLadder, GLUT_BITMAP_8_BY_13 );
1380 x_ini = centroid.x - half_span;
1383 x_ini = centroid.x - half_span - 10;
1386 x_end = centroid.x - half_span + scr_hole/2;
1388 new_x_ini = centroid.x+ (int)( \
1389 (x_ini - centroid.x) * cos(roll_value) -\
1390 (y_ini - centroid.y) * sin(roll_value));
1391 new_y_ini = centroid.y+ (int)( \
1392 (x_ini - centroid.x) * sin(roll_value) +\
1393 (y_ini - centroid.y) * cos(roll_value));
1394 new_x_end = centroid.x+ (int)( \
1395 (x_end - centroid.x) * cos(roll_value) -\
1396 (y_end - centroid.y) * sin(roll_value));
1397 new_y_end = centroid.y+ (int)( \
1398 (x_end - centroid.x) * sin(roll_value) +\
1399 (y_end - centroid.y) * cos(roll_value));
1403 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
1407 glEnable(GL_LINE_STIPPLE);
1408 glLineStipple( 1, 0x00FF );
1409 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
1410 glDisable(GL_LINE_STIPPLE);
1412 textString( new_x_ini - 8 * strlen(TextLadder) - 8,
1414 TextLadder, GLUT_BITMAP_8_BY_13 );
1416 x_ini = centroid.x + half_span - scr_hole/2;
1419 x_end = centroid.x + half_span;
1422 x_end = centroid.x + half_span + 10;
1425 new_x_ini = centroid.x + (int)( \
1426 (x_ini-centroid.x)*cos(roll_value) -\
1427 (y_ini-centroid.y)*sin(roll_value));
1428 new_y_ini = centroid.y + (int)( \
1429 (x_ini-centroid.x)*sin(roll_value) +\
1430 (y_ini-centroid.y)*cos(roll_value));
1431 new_x_end = centroid.x + (int)( \
1432 (x_end-centroid.x)*cos(roll_value) -\
1433 (y_end-centroid.y)*sin(roll_value));
1434 new_y_end = centroid.y + (int)( \
1435 (x_end-centroid.x)*sin(roll_value) +\
1436 (y_end-centroid.y)*cos(roll_value));
1440 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
1444 glEnable(GL_LINE_STIPPLE);
1445 glLineStipple( 1, 0x00FF );
1446 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
1447 glDisable(GL_LINE_STIPPLE);
1449 textString( new_x_end+10, new_y_end-4,
1450 TextLadder, GLUT_BITMAP_8_BY_13 );
1454 /* if( i%div_max()==0 )
1456 drawOneLine( marker_x, marker_y, marker_x+6, marker_y );
1457 sprintf( TextScale, "%d", i );
1458 if( orientation == LEFT )
1460 textString( marker_x-8*strlen(TextScale)-2, marker_y-4,
1461 TextScale, GLUT_BITMAP_8_BY_13 );
1463 else if( orientation == RIGHT )
1465 textString( marker_x+10, marker_y-4,
1466 TextScale, GLUT_BITMAP_8_BY_13 );
1474 //========================= End of Class Implementations===================
1477 // Constructs a HUD object and then adds in instruments. At the present
1478 // the instruments are hard coded into the routine. Ultimately these need
1479 // to be defined by the aircraft's instrumentation records so that the
1480 // display for a Piper Cub doesn't show the speed range of a North American
1481 // mustange and the engine readouts of a B36!
1484 #define INSTRDEFS 17
1486 int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
1492 fgPrintf( FG_COCKPIT, FG_INFO, "Initializing current aircraft HUD\n" );
1494 HUD_deque.erase( HUD_deque.begin(), HUD_deque.end()); // empty the HUD deque
1499 // For now lets just hardcode the hud here.
1500 // In the future, hud information has to come from the same place
1501 // aircraft information came from.
1503 // fgHUDSetTimeMode( hud, NIGHT );
1504 // fgHUDSetBrightness( hud, BRT_LIGHT );
1506 for( index = 0; index <= INSTRDEFS; index++) {
1509 // fgHUDAddHorizon( hud, 330, 100, 40, 5, 10, get_roll, get_sideslip );
1510 loc.left = 330 - 40;
1512 loc.right = 330 + 40;
1514 HIptr = (instr_item *) new fgTBI_instr( loc );
1517 case 1: // Artificial Horizon
1518 // fgHUDAddLadder ( hud, 330, 285, 120, 180, 70, 10,
1519 // NONE, 45, get_roll, get_pitch );
1520 loc.left = 270; // 330 - 60
1521 loc.top = 375; // 285 + 90
1522 loc.right = 390; // 330 + 60
1523 loc.bottom = 195; // 285 - 90
1524 HIptr = (instr_item *) new HudLadder( loc );
1528 // fgHUDAddScale ( hud, VERTICAL, LIMIT, 200, 180, 380, 5, 10,
1529 // LEFT, 0, 100, 50, 0, get_speed );
1534 HIptr = (instr_item *) new moving_scale( loc,
1544 case 3: // Angle of Attack
1545 // fgHUDAddScale ( hud, HORIZONTAL, NOLIMIT, 180, 250, 410, 1, 5,
1546 // BOTTOM, -40, 50, 21, 0, get_aoa );
1551 HIptr = (instr_item *) new moving_scale( loc,
1561 case 4: // GYRO COMPASS
1562 // fgHUDAddScale ( hud, HORIZONTAL, NOLIMIT, 380, 200, 460, 5, 10,
1563 // TOP, 0, 50, 50, 360, get_heading );
1568 HIptr = (instr_item *) new moving_scale( loc,
1579 // fgHUDAddScale ( hud, VERTICAL, LIMIT, 460, 180, 380, 25, 100,
1580 // RIGHT, 0, 15000, 250, 0, get_altitude);
1585 HIptr = (instr_item *) new moving_scale( loc,
1595 case 6: // Digital KIAS
1596 // fgHUDAddLabel ( hud, 160, 150, SMALL, NOBLINK,
1597 // RIGHT_JUST, NULL, " Kts", "%5.0f", get_speed );
1599 loc.top = 180; // Ignore
1600 loc.right = 200; // Ignore
1602 HIptr = (instr_item *) new instr_label ( loc,
1614 case 7: // Digital Altimeter
1615 // fgHUDAddLabel ( hud, 160, 135, SMALL, NOBLINK,
1616 // RIGHT_JUST, NULL, " m", "%5.0f", get_altitude );
1618 loc.top = 145; // Ignore
1619 loc.right = 200; // Ignore
1621 HIptr = (instr_item *) new instr_label ( loc,
1633 case 8: // Roll indication diagnostic
1634 // fgHUDAddLabel ( hud, 160, 120, SMALL, NOBLINK,
1635 // RIGHT_JUST, NULL, " Roll", "%5.2f", get_roll );
1637 loc.top = 130; // Ignore
1638 loc.right = 200; // Ignore
1640 HIptr = (instr_item *) new instr_label ( loc,
1652 case 9: // Angle of attack diagnostic
1653 // fgHUDAddLabel ( hud, 440, 150, SMALL, NOBLINK,
1654 // RIGHT_JUST, NULL, " AOA", "%5.2f", get_aoa );
1656 loc.top = 160; // Ignore
1657 loc.right = 500; // Ignore
1659 HIptr = (instr_item *) new instr_label ( loc,
1672 // fgHUDAddLabel ( hud, 440, 135, SMALL, NOBLINK,
1673 // RIGHT_JUST, NULL, " Heading", "%5.0f", get_heading );
1675 loc.top = 145; // Ignore
1676 loc.right = 500; // Ignore
1678 HIptr = (instr_item *) new instr_label ( loc,
1691 // fgHUDAddLabel ( hud, 440, 120, SMALL, NOBLINK,
1692 // RIGHT_JUST, NULL, " Sideslip", "%5.2f", get_sideslip );
1694 loc.top = 130; // Ignore
1695 loc.right = 500; // Ignore
1697 HIptr = (instr_item *) new instr_label ( loc,
1711 loc.top = 90; // Ignore
1712 loc.right = 440; // Ignore
1714 HIptr = (instr_item *) new instr_label( loc, get_throttleval,
1727 loc.top = 70; // Ignore
1728 loc.right = 500; // Ignore
1730 HIptr = (instr_item *) new instr_label( loc, get_elevatorval,
1743 loc.top = 100; // Ignore
1744 loc.right = 500; // Ignore
1746 HIptr = (instr_item *) new instr_label( loc, get_aileronval,
1759 loc.top = 100; // Ignore
1760 loc.right = 500; // Ignore
1762 HIptr = (instr_item *) new instr_label( loc, get_frame_rate,
1775 loc.top = 100; // Ignore
1776 loc.right = 500; // Ignore
1778 HIptr = (instr_item *) new instr_label( loc, get_vfc_ratio,
1791 loc.top = 100; // Ignore
1792 loc.right = 500; // Ignore
1794 HIptr = (instr_item *) new instr_label( loc, get_fov,
1805 // fgHUDAddControlSurfaces( hud, 10, 10, NULL );
1809 // loc.bottom = 180;
1810 // HIptr = (instr_item *) new
1815 if( HIptr ) { // Anything to install?
1816 HUD_deque.insert( HUD_deque.begin(), HIptr);
1820 // fgHUDAddControl( hud, HORIZONTAL, 50, 25, get_aileronval ); // was 10, 10
1821 // fgHUDAddControl( hud, VERTICAL, 150, 25, get_elevatorval ); // was 10, 10
1822 // fgHUDAddControl( hud, HORIZONTAL, 250, 25, get_rudderval ); // was 10, 10
1823 return 0; // For now. Later we may use this for an error code.
1829 // Performs a once around the list of calls to instruments installed in
1830 // the HUD object with requests for redraw. Kinda. It will when this is
1833 int global_day_night_switch = DAY;
1835 void fgUpdateHUD( void ) {
1838 // int day_night_sw = current_aircraft.controls->day_night_switch;
1839 int day_night_sw = global_day_night_switch;
1840 int hud_displays = HUD_deque.size();
1841 instr_item *pHUDInstr;
1843 if( !hud_displays ) { // Trust everyone, but ALWAYS cut the cards!
1847 pHUDInstr = HUD_deque[0];
1848 brightness = pHUDInstr->get_brightness();
1849 // brightness = HUD_deque.at(0)->get_brightness();
1851 glMatrixMode(GL_PROJECTION);
1855 gluOrtho2D(0, 640, 0, 480);
1856 glMatrixMode(GL_MODELVIEW);
1860 glColor3f(1.0, 1.0, 1.0);
1863 glDisable(GL_DEPTH_TEST);
1864 glDisable(GL_LIGHTING);
1868 for( i = hud_displays; i; --i) { // Draw everything
1869 // if( HUD_deque.at(i)->enabled()) {
1870 pHUDInstr = HUD_deque[i - 1];
1871 if( pHUDInstr->enabled()) {
1872 // We should to respond to a dial instead
1873 // or as well to the of time of day. Of
1874 // course, we have no dial!
1875 if( day_night_sw == DAY) {
1876 switch (brightness) {
1878 glColor3f (0.1, 0.9, 0.1);
1882 glColor3f (0.1, 0.7, 0.0);
1886 glColor3f (0.0, 0.5, 0.0);
1890 if( day_night_sw == NIGHT) {
1891 switch (brightness) {
1893 glColor3f (0.9, 0.1, 0.1);
1897 glColor3f (0.7, 0.0, 0.1);
1902 glColor3f (0.5, 0.0, 0.0);
1905 else { // Just in case default
1906 glColor3f (0.1, 0.9, 0.1);
1909 // fgPrintf( FG_COCKPIT, FG_DEBUG, "HUD Code %d Status %d\n",
1910 // hud->code, hud->status );
1912 // HUD_deque.at(i)->draw(); // Responsible for broken or fixed variants.
1913 // No broken displays honored just now.
1917 glEnable(GL_DEPTH_TEST);
1918 glEnable(GL_LIGHTING);
1919 glMatrixMode(GL_PROJECTION);
1921 glMatrixMode(GL_MODELVIEW);
1926 /* Revision 1.11 1998/06/05 18:17:10 curt
1927 /* Added the declaration of memmove needed by the stl which apparently
1928 /* solaris only defines for cc compilations and not for c++ (__STDC__)
1930 * Revision 1.10 1998/05/17 16:58:12 curt
1931 * Added a View Frustum Culling ratio display to the hud.
1933 * Revision 1.9 1998/05/16 13:04:14 curt
1934 * New updates from Charlie Hotchkiss.
1936 * Revision 1.8 1998/05/13 18:27:54 curt
1937 * Added an fov to hud display.
1939 * Revision 1.7 1998/05/11 18:13:11 curt
1940 * Complete C++ rewrite of all cockpit code by Charlie Hotchkiss.
1942 * Revision 1.22 1998/04/18 04:14:02 curt
1943 * Moved fg_debug.c to it's own library.
1945 * Revision 1.21 1998/04/03 21:55:28 curt
1946 * Converting to Gnu autoconf system.
1949 * Revision 1.20 1998/03/09 22:48:40 curt
1950 * Minor "formatting" tweaks.
1952 * Revision 1.19 1998/02/23 20:18:28 curt
1953 * Incorporated Michele America's hud changes.
1955 * Revision 1.18 1998/02/21 14:53:10 curt
1956 * Added Charlie's HUD changes.
1958 * Revision 1.17 1998/02/20 00:16:21 curt
1959 * Thursday's tweaks.
1961 * Revision 1.16 1998/02/19 13:05:49 curt
1962 * Incorporated some HUD tweaks from Michelle America.
1963 * Tweaked the sky's sunset/rise colors.
1964 * Other misc. tweaks.
1966 * Revision 1.15 1998/02/16 13:38:39 curt
1967 * Integrated changes from Charlie Hotchkiss.
1969 * Revision 1.14 1998/02/12 21:59:41 curt
1970 * Incorporated code changes contributed by Charlie Hotchkiss
1971 * <chotchkiss@namg.us.anritsu.com>
1973 * Revision 1.12 1998/02/09 15:07:48 curt
1976 * Revision 1.11 1998/02/07 15:29:34 curt
1977 * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
1978 * <chotchkiss@namg.us.anritsu.com>
1980 * Revision 1.10 1998/02/03 23:20:14 curt
1981 * Lots of little tweaks to fix various consistency problems discovered by
1982 * Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
1983 * passed arguments along to the real printf(). Also incorporated HUD changes
1984 * by Michele America.
1986 * Revision 1.9 1998/01/31 00:43:04 curt
1987 * Added MetroWorks patches from Carmen Volpe.
1989 * Revision 1.8 1998/01/27 00:47:51 curt
1990 * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
1991 * system and commandline/config file processing code.
1993 * Revision 1.7 1998/01/19 18:40:20 curt
1994 * Tons of little changes to clean up the code and to remove fatal errors
1995 * when building with the c++ compiler.
1997 * Revision 1.6 1997/12/15 23:54:34 curt
1998 * Add xgl wrappers for debugging.
1999 * Generate terrain normals on the fly.
2001 * Revision 1.5 1997/12/10 22:37:39 curt
2002 * Prepended "fg" on the name of all global structures that didn't have it yet.
2003 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
2005 * Revision 1.4 1997/09/23 00:29:32 curt
2006 * Tweaks to get things to compile with gcc-win32.
2008 * Revision 1.3 1997/09/05 14:17:26 curt
2009 * More tweaking with stars.
2011 * Revision 1.2 1997/09/04 02:17:30 curt
2014 * Revision 1.1 1997/08/29 18:03:22 curt