]> git.mxchange.org Git - flightgear.git/commitdiff
Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
authorcurt <curt>
Sat, 7 Feb 1998 15:29:31 +0000 (15:29 +0000)
committercurt <curt>
Sat, 7 Feb 1998 15:29:31 +0000 (15:29 +0000)
<chotchkiss@namg.us.anritsu.com>

25 files changed:
Aircraft/aircraft.c
Aircraft/aircraft.h
Astro/moon.c
Astro/sky.c
Cockpit/cockpit.c
Cockpit/cockpit.h
Cockpit/hud.c
Cockpit/hud.h
Controls/controls.c
Controls/controls.h
FDM/flight.c
FDM/flight.h
LaRCsim/ls_interface.c
LaRCsim/ls_interface.h
Main/GLUTkey.c
Main/GLUTmain.c
Main/fg_debug.c
Main/fg_debug.h
Main/fg_init.c
Main/views.c
Main/views.h
Scenery/tilemgr.c
Slew/slew.c
Time/fg_time.c
Time/fg_time.h

index 62673933efa020883c2c2faca6b03c4e9583f4ca..5d478b8325b64f2fa848429c846dff621a54a768 100644 (file)
 
 /* This is a record containing all the info for the aircraft currently
    being operated */
-struct fgAIRCRAFT current_aircraft;
+fgAIRCRAFT current_aircraft;
+
+
+/* Initialize an Aircraft structure */
+void fgAircraftInit( void ) {
+    fgPrintf( FG_AIRCRAFT, FG_INFO, "Initializing Aircraft structure\n" );
+
+    current_aircraft.flight = &cur_flight_params;
+    current_aircraft.controls = &cur_control_params;
+}
 
 
 /* Display various parameters to stdout */
-void fgAircraftOutputCurrent(struct fgAIRCRAFT *a) {
-    struct fgFLIGHT *f;
-    struct fgCONTROLS *c;
+void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
+    fgFLIGHT *f;
+    fgCONTROLS *c;
 
-    f = &a->flight;
-    c = &a->controls;
+    f = a->flight;
+    c = a->controls;
 
     fgPrintf( FG_FLIGHT, FG_DEBUG,
              "Pos = (%.2f,%.2f,%.2f)  (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n",
@@ -55,10 +64,14 @@ void fgAircraftOutputCurrent(struct fgAIRCRAFT *a) {
 
 
 /* $Log$
-/* Revision 1.15  1998/01/27 00:47:46  curt
-/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
-/* system and commandline/config file processing code.
+/* Revision 1.16  1998/02/07 15:29:31  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.15  1998/01/27 00:47:46  curt
+ * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+ * system and commandline/config file processing code.
+ *
  * Revision 1.14  1998/01/19 19:26:56  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index b0b8ff3c1f370c5a0c6e0ad0be09a06a73a0ebf8..cbdc86b19ab08916d3090ff99726e6eeafcaf89f 100644 (file)
 
 
 /* Define a structure containing all the parameters for an aircraft */
-struct fgAIRCRAFT {
-    struct fgFLIGHT flight;
-    struct fgCONTROLS controls;
-};
+typedef struct{
+    fgFLIGHT   *flight;
+    fgCONTROLS *controls;
+} fgAIRCRAFT ;
 
 
 /* current_aircraft contains all the parameters of the aircraft
    currently being operated. */
-extern struct fgAIRCRAFT current_aircraft;
+extern fgAIRCRAFT current_aircraft;
+
+
+/* Initialize an Aircraft structure */
+void fgAircraftInit( void );
 
 
 /* Display various parameters to stdout */
-void fgAircraftOutputCurrent(struct fgAIRCRAFT *a);
+void fgAircraftOutputCurrent(fgAIRCRAFT *a);
 
 
 #endif /* _AIRCRAFT_H */
 
 
 /* $Log$
-/* Revision 1.9  1998/01/22 02:59:23  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.10  1998/02/07 15:29:32  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.9  1998/01/22 02:59:23  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
  * Revision 1.8  1998/01/19 19:26:57  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
@@ -63,9 +71,13 @@ void fgAircraftOutputCurrent(struct fgAIRCRAFT *a);
 
 
 /* $Log$
-/* Revision 1.9  1998/01/22 02:59:23  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.10  1998/02/07 15:29:32  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.9  1998/01/22 02:59:23  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
  * Revision 1.8  1998/01/19 19:26:57  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index 4717c695b77dfba0172c385d81f12874319b06f3..11c63667c0119ef8f75761bbee4a17724e09545e 100644 (file)
@@ -58,11 +58,11 @@ struct CelestialCoord fgCalculateMoon(struct OrbElements params,
     xv, yv, v, r, xh, yh, zh, xg, yg, zg, xe, ye, ze,
     Ls, Lm, D, F, mpar, gclat, rho, HA, g;
   
-  struct fgAIRCRAFT *a;
-  struct fgFLIGHT *f;
+  fgAIRCRAFT *a;
+  fgFLIGHT *f;
 
   a = &current_aircraft;
-  f = &a->flight;
+  f = a->flight;
   
   /* calculate the angle between ecliptic and equatorial coordinate
    * system, in Radians */
@@ -226,9 +226,13 @@ void fgMoonRender( void ) {
 
 
 /* $Log$
-/* Revision 1.5  1998/02/02 20:53:21  curt
-/* To version 0.29
+/* Revision 1.6  1998/02/07 15:29:32  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.5  1998/02/02 20:53:21  curt
+ * To version 0.29
+ *
  * Revision 1.4  1998/01/27 00:47:46  curt
  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
  * system and commandline/config file processing code.
index 15cdf77594db03e02ee7bf7228e939689074d2a2..0244236aa267964a4b6da2a383cf118b01cc5d9f 100644 (file)
@@ -248,13 +248,13 @@ void fgSkyInit( void ) {
 
 /* Draw the Sky */
 void fgSkyRender( void ) {
-    struct fgFLIGHT *f;
+    fgFLIGHT *f;
     struct fgLIGHT *l;
     struct fgVIEW *v;
     float /* inner_color[4], middle_color[4], diff, */ east_dot, dot, angle;
     int i;
 
-    f = &current_aircraft.flight;
+    f = current_aircraft.flight;
     l = &cur_light_params;
     v = &current_view;
 
@@ -353,10 +353,14 @@ void fgSkyRender( void ) {
 
 
 /* $Log$
-/* Revision 1.5  1998/01/27 00:47:48  curt
-/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
-/* system and commandline/config file processing code.
+/* Revision 1.6  1998/02/07 15:29:32  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.5  1998/01/27 00:47:48  curt
+ * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+ * system and commandline/config file processing code.
+ *
  * Revision 1.4  1998/01/26 15:54:28  curt
  * Added a "skirt" to try to help hide gaps between scenery and sky.  This will
  * have to be revisited in the future.
index 8a22819cb006788a66ffa96ebd4c4e875d2be88a..8b4b21f76ef9c1084bb29226078b5c4b3479f823 100644 (file)
@@ -22,7 +22,7 @@
  * $Id$
  * (Log is kept at end of this file)
  **************************************************************************/
+
 
 #include <GL/glut.h>
 
 
 #include <Main/fg_debug.h>
 
-// #define DEBUG
+// This is a structure that contains all data related to
+// cockpit/panel/hud system
 
-/* This is a structure that contains all data related to cockpit/panel/hud system */
-static struct fgCOCKPIT *aircraft_cockpit;
+static fgCOCKPIT *aircraft_cockpit;
 
-struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft )
+fgCOCKPIT *fgCockpitInit( fgAIRCRAFT *cur_aircraft )
 {
-       struct fgCOCKPIT *cockpit;
+       fgCOCKPIT *cockpit;
        Hptr hud;
-       
+
        fgPrintf( FG_COCKPIT, FG_INFO, "Initializing cockpit subsystem\n");
 
-       cockpit = (struct fgCOCKPIT *)calloc(sizeof(struct fgCOCKPIT),1);
+       cockpit = (fgCOCKPIT *)calloc(sizeof(fgCOCKPIT),1);
        if( cockpit == NULL )
                return( NULL );
-               
+
        cockpit->code = 1;      /* It will be aircraft dependent */
        cockpit->status = 0;
-       
-       /* If aircraft has HUD */
-       hud = fgHUDInit( cur_aircraft, 3 );
+
+       // If aircraft has HUD
+       hud = fgHUDInit( cur_aircraft );  // Color no longer in parameter list
        if( hud == NULL )
                return( NULL );
-       
+
        cockpit->hud = hud;
-       
+
        aircraft_cockpit = cockpit;
-       
+
        fgPrintf( FG_COCKPIT, FG_INFO,
-                 "  Code %d  Status %d\n", cockpit->hud->code, cockpit->hud->status );
-               
+                 "  Code %d  Status %d\n", 
+                 cockpit->hud->code, cockpit->hud->status );
+
        return( cockpit );
 }
 
-struct fgCOCKPIT *fgCockpitAddHUD( struct fgCOCKPIT *cockpit, struct HUD *hud )
+fgCOCKPIT *fgCockpitAddHUD( fgCOCKPIT *cockpit, HUD *hud )
 {
        cockpit->hud = hud;
        return(cockpit);
@@ -94,12 +95,16 @@ void fgCockpitUpdate( void )
 
 
 /* $Log$
-/* Revision 1.9  1998/02/03 23:20:14  curt
-/* Lots of little tweaks to fix various consistency problems discovered by
-/* Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
-/* passed arguments along to the real printf().  Also incorporated HUD changes
-/* by Michele America.
+/* Revision 1.10  1998/02/07 15:29:33  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.9  1998/02/03 23:20:14  curt
+ * Lots of little tweaks to fix various consistency problems discovered by
+ * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
+ * passed arguments along to the real printf().  Also incorporated HUD changes
+ * by Michele America.
+ *
  * Revision 1.8  1998/01/31 00:43:03  curt
  * Added MetroWorks patches from Carmen Volpe.
  *
index 6de1d0ca1de323a0e58620046975b93d479d7661..237397b6633ab7575f4b7f13b893274cabc28cea 100644 (file)
 // And in the future (near future i hope).
 // #include <Cockpit/panel.h>
 
-struct fgCOCKPIT {
+typedef struct  {
        int code;
        Hptr hud;
        // As above.
        // PANEL *panel;
        int status;
-};
+}fgCOCKPIT, *pfgCockpit;
 
-struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft );
+fgCOCKPIT *fgCockpitInit( fgAIRCRAFT *cur_aircraft );
 void fgCockpitUpdate( void );
 
 
@@ -50,9 +50,13 @@ void fgCockpitUpdate( void );
 
 
 /* $Log$
-/* Revision 1.5  1998/01/22 02:59:29  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.6  1998/02/07 15:29:33  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.5  1998/01/22 02:59:29  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
  * Revision 1.4  1998/01/19 19:27:01  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index dce3cb5730046423b72cc8c732ce6c1f4114fdb6..590fda67ca5f25d3805034810aa89de899e41726 100644 (file)
 
 #include "hud.h"
 
-#include <Aircraft/aircraft.h>
 #include <Include/fg_constants.h>
+#include <Aircraft/aircraft.h>
 #include <Main/fg_debug.h>
 #include <Math/fg_random.h>
 #include <Math/mat3.h>
 #include <Math/polar.h>
 #include <Scenery/scenery.h>
+// #include <Scenery/mesh.h>   /* not used any more :-) */
 #include <Time/fg_timer.h>
 #include <Weather/weather.h>
 
 #define drawOneLine(x1,y1,x2,y2)  glBegin(GL_LINES);  \
    glVertex2f ((x1),(y1)); glVertex2f ((x2),(y2)); glEnd();
    
-/* textString - Bitmap font string */
+
+// The following routines obtain information concerntin the aircraft's
+// current state and return it to calling instrument display routines.
+// They should eventually be member functions of the aircraft.
+//
+
+double get_speed( void )
+{
+       fgFLIGHT *f;
+
+       f = current_aircraft.flight;
+       return( FG_V_equiv_kts );    // Make an explicit function call.
+}
+
+double get_aoa( void )
+{
+       fgFLIGHT *f;
+              
+       f = current_aircraft.flight;
+       return( FG_Gamma_vert_rad * RAD_TO_DEG );
+}
+
+double get_roll( void )
+{
+       fgFLIGHT *f;
+              
+       f = current_aircraft.flight;
+       return( FG_Phi );
+}
+
+double get_pitch( void )
+{
+       fgFLIGHT *f;
+              
+       f = current_aircraft.flight;
+       return( FG_Theta );
+}
+
+double get_heading( void )
+{
+       fgFLIGHT *f;
+
+       f = current_aircraft.flight;
+       return( FG_Psi*RAD_TO_DEG );
+}
+
+double get_altitude( void )
+{
+       fgFLIGHT *f;
+       // double rough_elev;
+
+       f = current_aircraft.flight;
+       // rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
+       //                                 FG_Latitude  * RAD_TO_ARCSEC);
+
+       return( FG_Altitude * FEET_TO_METER /* -rough_elev */ );
+}
+
+//
+// The following code deals with painting the "instrument" on the display
+//
+   /* textString - Bitmap font string */
 
 static void textString(int x, int y, char *msg, void *font)
 {
@@ -65,313 +127,404 @@ static void textString(int x, int y, char *msg, void *font)
 }
 
 /* strokeString - Stroke font string */
-/* static void strokeString(int x, int y, char *msg, void *font) */
-/* { */
-/*     glPushMatrix(); */
-/*     glTranslatef(x, y, 0); */
-/*     glScalef(.04, .04, .04); */
-/*     while (*msg) { */
-/*             glutStrokeCharacter(font, *msg); */
-/*             msg++; */
-/*     } */
-/*     glPopMatrix(); */
-/* } */
+/*
+static void strokeString(int x, int y, char *msg, void *font)
+{
+       glPushMatrix();
+       glTranslatef(x, y, 0);
+       glScalef(.04, .04, .04);
+       while (*msg) {
+               glutStrokeCharacter(font, *msg);
+               msg++;
+       }
+       glPopMatrix();
+}
+*/
 
 /*
 
        Draws a measuring scale anywhere on the HUD
-               
-       
+
+
        Needs: HUD_scale struct
 
 */
-static void drawscale( int type, int sub_type, int min_value, int orientation, int scr_pos, \
-               int scr_min, int scr_max, double total_amount, int min_div, int max_div, \
-               double cur_value )
+static void drawscale( HUD_scale * pscale )
 {
-    double vmin, vmax;
-    int marker_x, marker_y;
-    int mid_scr;
-    // int scale_min, scale_max;
-    register i;
-    double factor;
-    char TextScale[80];
-    int condition;
-
-    vmin = cur_value-total_amount/2;
-    vmax = cur_value+total_amount/2;
-    
-    mid_scr = scr_min+(scr_max-scr_min)/2;
-    
-    if( type == VERTICAL )     // Vertical scale
+  double vmin, vmax;
+  int marker_x;
+  int marker_y;
+  int mid_scr;
+  register i;
+  double factor;
+  char TextScale[80];
+  int condition;
+  double cur_value = (*(pscale->load_value))();
+
+  vmin = cur_value - pscale->maximum_value / 2;
+  vmax = cur_value + pscale->maximum_value / 2;
+
+  mid_scr = pscale->scr_min+(pscale->scr_max-pscale->scr_min)/2;
+
+  if( pscale->type == VERTICAL )     // Vertical scale
     {
-        if( orientation == LEFT )
-            marker_x = scr_pos-6;
-        else if( orientation == RIGHT )
-            marker_x = scr_pos;
-        drawOneLine( scr_pos, scr_min, scr_pos, scr_max );
-        if( orientation == LEFT )
+    if( pscale->orientation == LEFT )
+      marker_x = pscale->scr_pos-6;
+    else
+      if( pscale->orientation == RIGHT )
+        marker_x = pscale->scr_pos;
+    drawOneLine( pscale->scr_pos,
+                 pscale->scr_min,
+                 pscale->scr_pos,
+                 pscale->scr_max );
+    if( pscale->orientation == LEFT )
+      {
+      drawOneLine( pscale->scr_pos-3,
+                   pscale->scr_min,
+                   pscale->scr_pos,
+                   pscale->scr_min );
+
+      drawOneLine( pscale->scr_pos-3,
+                   pscale->scr_max,
+                   pscale->scr_pos,
+                   pscale->scr_max );
+
+      drawOneLine( pscale->scr_pos,
+                   mid_scr,
+                   pscale->scr_pos+6,
+                   mid_scr );
+
+      }
+    else
+      if( pscale->orientation == RIGHT )
         {
-            drawOneLine( scr_pos-3, scr_min, scr_pos, scr_min );
-            drawOneLine( scr_pos-3, scr_max, scr_pos, scr_max );
-            drawOneLine( scr_pos, mid_scr, scr_pos+6, mid_scr );
-        } else if( orientation == RIGHT )
-        {
-            drawOneLine( scr_pos, scr_min, scr_pos+3, scr_min );
-            drawOneLine( scr_pos, scr_max, scr_pos+3, scr_max );
-            drawOneLine( scr_pos, mid_scr, scr_pos-6, mid_scr );
+        drawOneLine( pscale->scr_pos,
+                     pscale->scr_min,
+                     pscale->scr_pos+3,
+                     pscale->scr_min );
+
+        drawOneLine( pscale->scr_pos,
+                     pscale->scr_max,
+                     pscale->scr_pos+3,
+                     pscale->scr_max );
+
+        drawOneLine( pscale->scr_pos,
+                     mid_scr,
+                     pscale->scr_pos-6,
+                     mid_scr );
         }
 
-        factor = (scr_max-scr_min)/total_amount;
+    factor = (pscale->scr_max - pscale->scr_min)/pscale->maximum_value;
 
-        for( i=vmin; i<=vmax; i+=1 )
+    for( i=vmin; i<=vmax; i+=1 )
+      {
+      if( pscale->sub_type == LIMIT )
+        condition = i>= pscale->minimum_value;
+      else
+        if( pscale->sub_type == NOLIMIT )
+          condition = 1;
+
+      if( condition )
         {
-               if( sub_type == LIMIT )
-                       condition = i>= min_value;
-               else if( sub_type == NOLIMIT )
-                       condition = 1;
-                       
-            if( condition )
+        marker_y = pscale->scr_min+(i-vmin)*factor;
+        if( i%pscale->div_min==0 )
+          if( pscale->orientation == LEFT )
             {
-                marker_y = scr_min+(i-vmin)*factor;
-                if( i%min_div==0 )
-                    if( orientation == LEFT )
-                    {
-                       drawOneLine( marker_x+3, marker_y, marker_x+6, marker_y );
-                    }
-                    else if( orientation == RIGHT )
-                    {
-                       drawOneLine( marker_x, marker_y, marker_x+3, marker_y );
-                    }
-                if( i%max_div==0 )
+            drawOneLine( marker_x+3, marker_y, marker_x+6, marker_y );
+            }
+          else
+            if( pscale->orientation == RIGHT )
+              {
+              drawOneLine( marker_x, marker_y, marker_x+3, marker_y );
+              }
+            if( i%pscale->div_max==0 )
+              {
+              drawOneLine( marker_x, marker_y, marker_x+6, marker_y );
+              sprintf( TextScale, "%d", i );
+              if( pscale->orientation == LEFT )
                 {
-                       drawOneLine( marker_x, marker_y, marker_x+6, marker_y );
-                    sprintf( TextScale, "%d", i );
-                    if( orientation == LEFT )
-                    {
-                       textString( marker_x-8*strlen(TextScale)-2, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
-                    }
-                    else if( orientation == RIGHT )
-                    {
-                       textString( marker_x+10, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
-                    }
+                textString( marker_x-8*strlen(TextScale)-2, marker_y-4,
+                            TextScale, GLUT_BITMAP_8_BY_13 );
                 }
-            }
-        }
+              else
+                if( pscale->orientation == RIGHT )
+                  {
+                  textString( marker_x+10, marker_y-4,
+                              TextScale, GLUT_BITMAP_8_BY_13 );
+                  }
+              }
+         }
+      } // End for range of i from vmin to vmax
     }
-    if( type == HORIZONTAL )     // Horizontal scale
+  if( pscale->type == HORIZONTAL )     // Horizontal scale
     {
-        if( orientation == TOP )
-            marker_y = scr_pos;
-        else if( orientation == BOTTOM )
-            marker_y = scr_pos-6;
-        drawOneLine( scr_min, scr_pos, scr_max, scr_pos );
-        if( orientation == TOP )
+    if( pscale->orientation == TOP )
+      marker_y = pscale->scr_pos;
+    else
+      if( pscale->orientation == BOTTOM )
+        marker_y = pscale->scr_pos-6;
+    drawOneLine( pscale->scr_min,
+                 pscale->scr_pos,
+                 pscale->scr_max,
+                 pscale->scr_pos );
+    if( pscale->orientation == TOP )
+      {
+      drawOneLine( pscale->scr_min,
+                   pscale->scr_pos,
+                   pscale->scr_min,
+                   pscale->scr_pos-3 );
+
+      drawOneLine( pscale->scr_max,
+                   pscale->scr_pos,
+                   pscale->scr_max,
+                   pscale->scr_pos-3 );
+
+      drawOneLine( mid_scr,
+                   pscale->scr_pos,
+                   mid_scr,
+                   pscale->scr_pos-6 );
+
+      }
+    else
+      if( pscale->orientation == BOTTOM )
         {
-               drawOneLine( scr_min, scr_pos, scr_min, scr_pos-3 );
-            drawOneLine( scr_max, scr_pos, scr_max, scr_pos-3 );
-            drawOneLine( mid_scr, scr_pos, mid_scr, scr_pos-6 );
-        } else if( orientation == BOTTOM )
-        {
-               drawOneLine( scr_min, scr_pos, scr_min, scr_pos+3 );
-            drawOneLine( scr_max, scr_pos, scr_max, scr_pos+3 );
-            drawOneLine( mid_scr, scr_pos, mid_scr, scr_pos+6 );
+        drawOneLine( pscale->scr_min,
+                     pscale->scr_pos,
+                     pscale->scr_min,
+                     pscale->scr_pos+3 );
+
+        drawOneLine( pscale->scr_max,
+                     pscale->scr_pos,
+                     pscale->scr_max,
+                     pscale->scr_pos+3 );
+
+        drawOneLine( mid_scr,
+                     pscale->scr_pos,
+                     mid_scr,
+                     pscale->scr_pos+6 );
         }
 
-        factor = (scr_max-scr_min)/total_amount;
+    factor = (pscale->scr_max - pscale->scr_min)/pscale->maximum_value;
 
-        for( i=vmin; i<=vmax; i+=1 )
+    for( i=vmin; i<=vmax; i+=1 )
+      {
+      if( pscale->sub_type == LIMIT )
+        condition = i>= pscale->minimum_value;
+      else
+        if( pscale->sub_type == NOLIMIT )
+          condition = 1;
+
+      if( condition )
         {
-               if( sub_type == LIMIT )
-                       condition = i>= min_value;
-               else if( sub_type == NOLIMIT )
-                       condition = 1;
-                       
-            if( condition )
+        marker_x = pscale->scr_min+(i-vmin)*factor;
+        if( i%pscale->div_min==0 )
+          if( pscale->orientation == TOP )
+            {
+            drawOneLine( marker_x, marker_y, marker_x, marker_y+3 );
+            }
+          else
+            if( pscale->orientation == BOTTOM )
+              {
+              drawOneLine( marker_x, marker_y+3, marker_x, marker_y+6 );
+              }
+          if( i%pscale->div_max==0 )
             {
-                marker_x = scr_min+(i-vmin)*factor;
-                if( i%min_div==0 )
-                    if( orientation == TOP )
-                    {
-                       drawOneLine( marker_x, marker_y, marker_x, marker_y+3 );
-                       }
-                    else if( orientation == BOTTOM )
-                    {
-                       drawOneLine( marker_x, marker_y+3, marker_x, marker_y+6 );
-                    }
-                if( i%max_div==0 )
+            sprintf( TextScale, "%d", i );
+            if( pscale->orientation == TOP )
+              {
+              drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
+              textString ( marker_x-4*strlen(TextScale), marker_y+14,
+                           TextScale, GLUT_BITMAP_8_BY_13 );
+              }
+            else
+              if( pscale->orientation == BOTTOM )
                 {
-                    sprintf( TextScale, "%d", i );
-                    if( orientation == TOP )
-                    {
-                       drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
-                       textString( marker_x-4*strlen(TextScale), marker_y+14, TextScale, GLUT_BITMAP_8_BY_13 );
-                    }
-                    else if( orientation == BOTTOM )
-                    {
-                       drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
-                       textString( marker_x+10, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
-                    }
+                drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
+                textString ( marker_x+10, marker_y-4,
+                             TextScale, GLUT_BITMAP_8_BY_13 );
                 }
             }
         }
+      }
     }
 
-}              
+}
 
 /*
 
        Draws a climb ladder in the center of the HUD
-               
-       
-       Needs: HUD_ladder struct
 
 */
-static void drawladder( struct HUD_ladder ladder )
+
+static void drawladder( HUD_ladder *ladder )
 {
-    double vmin, vmax;
-    double roll_value, pitch_value;
-    /* double cos_roll, sin_roll; */
-    int marker_x, marker_y;
-    int mid_scr;
-    int scr_min, scr_max;
-    int x_ini, x_end;
-    int y_ini, y_end;
-    int new_x_ini, new_x_end;
-    int new_y_ini, new_y_end;
-    register i;
-    double factor;
-    char TextLadder[80];
-    int condition;
-
-       roll_value = (*ladder.load_roll)();
-       pitch_value = (*ladder.load_pitch)()*RAD_TO_DEG;
-       
-    vmin = pitch_value-ladder.width_units/2;
-    vmax = pitch_value+ladder.width_units/2;
-    
-    scr_min = ladder.y_pos-(ladder.scr_height/2);
-    scr_max = scr_min+ladder.scr_height;
+  double vmin, vmax;
+  double roll_value, pitch_value;
+  int marker_x, marker_y;
+#ifdef DEBUGHUD
+  int mid_scr;
+#endif
+  int scr_min, scr_max;
+  int x_ini, x_end;
+  int y_ini, y_end;
+  int new_x_ini, new_x_end;
+  int new_y_ini, new_y_end;
+  register i;
+  double factor;
+  char TextLadder[80];
+  int condition;
+
+  roll_value = (*ladder->load_roll)();
+  pitch_value = (*ladder->load_pitch)()*RAD_TO_DEG;
+
+  vmin = pitch_value - ladder->width_units/2;
+  vmax = pitch_value + ladder->width_units/2;
     
-    mid_scr = scr_min+(scr_max-scr_min)/2;
+  scr_min = ladder->y_pos - (ladder->scr_height/2);
+  scr_max = scr_min       + ladder->scr_height;
 
-       marker_x = ladder.x_pos-ladder.scr_width/2;
-       
-    factor = (scr_max-scr_min)/ladder.width_units;
+#ifdef DEBUGHUD
+  mid_scr = scr_min       + (scr_max-scr_min)/2;
+#endif
 
-    for( i=vmin; i<=vmax; i+=1 )
+  marker_x = ladder->x_pos - ladder->scr_width/2;
+
+  factor = (scr_max-scr_min)/ladder->width_units;
+
+  for( i=vmin; i<=vmax; i+=1 )
     {
-       condition = 1;
-        if( condition )
+    condition = 1;
+    if( condition )
+      {
+      marker_y = scr_min+(i-vmin)*factor;
+      if( i%ladder->div_units==0 )
         {
-            marker_y = scr_min+(i-vmin)*factor;
-            if( i%ladder.div_units==0 )
+        sprintf( TextLadder, "%d", i );
+        if( ladder->scr_hole == 0 )
+          {
+          if( i )
+            x_ini = ladder->x_pos - ladder->scr_width/2;
+          else
+            x_ini = ladder->x_pos - ladder->scr_width/2 - 10;
+          y_ini = marker_y;
+          x_end = ladder->x_pos + ladder->scr_width/2;
+          y_end = marker_y;
+          new_x_ini = ladder->x_pos +                             \
+                      (x_ini - ladder->x_pos) * cos(roll_value) - \
+                      (y_ini - ladder->y_pos) * sin(roll_value);
+          new_y_ini = ladder->y_pos +                             \
+                      (x_ini - ladder->x_pos) * sin(roll_value) + \
+                      (y_ini - ladder->y_pos) * cos(roll_value);
+          new_x_end = ladder->x_pos +                             \
+                      (x_end - ladder->x_pos) * cos(roll_value) - \
+                      (y_end - ladder->y_pos) * sin(roll_value);
+          new_y_end = ladder->y_pos +                             \
+                      (x_end - ladder->x_pos) * sin(roll_value) + \
+                      (y_end - ladder->y_pos) * cos(roll_value);
+
+          if( i >= 0 )
             {
-               sprintf( TextLadder, "%d", i );
-               if( ladder.scr_hole == 0 )
-               {
-                       if( i != 0 )
-                                       x_ini = ladder.x_pos-ladder.scr_width/2;
-                               else
-                                       x_ini = ladder.x_pos-ladder.scr_width/2-10;
-                               y_ini = marker_y;
-                               x_end = ladder.x_pos+ladder.scr_width/2;
-                               y_end = marker_y;
-                               new_x_ini = ladder.x_pos+(x_ini-ladder.x_pos)*cos(roll_value)-\
-                                       (y_ini-ladder.y_pos)*sin(roll_value);
-                               new_y_ini = ladder.y_pos+(x_ini-ladder.x_pos)*sin(roll_value)+\
-                                       (y_ini-ladder.y_pos)*cos(roll_value);
-                               new_x_end = ladder.x_pos+(x_end-ladder.x_pos)*cos(roll_value)-\
-                                       (y_end-ladder.y_pos)*sin(roll_value);
-                               new_y_end = ladder.y_pos+(x_end-ladder.x_pos)*sin(roll_value)+\
-                                       (y_end-ladder.y_pos)*cos(roll_value);
-   
-                                       if( i >= 0 )
-                                       {
-                               drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
-                       }
-                       else
-                       {
-                               glEnable(GL_LINE_STIPPLE);
-                               glLineStipple( 1, 0x00FF );
-                               drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
-                               glDisable(GL_LINE_STIPPLE);
-                       }
-                       textString( new_x_ini-8*strlen(TextLadder)-8, new_y_ini-4, TextLadder, GLUT_BITMAP_8_BY_13 );
-                       textString( new_x_end+10, new_y_end-4, TextLadder, GLUT_BITMAP_8_BY_13 );
-               }
-               else
-               {
-                       if( i != 0 )
-                                       x_ini = ladder.x_pos-ladder.scr_width/2;
-                               else
-                                       x_ini = ladder.x_pos-ladder.scr_width/2-10;
-                               y_ini = marker_y;
-                               x_end = ladder.x_pos-ladder.scr_width/2+ladder.scr_hole/2;
-                               y_end = marker_y;
-                               new_x_ini = ladder.x_pos+(x_ini-ladder.x_pos)*cos(roll_value)-\
-                                       (y_ini-ladder.y_pos)*sin(roll_value);
-                               new_y_ini = ladder.y_pos+(x_ini-ladder.x_pos)*sin(roll_value)+\
-                                       (y_ini-ladder.y_pos)*cos(roll_value);
-                               new_x_end = ladder.x_pos+(x_end-ladder.x_pos)*cos(roll_value)-\
-                                       (y_end-ladder.y_pos)*sin(roll_value);
-                               new_y_end = ladder.y_pos+(x_end-ladder.x_pos)*sin(roll_value)+\
-                                       (y_end-ladder.y_pos)*cos(roll_value);
-            
-                       if( i >= 0 )
-                       {
-                               drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
-                       }
-                       else
-                       {
-                               glEnable(GL_LINE_STIPPLE);
-                               glLineStipple( 1, 0x00FF );
-                               drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
-                               glDisable(GL_LINE_STIPPLE);
-                       }
-                       textString( new_x_ini-8*strlen(TextLadder)-8, new_y_ini-4, TextLadder, GLUT_BITMAP_8_BY_13 );
-                       
-                       x_ini = ladder.x_pos+ladder.scr_width/2-ladder.scr_hole/2;
-                               y_ini = marker_y;
-                               if( i != 0 )
-                                       x_end = ladder.x_pos+ladder.scr_width/2;
-                               else
-                                       x_end = ladder.x_pos+ladder.scr_width/2+10;
-                               y_end = marker_y;
-                               new_x_ini = ladder.x_pos+(x_ini-ladder.x_pos)*cos(roll_value)-\
-                                       (y_ini-ladder.y_pos)*sin(roll_value);
-                               new_y_ini = ladder.y_pos+(x_ini-ladder.x_pos)*sin(roll_value)+\
-                                       (y_ini-ladder.y_pos)*cos(roll_value);
-                               new_x_end = ladder.x_pos+(x_end-ladder.x_pos)*cos(roll_value)-\
-                                       (y_end-ladder.y_pos)*sin(roll_value);
-                               new_y_end = ladder.y_pos+(x_end-ladder.x_pos)*sin(roll_value)+\
-                                       (y_end-ladder.y_pos)*cos(roll_value);
-            
-                       if( i >= 0 )
-                       {
-                               drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
-                       }
-                       else
-                       {
-                               glEnable(GL_LINE_STIPPLE);
-                               glLineStipple( 1, 0x00FF );
-                               drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
-                               glDisable(GL_LINE_STIPPLE);
-                       }
-                       textString( new_x_end+10, new_y_end-4, TextLadder, GLUT_BITMAP_8_BY_13 );
-               }
+            drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
+            }
+          else
+            {
+            glEnable(GL_LINE_STIPPLE);
+            glLineStipple( 1, 0x00FF );
+            drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
+            glDisable(GL_LINE_STIPPLE);
+            }
+          textString( new_x_ini -  8 * strlen(TextLadder) - 8,
+                      new_y_ini -  4,
+                      TextLadder, GLUT_BITMAP_8_BY_13 );
+          textString( new_x_end + 10,
+                      new_y_end -  4,
+                      TextLadder, GLUT_BITMAP_8_BY_13 );
+          }
+        else
+          {
+          if( i != 0 )
+            x_ini = ladder->x_pos - ladder->scr_width/2;
+          else
+            x_ini = ladder->x_pos - ladder->scr_width/2 - 10;
+          y_ini = marker_y;
+          x_end = ladder->x_pos - ladder->scr_width/2 + ladder->scr_hole/2;
+          y_end = marker_y;
+          new_x_ini = ladder->x_pos+                             \
+                      (x_ini - ladder->x_pos) * cos(roll_value) -\
+                      (y_ini - ladder->y_pos) * sin(roll_value);
+          new_y_ini = ladder->y_pos+                             \
+                      (x_ini - ladder->x_pos) * sin(roll_value) +\
+                      (y_ini - ladder->y_pos) * cos(roll_value);
+          new_x_end = ladder->x_pos+                             \
+                      (x_end - ladder->x_pos) * cos(roll_value) -\
+                      (y_end - ladder->y_pos) * sin(roll_value);
+          new_y_end = ladder->y_pos+                             \
+                      (x_end - ladder->x_pos) * sin(roll_value) +\
+                      (y_end - ladder->y_pos) * cos(roll_value);
+
+          if( i >= 0 )
+            {
+            drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
+            }
+          else
+            {
+            glEnable(GL_LINE_STIPPLE);
+            glLineStipple( 1, 0x00FF );
+            drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
+            glDisable(GL_LINE_STIPPLE);
             }
-            /* if( i%max_div==0 )
+          textString( new_x_ini - 8 * strlen(TextLadder) - 8,
+                      new_y_ini - 4,
+                      TextLadder, GLUT_BITMAP_8_BY_13 );
+
+          x_ini = ladder->x_pos + ladder->scr_width/2 - ladder->scr_hole/2;
+          y_ini = marker_y;
+          if( i != 0 )
+            x_end = ladder->x_pos + ladder->scr_width/2;
+          else
+            x_end = ladder->x_pos + ladder->scr_width/2 + 10;
+          y_end = marker_y;
+          new_x_ini = ladder->x_pos +                        \
+                      (x_ini-ladder->x_pos)*cos(roll_value) -\
+                      (y_ini-ladder->y_pos)*sin(roll_value);
+          new_y_ini = ladder->y_pos +                        \
+                      (x_ini-ladder->x_pos)*sin(roll_value) +\
+                      (y_ini-ladder->y_pos)*cos(roll_value);
+          new_x_end = ladder->x_pos +                        \
+                      (x_end-ladder->x_pos)*cos(roll_value) -\
+                                        (y_end-ladder->y_pos)*sin(roll_value);
+          new_y_end = ladder->y_pos +                        \
+                      (x_end-ladder->x_pos)*sin(roll_value) +\
+                      (y_end-ladder->y_pos)*cos(roll_value);
+
+          if( i >= 0 )
+            {
+            drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
+            }
+          else
+            {
+            glEnable(GL_LINE_STIPPLE);
+            glLineStipple( 1, 0x00FF );
+            drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
+            glDisable(GL_LINE_STIPPLE);
+            }
+          textString( new_x_end+10, new_y_end-4,
+                      TextLadder, GLUT_BITMAP_8_BY_13 );
+          }
+        }
+            /* if( i%pscale->div_max==0 )
             {
                drawOneLine( marker_x, marker_y, marker_x+6, marker_y );
                 sprintf( TextScale, "%d", i );
-                if( orientation == LEFT )
+                if( pscale->orientation == LEFT )
                 {
-                       textString( marker_x-8*strlen(TextScale)-2, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
+                       textString( marker_x-8*strlen(TextScale)-2, marker_y-4,
+                              TextScale, GLUT_BITMAP_8_BY_13 );
                 }
-                else if( orientation == RIGHT )
+                else if( pscale->orientation == RIGHT )
                 {
-                       textString( marker_x+10, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
+                       textString( marker_x+10, marker_y-4,
+                              TextScale, GLUT_BITMAP_8_BY_13 );
                 }
             } */
         }
@@ -379,49 +532,45 @@ static void drawladder( struct HUD_ladder ladder )
 
 }
 
-/*
+//
+//     Draws an artificial horizon line in the center of the HUD
+//     (with or without a center hole)
+//
+//     Needs: x_center, y_center, length, hole
+//
 
-       Draws an artificial horizon line in the center of the HUD
-               (with or without a center hole)
-       
-       Needs: x_center, y_center, length, hole
-
-*/
-static void drawhorizon( struct HUD_horizon horizon )
+static void drawhorizon( HUD_horizon *horizon )
 {
-       int x_inc1, y_inc1;
-       int x_inc2, y_inc2;
-       /* struct fgFLIGHT *f; */
-       double sin_bank, cos_bank;
-       double bank_angle;
-              
-       /* f = &current_aircraft.flight; */
-       
-       bank_angle = (*horizon.load_value)();
+  int x_inc1, y_inc1;
+  int x_inc2, y_inc2;
+//     struct fgFLIGHT *f = &current_aircraft.flight;
+  double sin_bank, cos_bank;
+  double bank_angle;
+
+  bank_angle = (*horizon->load_value)();
 
        // sin_bank = sin( FG_2PI-FG_Phi );
        // cos_bank = cos( FG_2PI-FG_Phi );
-       sin_bank = sin(FG_2PI-bank_angle);
-       cos_bank = cos(FG_2PI-bank_angle);
-       x_inc1 = (int)(horizon.scr_width*cos_bank);
-       y_inc1 = (int)(horizon.scr_width*sin_bank);
-       x_inc2 = (int)(horizon.scr_hole*cos_bank);
-       y_inc2 = (int)(horizon.scr_hole*sin_bank);
-       
-       if( horizon.scr_hole == 0 )
-       {
-               drawOneLine( horizon.x_pos-x_inc1, horizon.y_pos-y_inc1, \
-                                               horizon.x_pos+x_inc1, horizon.y_pos+y_inc1 );
-       }
-       else
-       {
-               drawOneLine( horizon.x_pos-x_inc1, horizon.y_pos-y_inc1, \
-                                               horizon.x_pos-x_inc2, horizon.y_pos-y_inc2 );
-               drawOneLine( horizon.x_pos+x_inc2, horizon.y_pos+y_inc2, \
-                                               horizon.x_pos+x_inc1, horizon.y_pos+y_inc1 );
-       }       
+  sin_bank = sin(FG_2PI-bank_angle);
+  cos_bank = cos(FG_2PI-bank_angle);
+  x_inc1 = (int)(horizon->scr_width * cos_bank);
+  y_inc1 = (int)(horizon->scr_width * sin_bank);
+  x_inc2 = (int)(horizon->scr_hole  * cos_bank);
+  y_inc2 = (int)(horizon->scr_hole  * sin_bank);
+
+  if( horizon->scr_hole == 0 )
+    {
+    drawOneLine( horizon->x_pos - x_inc1, horizon->y_pos - y_inc1, \
+                 horizon->x_pos + x_inc1, horizon->y_pos + y_inc1 );
+    }
+  else
+    {
+    drawOneLine( horizon->x_pos - x_inc1, horizon->y_pos - y_inc1, \
+                 horizon->x_pos - x_inc2, horizon->y_pos - y_inc2 );
+    drawOneLine( horizon->x_pos + x_inc2, horizon->y_pos + y_inc2, \
+                 horizon->x_pos + x_inc1, horizon->y_pos + y_inc1 );
+    }
 }
-
 /*
 
        Draws a representation of the control surfaces in their current state
@@ -430,446 +579,476 @@ static void drawhorizon( struct HUD_horizon horizon )
        Needs: struct HUD_control_surfaces
 
 */
-static void drawcontrolsurfaces( struct HUD_control_surfaces ctrl_surf )
+static void drawControlSurfaces( HUD_control_surfaces *ctrl_surf )
 {
        int x_ini, y_ini;
        int x_end, y_end;
        /* int x_1, y_1; */
        /* int x_2, y_2; */
-       struct fgCONTROLS *c;
-       
-       x_ini = ctrl_surf.x_pos;
-       y_ini = ctrl_surf.y_pos;
-       x_end = x_ini+150;
-       y_end = y_ini+60;
-       
+       fgCONTROLS *c;
+
+       x_ini = ctrl_surf->x_pos;
+       y_ini = ctrl_surf->y_pos;
+       x_end = x_ini + 150;
+       y_end = y_ini + 60;
+
        drawOneLine( x_ini, y_ini, x_end, y_ini );
        drawOneLine( x_ini, y_ini, x_ini, y_end );
        drawOneLine( x_ini, y_end, x_end, y_end );
        drawOneLine( x_end, y_end, x_end, y_ini );
-       drawOneLine( x_ini+30, y_ini, x_ini+30, y_end );
-       drawOneLine( x_ini+30, y_ini+30, x_ini+90, y_ini+30 );
-       drawOneLine( x_ini+90, y_ini, x_ini+90, y_end );
-       drawOneLine( x_ini+120, y_ini, x_ini+120, y_end );
-              
-       c = &current_aircraft.controls;
-       
+       drawOneLine( x_ini + 30, y_ini, x_ini + 30, y_end );
+       drawOneLine( x_ini + 30, y_ini + 30, x_ini + 90, y_ini + 30 );
+       drawOneLine( x_ini + 90, y_ini, x_ini + 90, y_end );
+       drawOneLine( x_ini + 120, y_ini, x_ini + 120, y_end );
+
+       c = current_aircraft.controls;
+
        /* Draw elevator diagram */
-       textString( x_ini+1, y_end-11, "E", GLUT_BITMAP_8_BY_13 );      
-       drawOneLine( x_ini+15, y_ini+5, x_ini+15, y_ini+55 );
-       drawOneLine( x_ini+14, y_ini+30, x_ini+16, y_ini+30 );
+       textString( x_ini + 1, y_end-11, "E", GLUT_BITMAP_8_BY_13 );
+       drawOneLine( x_ini + 15, y_ini + 5, x_ini + 15, y_ini + 55 );
+       drawOneLine( x_ini + 14, y_ini + 30, x_ini + 16, y_ini + 30 );
        if( FG_Elevator <= -0.01 || FG_Elevator >= 0.01 )
        {
-               drawOneLine( x_ini+10, y_ini+5+(int)(((FG_Elevator+1.0)/2)*50.0), \
-                               x_ini+20, y_ini+5+(int)(((FG_Elevator+1.0)/2)*50.0) );
+               drawOneLine( x_ini + 10, y_ini + 5 + (int)(((FG_Elevator + 1.0)/2)*50.0), \
+                               x_ini + 20, y_ini + 5 + (int)(((FG_Elevator + 1.0)/2)*50.0) );
        }
        else
        {
-               drawOneLine( x_ini+7, y_ini+5+(int)(((FG_Elevator+1.0)/2)*50.0), \
-                               x_ini+23, y_ini+5+(int)(((FG_Elevator+1.0)/2)*50.0) );
+               drawOneLine( x_ini + 7, y_ini + 5 + (int)(((FG_Elevator + 1.0)/2)*50.0), \
+                               x_ini + 23, y_ini + 5 + (int)(((FG_Elevator + 1.0)/2)*50.0) );
        }
-       
+
        /* Draw aileron diagram */
-       textString( x_ini+30+1, y_end-11, "A", GLUT_BITMAP_8_BY_13 );   
-       drawOneLine( x_ini+35, y_end-15, x_ini+85, y_end-15 );
-       drawOneLine( x_ini+60, y_end-14, x_ini+60, y_end-16 );
+       textString( x_ini + 30 + 1, y_end-11, "A", GLUT_BITMAP_8_BY_13 );
+       drawOneLine( x_ini + 35, y_end-15, x_ini + 85, y_end-15 );
+       drawOneLine( x_ini + 60, y_end-14, x_ini + 60, y_end-16 );
        if( FG_Aileron <= -0.01 || FG_Aileron >= 0.01 )
        {
-               drawOneLine( x_ini+35+(int)(((FG_Aileron+1.0)/2)*50.0), y_end-20, \
-                               x_ini+35+(int)(((FG_Aileron+1.0)/2)*50.0), y_end-10 );
+               drawOneLine( x_ini + 35 + (int)(((FG_Aileron + 1.0)/2)*50.0), y_end-20, \
+                               x_ini + 35 + (int)(((FG_Aileron + 1.0)/2)*50.0), y_end-10 );
        }
        else
        {
-               drawOneLine( x_ini+35+(int)(((FG_Aileron+1.0)/2)*50.0), y_end-25, \
-                               x_ini+35+(int)(((FG_Aileron+1.0)/2)*50.0), y_end-5 );
+               drawOneLine( x_ini + 35 + (int)(((FG_Aileron + 1.0)/2)*50.0), y_end-25, \
+                               x_ini + 35 + (int)(((FG_Aileron + 1.0)/2)*50.0), y_end-5 );
        }
-       
+
        /* Draw rudder diagram */
-       textString( x_ini+30+1, y_ini+21, "R", GLUT_BITMAP_8_BY_13 );   
-       drawOneLine( x_ini+35, y_ini+15, x_ini+85, y_ini+15 );
-       drawOneLine( x_ini+60, y_ini+14, x_ini+60, y_ini+16 );
+       textString( x_ini + 30 + 1, y_ini + 21, "R", GLUT_BITMAP_8_BY_13 );
+       drawOneLine( x_ini + 35, y_ini + 15, x_ini + 85, y_ini + 15 );
+       drawOneLine( x_ini + 60, y_ini + 14, x_ini + 60, y_ini + 16 );
        if( FG_Rudder <= -0.01 || FG_Rudder >= 0.01 )
        {
-               drawOneLine( x_ini+35+(int)(((FG_Rudder+1.0)/2)*50.0), y_ini+20, \
-                               x_ini+35+(int)(((FG_Rudder+1.0)/2)*50.0), y_ini+10 );
+               drawOneLine( x_ini + 35 + (int)(((FG_Rudder + 1.0)/2)*50.0), y_ini + 20, \
+                               x_ini + 35 + (int)(((FG_Rudder + 1.0)/2)*50.0), y_ini + 10 );
        }
        else
        {
-               drawOneLine( x_ini+35+(int)(((FG_Rudder+1.0)/2)*50.0), y_ini+25, \
-                               x_ini+35+(int)(((FG_Rudder+1.0)/2)*50.0), y_ini+5 );
+               drawOneLine( x_ini + 35 + (int)(((FG_Rudder + 1.0)/2)*50.0), y_ini + 25, \
+                               x_ini + 35 + (int)(((FG_Rudder + 1.0)/2)*50.0), y_ini + 5 );
        }
        
        
        /* Draw throttle diagram */
-       textString( x_ini+90+1, y_end-11, "T", GLUT_BITMAP_8_BY_13 );   
-       textString( x_ini+90+1, y_end-21, "r", GLUT_BITMAP_8_BY_13 );   
-       drawOneLine( x_ini+105, y_ini+5, x_ini+105, y_ini+55 );
-       drawOneLine( x_ini+100, y_ini+5+(int)(FG_Throttle[0]*50.0), \
-                       x_ini+110, y_ini+5+(int)(FG_Throttle[0]*50.0) );
+       textString( x_ini + 90 + 1, y_end-11, "T", GLUT_BITMAP_8_BY_13 );       
+       textString( x_ini + 90 + 1, y_end-21, "r", GLUT_BITMAP_8_BY_13 );       
+       drawOneLine( x_ini + 105, y_ini + 5, x_ini + 105, y_ini + 55 );
+       drawOneLine( x_ini + 100, y_ini + 5 + (int)(FG_Throttle[0]*50.0), \
+                       x_ini + 110, y_ini + 5 + (int)(FG_Throttle[0]*50.0) );
        
        
        /* Draw elevator trim diagram */
-       textString( x_ini+121, y_end-11, "T", GLUT_BITMAP_8_BY_13 );    
-       textString( x_ini+121, y_end-22, "m", GLUT_BITMAP_8_BY_13 );    
-       drawOneLine( x_ini+135, y_ini+5, x_ini+135, y_ini+55 );
-       drawOneLine( x_ini+134, y_ini+30, x_ini+136, y_ini+30 );
+       textString( x_ini + 121, y_end-11, "T", GLUT_BITMAP_8_BY_13 );  
+       textString( x_ini + 121, y_end-22, "m", GLUT_BITMAP_8_BY_13 );  
+       drawOneLine( x_ini + 135, y_ini + 5, x_ini + 135, y_ini + 55 );
+       drawOneLine( x_ini + 134, y_ini + 30, x_ini + 136, y_ini + 30 );
        if( FG_Elev_Trim <= -0.01 || FG_Elev_Trim >= 0.01 )
        {
-               drawOneLine( x_ini+130, y_ini+5+(int)(((FG_Elev_Trim+1)/2)*50.0), \
-                               x_ini+140, y_ini+5+(int)(((FG_Elev_Trim+1.0)/2)*50.0) );
+               drawOneLine( x_ini + 130, y_ini + 5 + (int)(((FG_Elev_Trim + 1)/2)*50.0), \
+                               x_ini + 140, y_ini + 5 + (int)(((FG_Elev_Trim + 1.0)/2)*50.0) );
        }
        else
        {
-               drawOneLine( x_ini+127, y_ini+5+(int)(((FG_Elev_Trim+1.0)/2)*50.0), \
-                               x_ini+143, y_ini+5+(int)(((FG_Elev_Trim+1.0)/2)*50.0) );
+               drawOneLine( x_ini + 127, y_ini + 5 + (int)(((FG_Elev_Trim + 1.0)/2)*50.0), \
+                               x_ini + 143, y_ini + 5 + (int)(((FG_Elev_Trim + 1.0)/2)*50.0) );
        }
        
 }
 
-/*
-
-       Draws a label anywhere in the HUD
-       
-       Needs: HUD_label struct
+//
+// Draws a label anywhere in the HUD
+//
+//
 
-*/     
-static void drawlabel( struct HUD_label label )
+static void drawlabel( HUD_label *label )
 {
-       char buffer[80];
-       char string[80];
-       int posincr;
-       int lenstr;
-       
-       if( label.pre_str != NULL && label.post_str != NULL )
-               sprintf( buffer, "%s%s%s", label.pre_str, label.format, label.post_str );
-       else if( label.pre_str == NULL && label.post_str != NULL )
-               sprintf( buffer, "%s%s", label.format, label.post_str );
-       else if( label.pre_str != NULL && label.post_str == NULL )
-               sprintf( buffer, "%s%s", label.pre_str, label.format );
+  char buffer[80];
+  char string[80];
+  int posincr;
+  int lenstr;
+
+  if( !label ) { // Eliminate the possible, but absurd case.
+    return;
+    }
+
+  if( label->pre_str != NULL) {
+    if( label->post_str != NULL ) {
+      sprintf( buffer, "%s%s%s", label->pre_str,  \
+                                 label->format,   \
+                                 label->post_str );
+      }
+    else {
+      sprintf( buffer, "%s%s",   label->pre_str, \
+                                 label->format );
+      }
+    }
+  else {
+    if( label->post_str != NULL ) {
+      sprintf( buffer, "%s%s",   label->format,  \
+                                 label->post_str );
+      }
+    } // else do nothing if both pre and post strings are nulls. Interesting.
+
 
-       sprintf( string, buffer, (*label.load_value)() );
+  sprintf( string, buffer, (*label->load_value)() );
 
        fgPrintf( FG_COCKPIT, FG_DEBUG,  buffer );
        fgPrintf( FG_COCKPIT, FG_DEBUG,  "\n" );
        fgPrintf( FG_COCKPIT, FG_DEBUG, string );
        fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
 
-       lenstr = strlen( string );
-       if( label.justify == LEFT_JUST )
-               posincr = -lenstr*8;
-       else if( label.justify == CENTER_JUST )
-               posincr = -lenstr*4;
-       else if( label.justify == RIGHT_JUST )
-               posincr = 0;
-       
-       if( label.size == SMALL )
-               textString( label.x_pos+posincr, label.y_pos, string, GLUT_BITMAP_8_BY_13);
-       else if( label.size == LARGE )
-               textString( label.x_pos+posincr, label.y_pos, string, GLUT_BITMAP_9_BY_15);
-       
-}
-
-double get_speed( void )
-{
-       struct fgFLIGHT *f;
-              
-       f = &current_aircraft.flight;
-       return( FG_V_equiv_kts );
-}
+  lenstr = strlen( string );
+  if( label->justify == LEFT_JUST ) {
+   posincr = -lenstr*8;
+   }
+  else {
+    if( label->justify == CENTER_JUST ) {
+      posincr = -lenstr*4;
+      }
+    else {
+      if( label->justify == RIGHT_JUST ) {
+        posincr = 0;
+        }
+      }
+    }
 
-double get_aoa( void )
-{
-       struct fgFLIGHT *f;
-              
-       f = &current_aircraft.flight;
-       return( FG_Gamma_vert_rad*RAD_TO_DEG );
+  if( label->size == SMALL ) {
+    textString( label->x_pos + posincr, label->y_pos,
+                string, GLUT_BITMAP_8_BY_13);
+    }
+  else  {
+    if( label->size == LARGE ) {
+      textString( label->x_pos + posincr, label->y_pos,
+                  string, GLUT_BITMAP_9_BY_15);
+      }
+    }
 }
-
-double get_roll( void )
+// The following routines concern HUD object/component object construction
+//
+
+// fgHUDInit
+//
+// Constructs a HUD object and then adds in instruments. At the present
+// the instruments are hard coded into the routine. Ultimately these need
+// to be defined by the aircraft's instrumentation records so that the
+// display for a Piper Cub doesn't show the speed range of a North American
+// mustange and the engine readouts of a B36!
+//
+Hptr fgHUDInit( fgAIRCRAFT *current_aircraft )
 {
-       struct fgFLIGHT *f;
-              
-       f = &current_aircraft.flight;
-       return( FG_Phi );
+  Hptr hud;
+
+  hud = (Hptr)calloc(sizeof( HUD),1);
+  if( hud == NULL )
+    return( NULL );
+
+  hud->code = 1;
+  hud->status = 0;
+
+  // For now lets just hardcode the hud here .
+  // In the future, hud information has to come from the same place
+  // aircraft information came from.
+
+  fgHUDAddHorizon( hud, 590, 50, 40, 20, get_roll );
+  fgHUDAddScale  ( hud, VERTICAL, NOLIMIT, 220, 100, 280, 5, 10,
+                   LEFT, LEFT, 0, 100, get_speed );
+  fgHUDAddScale  ( hud, VERTICAL, NOLIMIT, 440, 100, 280, 1, 5,
+                   RIGHT, RIGHT, -400, 25, get_aoa );
+  fgHUDAddScale  ( hud, HORIZONTAL, NOLIMIT, 280, 220, 440, 5, 10,
+                   TOP, TOP, 0, 50, get_heading );
+  fgHUDAddLabel  ( hud, 180, 85, SMALL, NOBLINK,
+                   RIGHT_JUST, NULL, " Kts", "%5.0f", get_speed );
+  fgHUDAddLabel  ( hud, 180, 73, SMALL, NOBLINK,
+                   RIGHT_JUST, NULL, " m", "%5.0f", get_altitude );
+  fgHUDAddLadder ( hud, 330, 190, 90, 180, 70, 10,
+                   NONE, 45, get_roll, get_pitch );
+  // fgHUDAddControlSurfaces( hud, 10, 10, get_heading );
+
+  return( hud );
 }
 
-double get_pitch( void )
-{
-       struct fgFLIGHT *f;
-              
-       f = &current_aircraft.flight;
-       return( FG_Theta );
-}
+// add_instrument
+//
+// This is a stand in for linked list code that will get replaced later
+// by some more elegant list handling code.
 
-double get_heading( void )
+void add_instrument( Hptr hud, HIptr pinstrument )
 {
-       struct fgFLIGHT *f;
-              
-       f = &current_aircraft.flight;
-       return( FG_Psi*RAD_TO_DEG );
+  if( !hud || !pinstrument ) {
+    return;
+    }
+  pinstrument->next = hud->instruments;
+  hud->instruments = pinstrument;
 }
 
-double get_altitude( void )
+// fgHUDAddHorizon
+//
+// Constructs a HUD_horizon "object" and installs it into the hud instrument
+// list.
+
+Hptr fgHUDAddHorizon( Hptr hud,     \
+                      int x_pos,    \
+                      int y_pos,    \
+                      int length,   \
+                      int hole_len, \
+                      double (*load_value)() )
 {
-       struct fgFLIGHT *f;
-       /* double rough_elev; */
-              
-       f = &current_aircraft.flight;
-       /* rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
-                                          FG_Latitude  * RAD_TO_ARCSEC); */
-                                                   
-       return( FG_Altitude * FEET_TO_METER /* -rough_elev */ );
-}
+  HUD_horizon *phorizon;
+  HUD_instr   *pinstrument;
 
-void add_instrument( Hptr hud, HIptr instrument )
-{
-       HIptr instruments;
-       
-       instruments = hud->instruments;
-       // while( ++instruments
-}
+  if( !hud ) {
+    return NULL;
+    }
+                                       // construct the parent object
+       pinstrument = (HIptr)calloc(sizeof(HUD_instr),1);
+       if( pinstrument == NULL ) {
+               return( NULL );
+    }
+       pinstrument->type    = HUDhorizon;  //  ARTIFICIAL_HORIZON;
 
-Hptr fgHUDInit( struct fgAIRCRAFT current_aircraft, int color )
-{
-       Hptr hud;
-       
-       hud = (Hptr)calloc(sizeof(struct HUD),1);
-       if( hud == NULL )
+                                      // Construct the horizon
+       phorizon = (HUD_horizon *) calloc( sizeof(HUD_horizon),1);
+       if( phorizon == NULL )   {
                return( NULL );
-               
-       hud->code = 1;          /* It will be aircraft dependent */
-       hud->status = 0;
-       
-       // For now lets just hardcode a hud here .
-       // In the future, hud information has to come from the same place 
-       // aircraft information came
-       
-       fgHUDAddHorizon( hud, 590, 50, 40, 20, get_roll );
-       fgHUDAddScale( hud, VERTICAL, 220, 100, 280, 5, 10, LEFT, LEFT, 0, 100, get_speed );
-       fgHUDAddScale( hud, VERTICAL, 440, 100, 280, 1, 5, RIGHT, RIGHT, -400, 25, get_aoa );
-       fgHUDAddScale( hud, HORIZONTAL, 280, 220, 440, 5, 10, TOP, TOP, 0, 50, get_heading );
-       fgHUDAddLabel( hud, 180, 85, SMALL, NOBLINK, RIGHT_JUST, NULL, " Kts", "%5.0f", get_speed );
-       fgHUDAddLabel( hud, 180, 73, SMALL, NOBLINK, RIGHT_JUST, NULL, " m", "%5.0f", get_altitude );
-       fgHUDAddLadder( hud, 330, 190, 90, 180, 70, 10, NONE, 45, get_roll, get_pitch );
-       fgHUDAddControlSurfaces( hud, 10, 10, get_heading );
-       
-       return( hud );
+    }
+
+  phorizon->x_pos      = x_pos;
+  phorizon->y_pos      = y_pos;
+  phorizon->scr_width  = length;
+  phorizon->scr_hole   = hole_len;
+  phorizon->load_value = load_value;
+                                      //  Install the horizon in the parent.
+  pinstrument->instr   = phorizon;
+                                      //  Install the instrument into hud.
+  add_instrument( hud, pinstrument);
+
+  return( hud );
 }
 
-Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, \
-                                               int hole_len, double (*load_value)() )
+// fgHUDAddScale
+//
+// Constructs a HUD_scale "object" and installs it into the hud instrument
+// list.
+
+Hptr fgHUDAddScale( Hptr hud,        \
+                    int type,        \
+                    int sub_type,    \
+                    int scr_pos,     \
+                    int scr_min,     \
+                    int scr_max,     \
+                    int div_min,     \
+                    int div_max,     \
+                    int orientation, \
+                    int with_min,    \
+                    int min_value,   \
+                    int width_units, \
+                    double (*load_value)() )
 {
-       struct HUD_horizon *horizon;
-       struct HUD_instr *instrument;
-       HIptr tmp_first, tmp_next;
-       
-       tmp_first = hud->instruments;
-       if( tmp_first != NULL )
-               tmp_next = tmp_first->next;
-       else
-               tmp_next = NULL;
-       
-       instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
-       if( instrument == NULL )
-               return( NULL );
-               
-       horizon = (struct HUD_horizon *)calloc(sizeof(struct HUD_horizon),1);
-       if( horizon == NULL )
-               return( NULL );
-       
-       instrument->type = ARTIFICIAL_HORIZON;
-       instrument->instr.horizon = *horizon;
-       instrument->instr.horizon.x_pos = x_pos;
-       instrument->instr.horizon.y_pos = y_pos;
-       instrument->instr.horizon.scr_width = length;
-       instrument->instr.horizon.scr_hole = hole_len;
-       instrument->instr.horizon.load_value = load_value;
-       instrument->next = tmp_first;
+  HUD_scale *pscale;
+  HUD_instr *pinstrument;
 
-       hud->instruments = instrument;
+  if( !hud ) {
+    return NULL;
+    }
 
-       return( hud );
-}
+       pinstrument = (HIptr)calloc(sizeof(HUD_instr),1);
+       if( pinstrument == NULL ) {
+     return( NULL );
+     }
 
-Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, int div_min, int div_max, \
-                                       int orientation, int with_min, int min_value, int width_units, double (*load_value)() )
-{
-       struct HUD_scale *scale;
-       struct HUD_instr *instrument;
-       HIptr tmp_first, tmp_next;
-       
-       tmp_first = hud->instruments;
-       if( tmp_first != NULL )
-               tmp_next = tmp_first->next;
-       else
-               tmp_next = NULL;
-       
-       instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
-       if( instrument == NULL )
-               return( NULL );
-               
-       scale = (struct HUD_scale *)calloc(sizeof(struct HUD_scale),1);
-       if( scale == NULL )
-               return( NULL );
-       
-       instrument->type = SCALE;
-       instrument->instr.scale = *scale;
-       instrument->instr.scale.type = type;
-       instrument->instr.scale.scr_pos = scr_pos;
-       instrument->instr.scale.scr_min = scr_min;
-       instrument->instr.scale.scr_max = scr_max;
-       instrument->instr.scale.div_min = div_min;
-       instrument->instr.scale.div_max = div_max;
-       instrument->instr.scale.orientation = orientation;
-       instrument->instr.scale.with_minimum = with_min;
-       instrument->instr.scale.minimum_value = min_value;
-       instrument->instr.scale.width_units = width_units;
-       instrument->instr.scale.load_value = load_value;
-       instrument->next = tmp_first;
-
-       hud->instruments = instrument;
+  pinstrument->type = SCALE;
 
-       return( hud );
+  pscale = ( HUD_scale *)calloc(sizeof(HUD_scale),1);
+  if( pscale == NULL )   {
+     return( NULL );
+    }
+  pscale->type          = type;
+  pscale->type          = sub_type;
+  pscale->scr_pos       = scr_pos;
+  pscale->scr_min       = scr_min;
+  pscale->scr_max       = scr_max;
+  pscale->div_min       = div_min;
+  pscale->div_max       = div_max;
+  pscale->orientation   = orientation;
+  pscale->with_minimum  = with_min;
+  pscale->minimum_value = min_value;
+  pscale->width_units   = width_units;
+  pscale->load_value    = load_value;
+                                     // Install the scale
+  pinstrument->instr = pscale;
+                                      //  Install the instrument into hud.
+  add_instrument( hud, pinstrument);
+
+  return( hud );
 }
 
-Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int justify, \
-                                       char *pre_str, char *post_str, char *format, double (*load_value)() )
+// fgHUDAddLabel
+//
+// Constructs a HUD_Label object and installs it into the hud instrument
+// list.
+Hptr fgHUDAddLabel( Hptr hud,       \
+                    int x_pos,      \
+                    int y_pos,      \
+                    int size,       \
+                    int blink,      \
+                    int justify,    \
+                                                 char *pre_str,  \
+                    char *post_str, \
+                    char *format,   \
+                    double (*load_value)() )
 {
-       struct HUD_label *label;
-       struct HUD_instr *instrument;
-       HIptr tmp_first, tmp_next;
-       
-       tmp_first = hud->instruments;
-       if( tmp_first != NULL )
-               tmp_next = tmp_first->next;
-       else
-               tmp_next = NULL;
-       
-       instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
-       if( instrument == NULL )
-               return( NULL );
-               
-       label = (struct HUD_label *)calloc(sizeof(struct HUD_label),1);
-       if( label == NULL )
-               return( NULL );
-       
-       instrument->type = LABEL;
-       instrument->instr.label = *label;
-       instrument->instr.label.x_pos = x_pos;
-       instrument->instr.label.y_pos = y_pos;
-       instrument->instr.label.size = size;
-       instrument->instr.label.blink = blink;
-       instrument->instr.label.justify = justify;
-       instrument->instr.label.pre_str = pre_str;
-       instrument->instr.label.post_str = post_str;
-       instrument->instr.label.format = format;
-       instrument->instr.label.load_value = load_value;
-       instrument->next = tmp_first;
-
-       hud->instruments = instrument;
+       HUD_label *plabel;
+       HUD_instr *pinstrument;
 
-       return( hud );
-}
+  if( !hud ) {
+    return NULL;
+    }
 
-Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_height, \
-                                       int hole_len, int div_units, int label_pos, int width_units, \
-                                       double (*load_roll)(), double (*load_pitch)() )
-{
-       struct HUD_ladder *ladder;
-       struct HUD_instr *instrument;
-       HIptr tmp_first, tmp_next;
-       
-       tmp_first = hud->instruments;
-       if( tmp_first != NULL )
-               tmp_next = tmp_first->next;
-       else
-               tmp_next = NULL;
-       
-       instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
-       if( instrument == NULL )
-               return( NULL );
-               
-       ladder = (struct HUD_ladder *)calloc(sizeof(struct HUD_ladder),1);
-       if( ladder == NULL )
-               return( NULL );
+       pinstrument = (HIptr)calloc(sizeof(HUD_instr),1);
+       if( pinstrument == NULL ) {
+    return NULL;
+    }
+       pinstrument->type = LABEL;
+
+       plabel = (HUD_label *)calloc(sizeof(HUD_label),1);
+       if( plabel == NULL ){
+    return NULL;
+    }
 
-       instrument->type = LADDER;
-       instrument->instr.ladder = *ladder;
-       instrument->instr.ladder.type = 0;      // Not used.
-       instrument->instr.ladder.x_pos = x_pos;
-       instrument->instr.ladder.y_pos = y_pos;
-       instrument->instr.ladder.scr_width = scr_width;
-       instrument->instr.ladder.scr_height = scr_height;
-       instrument->instr.ladder.scr_hole = hole_len;
-       instrument->instr.ladder.div_units = div_units;
-       instrument->instr.ladder.label_position = label_pos;
-       instrument->instr.ladder.width_units = width_units;
-       instrument->instr.ladder.load_roll = load_roll;
-       instrument->instr.ladder.load_pitch = load_pitch;
-       instrument->next = tmp_first;
-
-       hud->instruments = instrument;
+  plabel->x_pos      = x_pos;
+  plabel->y_pos      = y_pos;
+  plabel->size       = size;
+  plabel->blink      = blink;
+  plabel->justify    = justify;
+  plabel->pre_str    = pre_str;
+  plabel->post_str   = post_str;
+  plabel->format     = format;
+  plabel->load_value = load_value;
+                                      // Install the label
+       pinstrument->instr = plabel;
+                                      //  Install the instrument into hud.
+  add_instrument( hud, pinstrument);
 
        return( hud );
 }
 
-Hptr fgHUDAddControlSurfaces( Hptr hud, int x_pos, int y_pos, double (*load_value)() )
+// fgHUDAddLadder
+//
+// Contains code that constructs a ladder "object" and installs it as
+// a hud instrument in the hud instrument list.
+//
+Hptr fgHUDAddLadder( Hptr hud,        \
+                     int x_pos,       \
+                     int y_pos,       \
+                     int scr_width,   \
+                     int scr_height,  \
+                                                  int hole_len,    \
+                     int div_units,   \
+                     int label_pos,   \
+                     int width_units, \
+                                                  double (*load_roll)(),
+                     double (*load_pitch)() )
 {
-       struct HUD_control_surfaces *ctrl_surf;
-       struct HUD_instr *instrument;
-       HIptr tmp_first, tmp_next;
-       
-       tmp_first = hud->instruments;
-       if( tmp_first != NULL )
-               tmp_next = tmp_first->next;
-       else
-               tmp_next = NULL;
-       
-       instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
-       if( instrument == NULL )
-               return( NULL );
-               
-       ctrl_surf = (struct HUD_control_surfaces *)calloc(sizeof(struct HUD_control_surfaces),1);
-       if( ctrl_surf == NULL )
+       HUD_ladder *pladder;
+       HUD_instr  *pinstrument;
+
+  if( !hud ) {
+    return NULL;
+    }
+
+       pinstrument = (HIptr)calloc(sizeof(HUD_instr),1);
+       if( pinstrument == NULL )
                return( NULL );
-       
-       instrument->type = CONTROL_SURFACES;
-       instrument->instr.control_surfaces = *ctrl_surf;
-       instrument->instr.control_surfaces.x_pos = x_pos;
-       instrument->instr.control_surfaces.y_pos = y_pos;
-       instrument->instr.horizon.load_value = load_value;
-       instrument->next = tmp_first;
 
-       hud->instruments = instrument;
+       pinstrument->type = LADDER;
 
-       return( hud );
+       pladder = (HUD_ladder *)calloc(sizeof(HUD_ladder),1);
+       if( pladder == NULL )
+               return( NULL );
+
+  pladder->type           = 0; // Not used.
+  pladder->x_pos          = x_pos;
+  pladder->y_pos          = y_pos;
+  pladder->scr_width      = scr_width;
+  pladder->scr_height     = scr_height;
+  pladder->scr_hole       = hole_len;
+  pladder->div_units      = div_units;
+  pladder->label_position = label_pos;
+  pladder->width_units    = width_units;
+  pladder->load_roll      = load_roll;
+  pladder->load_pitch     = load_pitch;
+
+  pinstrument->instr      = pladder;
+                                      //  Install the instrument into hud.
+  add_instrument( hud, pinstrument);
+       return hud;
 }
 
 /*
-Hptr fgHUDAddMovingHorizon( Hptr hud, int x_pos, int y_pos, int length, int hole_len, \
-                                               int color )
+Hptr fgHUDAddMovingHorizon(  Hptr hud,     \
+                             int x_pos,    \
+                             int y_pos,    \
+                             int length,   \
+                             int hole_len, \
+                             int color )
 {
 
 }
 
-Hptr fgHUDAddCircularLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \
-                                               int max_value )
+Hptr fgHUDAddCircularLadder( Hptr hud,    \
+                             int scr_min, \
+                             int scr_max, \
+                             int div_min, \
+                             int div_max, \
+                             int max_value )
 {
 
 }
 
-Hptr fgHUDAddNumDisp( Hptr hud, int x_pos, int y_pos, int size, int color, int blink, \
-                                               char *pre_str, char *post_str )
+Hptr fgHUDAddNumDisp( Hptr hud,           \
+                      int x_pos,          \
+                      int y_pos,          \
+                      int size,           \
+                      int color,          \
+                      int blink,          \
+                                                         char *pre_str,      \
+                      char *post_str )
 {
 
 }
 */
 
+// fgUpdateHUD
+//
+// Performs a once around the list of calls to instruments installed in
+// the HUD object with requests for redraw. Kinda. It will when this is
+// all C++.
+//
+
 void fgUpdateHUD( Hptr hud )
 {
-       HIptr hud_instr;
-       union HUD_instr_data instr_data;
-              
+       HIptr phud_instr;
+
        glMatrixMode(GL_PROJECTION);
        glPushMatrix();
 
@@ -878,76 +1057,67 @@ void fgUpdateHUD( Hptr hud )
        glMatrixMode(GL_MODELVIEW);
        glPushMatrix();
        glLoadIdentity();
-         
+
        glColor3f(1.0, 1.0, 1.0);
        glIndexi(7);
-              
+
        glDisable(GL_DEPTH_TEST);
        glDisable(GL_LIGHTING);
-                  
+
        glLineWidth(1);
        glColor3f (0.1, 0.9, 0.1);
-                      
-    fgPrintf( FG_COCKPIT, FG_DEBUG,  "HUD Code %d  Status %d\n", 
-             hud->code, hud->status ); 
-    hud_instr = hud->instruments;
-       while( hud_instr != NULL )
-       {
-               instr_data = hud_instr->instr;
-               fgPrintf( FG_COCKPIT, FG_DEBUG, 
-                         "Instr Type %d   SubType %d  Orient %d\n", 
-                         hud_instr->type, hud_instr->sub_type, hud_instr->orientation );
-               if( hud_instr->type == ARTIFICIAL_HORIZON )
-               {
-                       drawhorizon( instr_data.horizon );
-                       /* drawhorizon( instr_data.horizon.x_pos, instr_data.horizon.y_pos, \
-                               instr_data.horizon.scr_width, instr_data.horizon.scr_hole ); */
-       }
-       else if( hud_instr->type == SCALE )
-       {
-               drawscale( instr_data.scale.type, instr_data.scale.with_minimum, \
-                               instr_data.scale.minimum_value, instr_data.scale.orientation, \
-                               instr_data.scale.scr_pos, instr_data.scale.scr_min, \
-                               instr_data.scale.scr_max, instr_data.scale.width_units, \
-                               instr_data.scale.div_min, instr_data.scale.div_max, \
-                                       (*instr_data.scale.load_value)() );                                     
-       }
-       else if( hud_instr->type == CONTROL_SURFACES )
-       {
-               drawcontrolsurfaces( instr_data.control_surfaces );
-       }
-       else if( hud_instr->type == LABEL )
-       {
-               drawlabel( instr_data.label );
-               /* drawlabel( instr_data.label.x_pos, instr_data.label.y_pos, instr_data.label.size, \
-                               instr_data.label.blink, instr_data.label.pre_str, instr_data.label.post_str, \
-                               instr_data.label.format, (*instr_data.label.load_value)() ); */
-       }
-       else if( hud_instr->type == LADDER )
-       {
-               drawladder( instr_data.ladder );
-       }
-       hud_instr = hud_instr->next;
+
+  fgPrintf( FG_COCKPIT, FG_DEBUG,
+            "HUD Code %d  Status %d\n",
+            hud->code, hud->status );
+
+  phud_instr = hud->instruments;
+  while( phud_instr )  {
+    switch (phud_instr->type){
+                 case HUDhorizon:                  // ARTIFICIAL HORIZON
+        drawhorizon( (pHUDhorizon)phud_instr );
+         break;
+
+       case HUDscale:                  // Need to simplify this call.
+        drawscale (  (pHUDscale)  phud_instr  );
+        break;
+
+      case HUDlabel:
+        drawlabel (  (pHUDlabel)  phud_instr  );
+        break;
+
+       case HUDladder:
+               drawladder(  (pHUDladder) phud_instr  );
+        break;
+
+      case HUDcontrols:
+        drawControlSurfaces( (pHUDControlSurface) phud_instr );
+      default:; // Ignore anything you don't know about.
+      }
+       phud_instr = phud_instr->next;
     }
-    
-    
+
        glEnable(GL_DEPTH_TEST);
        glEnable(GL_LIGHTING);
        glMatrixMode(GL_PROJECTION);
        glPopMatrix();
        glMatrixMode(GL_MODELVIEW);
        glPopMatrix();
-                
+
 }
 
 
 /* $Log$
-/* Revision 1.10  1998/02/03 23:20:14  curt
-/* Lots of little tweaks to fix various consistency problems discovered by
-/* Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
-/* passed arguments along to the real printf().  Also incorporated HUD changes
-/* by Michele America.
+/* Revision 1.11  1998/02/07 15:29:34  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.10  1998/02/03 23:20:14  curt
+ * Lots of little tweaks to fix various consistency problems discovered by
+ * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
+ * passed arguments along to the real printf().  Also incorporated HUD changes
+ * by Michele America.
+ *
  * Revision 1.9  1998/01/31 00:43:04  curt
  * Added MetroWorks patches from Carmen Volpe.
  *
index 0e34464d898cec39ba1c675e485829b28d67b4bb..1fe479e486127a0d70fe57a6a51af77d70e47963 100644 (file)
 
 /* Instrument types */
 #define ARTIFICIAL_HORIZON     1
-#define SCALE                          2
-#define LADDER                         3
-#define LABEL                          4
-#define CONTROL_SURFACES               5
+#define SCALE              2
+#define LADDER             3
+#define LABEL              4
 
 /* Scale constants */
-#define HORIZONTAL                     1
-#define TOP                                    2
-#define        BOTTOM                          3
-#define VERTICAL                       4
-#define LEFT                           5
-#define RIGHT                          6
-#define        LIMIT                           7
-#define NOLIMIT                                8
+#define HORIZONTAL         1
+#define TOP                2
+#define BOTTOM             3
+#define VERTICAL           4
+#define LEFT               5
+#define RIGHT              6
+#define LIMIT              7
+#define NOLIMIT            8
 
 /* Label constants */
-#define SMALL                          1
-#define LARGE                          2
-#define BLINK                          3
-#define NOBLINK                                4
-#define LEFT_JUST                      5
-#define CENTER_JUST                    6
-#define RIGHT_JUST                     7
+#define SMALL              1
+#define LARGE              2
+#define BLINK              3
+#define NOBLINK            4
+#define LEFT_JUST          5
+#define CENTER_JUST        6
+#define RIGHT_JUST         7
 
 /* Ladder constants */
-#define NONE                           1
-#define UPPER_LEFT                     2
-#define UPPER_CENTER           3
-#define UPPER_RIGHT                    4
-#define CENTER_RIGHT           5
-#define LOWER_RIGHT                    6
-#define LOWER_CENTER           7
-#define LOWER_LEFT                     8
-#define CENTER_LEFT                    9
-#define SOLID_LINES                    10
-#define DASHED_LINES           11
-#define DASHED_NEG_LINES       12
+#define NONE               1
+#define UPPER_LEFT         2
+#define UPPER_CENTER       3
+#define UPPER_RIGHT        4
+#define CENTER_RIGHT       5
+#define LOWER_RIGHT        6
+#define LOWER_CENTER       7
+#define LOWER_LEFT         8
+#define CENTER_LEFT        9
+#define SOLID_LINES       10
+#define DASHED_LINES      11
+#define DASHED_NEG_LINES  12
 
 /* Ladder orientaion */
 // #define HUD_VERTICAL        1
 // #define HUD_INSTR_HORIZON   3
 // #define HUD_INSTR_LABEL             4
 
-struct HUD_scale {
-       int type;
-       int scr_pos;
-       int scr_min;
-       int scr_max;
-       int div_min;
-       int div_max;
-       int orientation;
-       int with_minimum;
-       int minimum_value;
-       int width_units;
-       double (*load_value)( void );
-};
-
-struct HUD_circular_scale {
+// The following structs will become classes with a derivation from
+// an ABC instrument_pack. Eventually the instruments may well become
+// dll's. This would open the instrumentation issue to all commers.
+//
+// Methods Needed:
+//    Constructor()
+//    Initialization();  // For dynamic scenario settups?
+//    Update();          // Follow the data changes.
+//    Repaint();         // Respond to uncover/panel repaints.
+//    Break();           // Show a frown.
+//    Fix();             // Return to normal appearance and function.
+//    Night_Day();       // Illumination changes appearance/bitmaps.
+//
+
+typedef struct  {
+  int type;
+  int sub_type;
+  int scr_pos;
+  int scr_min;
+  int scr_max;
+  int div_min;
+  int div_max;
+  int orientation;
+  int with_minimum;
+  int minimum_value;
+  int maximum_value;
+  int width_units;
+  double (*load_value)( void );
+}HUD_scale,  *pHUDscale;
+
+typedef struct  {
        int type;
        int scr_pos;
        int scr_min;
@@ -124,9 +139,9 @@ struct HUD_circular_scale {
        int label_position;
        int width_units;
        double (*load_value)( void );
-};
+}HUD_circular_scale, *pHUD_circscale;
 
-struct HUD_ladder {
+typedef struct  {
        int type;
        int x_pos;
        int y_pos;
@@ -138,9 +153,9 @@ struct HUD_ladder {
        int width_units;
        double (*load_roll)( void );
        double (*load_pitch)( void );
-};
+}HUD_ladder, *pHUDladder;
 
-struct HUD_circular_ladder {
+typedef struct {
        int scr_min;
        int scr_max;
        int div_min;
@@ -149,31 +164,30 @@ struct HUD_circular_ladder {
        int label_position;
        int width_units;
        double (*load_value)( void );
-};
+} HUD_circular_ladder, *pHUDcircladder;
 
 #define HORIZON_FIXED  1
 #define HORIZON_MOVING 2
 
-struct HUD_horizon {
+typedef struct{
        int type;
        int x_pos;
        int y_pos;
        int scr_width;
        int scr_hole;
        double (*load_value)( void );
-};
+} HUD_horizon, *pHUDhorizon;
 
-struct HUD_control_surfaces {
+typedef struct {
        int type;
        int x_pos;
        int y_pos;
        double (*load_value)();
-};
-
+} HUD_control_surfaces, *pHUDControlSurface;
 #define LABEL_COUNTER  1
 #define LABEL_WARNING  2
 
-struct HUD_label {
+typedef struct {
        int type;
        int x_pos;
        int y_pos;
@@ -183,71 +197,133 @@ struct HUD_label {
        char *pre_str;
        char *post_str;
        char *format;
-       double (*load_value)( void );
-};
-
-union HUD_instr_data {
-       struct HUD_scale scale;
-       struct HUD_circular_scale circ_scale;
-       struct HUD_ladder ladder;
-       struct HUD_circular_ladder circ_ladder;
-       struct HUD_horizon horizon;
-       struct HUD_label label;
-       struct HUD_control_surfaces control_surfaces;
-};
-
-typedef struct HUD_instr *HIptr;
-
-struct HUD_instr {
-       int type;
-       int sub_type;
-       int orientation;
-       union HUD_instr_data instr;
-       int color;
-       HIptr next;
-};
-
-struct HUD {
+       double (*load_value)( void ); // pointer to routine to get the data
+} HUD_label, *pHUDlabel;
+
+// Removed union HUD_instr_data to evolve this to oop code.
+
+enum hudinstypes { HUDno_instr,
+                   HUDscale,
+                   HUDcirc_scale,
+                   HUDladder,
+                   HUDcirc_ladder,
+                   HUDhorizon,
+                   HUDlabel,
+                   HUDcontrols
+                   };
+
+typedef struct HUD_INSTR_STRUCT{
+  int type;
+  int sub_type;
+  int orientation;
+  void *instr;   // For now we will cast this pointer accoring to the value
+                 // of the type member.
+  struct HUD_INSTR_STRUCT *next;
+} HUD_instr, *HIptr;
+
+typedef struct  {
        int code;
-       // struct HUD_instr *instruments;
        HIptr instruments;
        int status;
-};
-
-typedef struct HUD *Hptr;
-
-Hptr fgHUDInit( struct fgAIRCRAFT cur_aircraft, int color );
-Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, int hole_len, double (*load_value)( void ) );
-Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, int div_min, int div_max, \
-                                       int orientation, int with_min, int min_value, int width_units, double (*load_value)( void ) );
-Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int justify, \
-                                       char *pre_str, char *post_str, char *format, double (*load_value)( void ) );
-Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_height, \
-                                       int hole_len, int div_units, int label_pos, int max_value, \
-                                       double (*load_roll)( void ), double (*load_pitch)( void ) );
-Hptr fgHUDAddControlSurfaces( Hptr hud, int x_pos, int y_pos, double (*get_heading)() );                                       
-                                       
-                                       
-/* struct HUD *fgHUDAddLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \
-                                       int orientation, int max_value, double *(load_value);
-struct HUD *fgHUDAddCircularLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \
-                                       int max_value, double *(load_value) );
-struct HUD *fgHUDAddNumDisp( Hptr hud, int x_pos, int y_pos, int size, int blink, \
-                                       char *pre_str, char *post_str, double *(load_value) ); */
-void fgUpdateHUD( Hptr hud );
-void fgUpdateHUD2( struct HUD *hud );
+}HUD, *Hptr;
+
+Hptr fgHUDInit      ( fgAIRCRAFT *cur_aircraft );
+
+Hptr fgHUDAddHorizon( Hptr hud,
+                      int x_pos,
+                      int y_pos,
+                      int length,
+                      int hole_len,
+                      double (*load_value)( void ) );
+
+Hptr fgHUDAddScale  ( Hptr hud,                    \
+                      int type,                    \
+                      int subtype,                 \
+                      int scr_pos,                 \
+                      int scr_min,                 \
+                      int scr_max,                 \
+                      int div_min,                 \
+                      int div_max,                 \
+                      int orientation,             \
+                      int with_min,                \
+                      int min_value,               \
+                      int width_units,             \
+                      double (*load_value)( void ) );
+
+Hptr fgHUDAddLabel  ( Hptr hud,                    \
+                      int x_pos,                   \
+                      int y_pos,                   \
+                      int size,                    \
+                      int blink,                   \
+                      int justify,                 \
+                      char *pre_str,               \
+                      char *post_str,              \
+                      char *format,                \
+                      double (*load_value)( void ) );
+
+Hptr fgHUDAddLadder ( Hptr hud,                    \
+                      int x_pos,                   \
+                      int y_pos,                   \
+                      int scr_width,               \
+                      int scr_height,              \
+                      int hole_len,                \
+                      int div_units,               \
+                      int label_pos,               \
+                      int max_value,               \
+                      double (*load_roll)( void ), \
+                      double (*load_pitch)( void ) );
+
+Hptr fgHUDAddControlSurfaces( Hptr hud,
+                              int x_pos,
+                              int y_pos,
+                              double (*load_value)(void) );
+
+/*
+Hptr fgHUDAddLadder ( Hptr hud,
+                      int scr_min,
+                      int scr_max,
+                      int div_min,
+                      int div_max, \
+                                                   int orientation,
+                      int max_value,
+                      double *(load_value);
+
+Hptr fgHUDAddCircularLadder( Hptr hud,
+                             int scr_min,
+                             int scr_max,
+                             int div_min,
+                             int div_max, \
+                                                          int max_value,
+                             double *(load_value) );
+
+Hptr fgHUDAddNumDisp( Hptr hud,
+                      int x_pos,
+                      int y_pos,
+                      int size,
+                      int blink, \
+                                                   char *pre_str,
+                      char *post_str,
+                      double *(load_value) );
+*/
+
+void fgUpdateHUD ( Hptr hud );
+void fgUpdateHUD2( Hptr hud ); // Future use?
 
 
 #endif /* _HUD_H */
 
 
 /* $Log$
-/* Revision 1.7  1998/02/03 23:20:15  curt
-/* Lots of little tweaks to fix various consistency problems discovered by
-/* Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
-/* passed arguments along to the real printf().  Also incorporated HUD changes
-/* by Michele America.
+/* Revision 1.8  1998/02/07 15:29:35  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.7  1998/02/03 23:20:15  curt
+ * Lots of little tweaks to fix various consistency problems discovered by
+ * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
+ * passed arguments along to the real printf().  Also incorporated HUD changes
+ * by Michele America.
+ *
  * Revision 1.6  1998/01/22 02:59:30  curt
  * Changed #ifdef FILE_H to #ifdef _FILE_H
  *
index d5128ca41280a7b8e5c4a024895bc7adc6db7bbe..4745ffa97084fdb63190d9df0450554be187b0d4 100644 (file)
 #include <Aircraft/aircraft.h>
 
 
+fgCONTROLS cur_control_params;
+
+
 void fgControlsInit( void ) {
     int i;
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     FG_Elevator = 0.0;
     FG_Elev_Trim = 1.969572E-03;
@@ -46,8 +49,8 @@ void fgControlsInit( void ) {
 
 
 void fgElevMove(double amt) {
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     FG_Elevator += amt;
 
@@ -56,8 +59,8 @@ void fgElevMove(double amt) {
 }
 
 void fgElevSet(double pos) {
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     FG_Elevator = pos;
 
@@ -66,8 +69,8 @@ void fgElevSet(double pos) {
 }
 
 void fgElevTrimMove(double amt) {
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     FG_Elev_Trim += amt;
 
@@ -76,8 +79,8 @@ void fgElevTrimMove(double amt) {
 }
 
 void fgElevTrimSet(double pos) {
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     FG_Elev_Trim = pos;
 
@@ -86,8 +89,8 @@ void fgElevTrimSet(double pos) {
 }
 
 void fgAileronMove(double amt) {
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     FG_Aileron += amt;
 
@@ -96,8 +99,8 @@ void fgAileronMove(double amt) {
 }
 
 void fgAileronSet(double pos) {
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     FG_Aileron = pos;
 
@@ -106,8 +109,8 @@ void fgAileronSet(double pos) {
 }
 
 void fgRudderMove(double amt) {
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     FG_Rudder += amt;
 
@@ -116,8 +119,8 @@ void fgRudderMove(double amt) {
 }
 
 void fgRudderSet(double pos) {
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     FG_Rudder = pos;
 
@@ -127,8 +130,8 @@ void fgRudderSet(double pos) {
 
 void fgThrottleMove(int engine, double amt) {
     int i;
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     if ( engine == FG_Throttle_All ) {
        for ( i = 0; i < FG_MAX_ENGINES; i++ ) {
@@ -147,8 +150,8 @@ void fgThrottleMove(int engine, double amt) {
 
 void fgThrottleSet(int engine, double pos) {
     int i;
-    struct fgCONTROLS *c;
-    c = &current_aircraft.controls;
+    fgCONTROLS *c;
+    c = current_aircraft.controls;
 
     if ( engine == FG_Throttle_All ) {
        for ( i = 0; i < FG_MAX_ENGINES; i++ ) {
@@ -167,10 +170,14 @@ void fgThrottleSet(int engine, double pos) {
 
 
 /* $Log$
-/* Revision 1.6  1998/01/19 19:27:02  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.7  1998/02/07 15:29:36  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.6  1998/01/19 19:27:02  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
  * Revision 1.5  1998/01/19 18:40:22  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index d5045815aecd7ee4b0a847e0637fb3339e24cab0..ddc89390daf9079fcf3b924d5ec3fd599ddfd8b2 100644 (file)
 
 /* Define a structure containing the control parameters */
 
-struct fgCONTROLS {
+typedef struct {
     double aileron;
     double elevator;
     double elevator_trim;
     double rudder;
     double throttle[FG_MAX_ENGINES];
-};
+} fgCONTROLS, *pfgControls;
 
 
 #define FG_Elevator     c->elevator
@@ -62,6 +62,8 @@ struct fgCONTROLS {
 */
 
 
+extern fgCONTROLS cur_control_params;
+
 void fgControlsInit( void );
 
 void fgElevMove(double amt);
@@ -80,10 +82,14 @@ void fgThrottleSet(int engine, double pos);
 
 
 /* $Log$
-/* Revision 1.10  1998/01/27 00:47:52  curt
-/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
-/* system and commandline/config file processing code.
+/* Revision 1.11  1998/02/07 15:29:36  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.10  1998/01/27 00:47:52  curt
+ * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+ * system and commandline/config file processing code.
+ *
  * Revision 1.9  1998/01/22 02:59:31  curt
  * Changed #ifdef FILE_H to #ifdef _FILE_H
  *
index c2100063699ca592cc991599b6289cac597c038d..879049e204ed56c2e46e35b1c88c1b07bb547d80 100644 (file)
 #include <Flight/LaRCsim/ls_interface.h>
 #include <Main/fg_debug.h>
 
+
+fgFLIGHT cur_flight_params;
+
+
 /* Initialize the flight model parameters */
-int fgFlightModelInit(int model, struct fgFLIGHT *f, double dt) {
+int fgFlightModelInit(int model, fgFLIGHT *f, double dt) {
     int result;
 
     fgPrintf(FG_FLIGHT,FG_INFO,"Initializing flight model\n");
@@ -50,7 +54,7 @@ int fgFlightModelInit(int model, struct fgFLIGHT *f, double dt) {
 
 
 /* Run multiloop iterations of the flight model */
-int fgFlightModelUpdate(int model, struct fgFLIGHT *f, int multiloop) {
+int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop) {
     int result;
 
     if ( model == FG_LARCSIM ) {
@@ -68,10 +72,14 @@ int fgFlightModelUpdate(int model, struct fgFLIGHT *f, int multiloop) {
 
 
 /* $Log$
-/* Revision 1.9  1998/01/27 00:47:53  curt
-/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
-/* system and commandline/config file processing code.
+/* Revision 1.10  1998/02/07 15:29:37  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.9  1998/01/27 00:47:53  curt
+ * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+ * system and commandline/config file processing code.
+ *
  * Revision 1.8  1998/01/19 19:27:03  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index a8ea7075caaf9913c0e162575d68adca6ed99aff..f27d42f8bfcecf9c2dae618fc4a85c6e7b64aa02 100644 (file)
@@ -49,7 +49,7 @@
 typedef double FG_VECTOR_3[3];
 
 /* This is based heavily on LaRCsim/ls_generic.h */
-struct fgFLIGHT {
+typedef struct {
 
 /*================== Mass properties and geometry values ==================*/
 
@@ -382,25 +382,32 @@ struct fgFLIGHT {
 #define FG_Y_pilot_rwy             f->d_pilot_rwy_rwy_v[1]
 #define FG_H_pilot_rwy             f->d_pilot_rwy_rwy_v[2]
 
-};
+} fgFLIGHT, *pfgFlight;
+
+
+extern fgFLIGHT cur_flight_params;
 
 
 /* General interface to the flight model routines */
 
 /* Initialize the flight model parameters */
-int fgFlightModelInit(int model, struct fgFLIGHT *f, double dt);
+int fgFlightModelInit(int model, fgFLIGHT *f, double dt);
 
 /* Run multiloop iterations of the flight model */
-int fgFlightModelUpdate(int model, struct fgFLIGHT *f, int multiloop);
+int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop);
 
 
 #endif /* _FLIGHT_H */
 
 
 /* $Log$
-/* Revision 1.13  1998/01/24 00:04:59  curt
-/* misc. tweaks.
+/* Revision 1.14  1998/02/07 15:29:37  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.13  1998/01/24 00:04:59  curt
+ * misc. tweaks.
+ *
  * Revision 1.12  1998/01/22 02:59:32  curt
  * Changed #ifdef FILE_H to #ifdef _FILE_H
  *
index 0ad6d134de8c22e227ddf68355d4ef11a2d2f248..8a8dd993b17757cddbcda1f14ca44c99c97ea4a3 100644 (file)
@@ -496,11 +496,11 @@ void ls_loop( SCALAR dt, int initialize ) {
 
 
 int ls_cockpit( void ) {
-    struct fgCONTROLS *c;
+    fgCONTROLS *c;
 
     sim_control_.paused = 0;
 
-    c = &current_aircraft.controls;
+    c = current_aircraft.controls;
 
     Lat_control = FG_Aileron;
     Long_control = FG_Elevator;
@@ -562,7 +562,7 @@ int fgLaRCsimUpdate(int multiloop) {
 
 
 /* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
-int fgFlight_2_LaRCsim (struct fgFLIGHT *f) {
+int fgFlight_2_LaRCsim (fgFLIGHT *f) {
     Mass =      FG_Mass;
     I_xx =      FG_I_xx;
     I_yy =      FG_I_yy;
@@ -738,7 +738,7 @@ int fgFlight_2_LaRCsim (struct fgFLIGHT *f) {
 
 
 /* Convert from the LaRCsim generic_ struct to the fgFLIGHT struct */
-int fgLaRCsim_2_Flight (struct fgFLIGHT *f) {
+int fgLaRCsim_2_Flight (fgFLIGHT *f) {
     FG_Mass =   Mass;
     FG_I_xx =   I_xx;
     FG_I_yy =   I_yy;
@@ -915,6 +915,10 @@ int fgLaRCsim_2_Flight (struct fgFLIGHT *f) {
 /* Flight Gear Modification Log
  *
  * $Log$
+ * Revision 1.16  1998/02/07 15:29:38  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
  * Revision 1.15  1998/01/22 22:03:47  curt
  * Removed #include <sys/stat.h>
  *
index 59b2a831396ce41a0b2fc73d54b782d847d66458..958968657567a981f7a9b6304269a71d24bf5d09 100644 (file)
@@ -39,10 +39,10 @@ int fgLaRCsimInit(double dt);
 int fgLaRCsimUpdate(int multiloop);
 
 /* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
-int fgFlight_2_LaRCsim (struct fgFLIGHT *f);
+int fgFlight_2_LaRCsim (fgFLIGHT *f);
 
 /* Convert from the LaRCsim generic_ struct to the fgFLIGHT struct */
-int fgLaRCsim_2_Flight (struct fgFLIGHT *f);
+int fgLaRCsim_2_Flight (fgFLIGHT *f);
 
 void ls_loop( SCALAR dt, int initialize );
 
@@ -51,12 +51,16 @@ void ls_loop( SCALAR dt, int initialize );
 
 
 /* $Log$
-/* Revision 1.6  1998/02/03 23:20:17  curt
-/* Lots of little tweaks to fix various consistency problems discovered by
-/* Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
-/* passed arguments along to the real printf().  Also incorporated HUD changes
-/* by Michele America.
+/* Revision 1.7  1998/02/07 15:29:39  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.6  1998/02/03 23:20:17  curt
+ * Lots of little tweaks to fix various consistency problems discovered by
+ * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
+ * passed arguments along to the real printf().  Also incorporated HUD changes
+ * by Michele America.
+ *
  * Revision 1.5  1998/01/19 19:27:05  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index 20b08bc1cb8c068d00f77e1a9a1ce0012d98abc3..04636b4914de692e33d3716441d590615ded2b86 100644 (file)
@@ -49,12 +49,12 @@ extern int displayInstruments;
 
 /* Handle keyboard events */
 void GLUTkey(unsigned char k, int x, int y) {
-    struct fgCONTROLS *c;
+    fgCONTROLS *c;
     struct fgTIME *t;
     struct fgVIEW *v;
     struct fgWEATHER *w;
 
-    c = &current_aircraft.controls;
+    c = current_aircraft.controls;
     t = &cur_time_params;
     v = &current_view;
     w = &current_weather;
@@ -165,10 +165,10 @@ void GLUTkey(unsigned char k, int x, int y) {
 
 /* Handle "special" keyboard events */
 void GLUTspecialkey(int k, int x, int y) {
-    struct fgCONTROLS *c;
+    fgCONTROLS *c;
     struct fgVIEW *v;
 
-    c = &current_aircraft.controls;
+    c = current_aircraft.controls;
     v = &current_view;
 
     fgPrintf( FG_INPUT, FG_DEBUG, "Special key hit = %d", k);
@@ -245,12 +245,16 @@ void GLUTspecialkey(int k, int x, int y) {
 
 
 /* $Log$
-/* Revision 1.28  1998/02/03 23:20:23  curt
-/* Lots of little tweaks to fix various consistency problems discovered by
-/* Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
-/* passed arguments along to the real printf().  Also incorporated HUD changes
-/* by Michele America.
+/* Revision 1.29  1998/02/07 15:29:40  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.28  1998/02/03 23:20:23  curt
+ * Lots of little tweaks to fix various consistency problems discovered by
+ * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
+ * passed arguments along to the real printf().  Also incorporated HUD changes
+ * by Michele America.
+ *
  * Revision 1.27  1998/01/27 00:47:55  curt
  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
  * system and commandline/config file processing code.
index b99166cd6ff7efcafc74bb088eae3943e539b49c..a5ac4bc61358c1337ac6f4dd1aa7372f27fddf01 100644 (file)
@@ -123,12 +123,12 @@ static void fgInitVisuals( void ) {
  **************************************************************************/
 
 static void fgUpdateViewParams( void ) {
-    struct fgFLIGHT *f;
+    fgFLIGHT *f;
     struct fgLIGHT *l;
     struct fgTIME *t;
     struct fgVIEW *v;
 
-    f = &current_aircraft.flight;
+    f = current_aircraft.flight;
     l = &cur_light_params;
     t = &cur_time_params;
     v = &current_view;
@@ -317,12 +317,12 @@ static void fgRenderFrame( void ) {
  **************************************************************************/
 
 void fgUpdateTimeDepCalcs(int multi_loop) {
-    struct fgFLIGHT *f;
+    fgFLIGHT *f;
     struct fgTIME *t;
     struct fgVIEW *v;
     int i;
 
-    f = &current_aircraft.flight;
+    f = current_aircraft.flight;
     t = &cur_time_params;
     v = &current_view;
 
@@ -467,15 +467,15 @@ static void fgMainLoop( void ) {
     double cur_elev;
     /* double joy_x, joy_y; */
     /* int joy_b1, joy_b2; */
-    struct fgAIRCRAFT *a;
-    struct fgFLIGHT *f;
+    fgAIRCRAFT *a;
+    fgFLIGHT *f;
     struct fgTIME *t;
 
     fgPrintf( FG_ALL, FG_DEBUG, "Running Main Loop\n");
     fgPrintf( FG_ALL, FG_DEBUG, "======= ==== ====\n");
 
     a = &current_aircraft;
-    f = &a->flight;
+    f = a->flight;
     t = &cur_time_params;
 
     /* update "time" */
@@ -571,9 +571,9 @@ static void fgReshape( int width, int height ) {
  **************************************************************************/
 
 int main( int argc, char *argv[] ) {
-    struct fgFLIGHT *f;
+    fgFLIGHT *f;
 
-    f = &current_aircraft.flight;
+    f = current_aircraft.flight;
 
     printf("Flight Gear:  Version %s\n\n", VERSION);
 
@@ -647,12 +647,16 @@ int main( int argc, char *argv[] ) {
 #endif
 
 /* $Log$
-/* Revision 1.56  1998/02/03 23:20:23  curt
-/* Lots of little tweaks to fix various consistency problems discovered by
-/* Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
-/* passed arguments along to the real printf().  Also incorporated HUD changes
-/* by Michele America.
+/* Revision 1.57  1998/02/07 15:29:40  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.56  1998/02/03 23:20:23  curt
+ * Lots of little tweaks to fix various consistency problems discovered by
+ * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
+ * passed arguments along to the real printf().  Also incorporated HUD changes
+ * by Michele America.
+ *
  * Revision 1.55  1998/02/02 20:53:58  curt
  * Incorporated Durk's changes.
  *
index 73022fae09b1c0de3922fedfba8b920afed84ad3..4767a1524d9401c6036e57f5f4192abdd0d54642 100644 (file)
@@ -65,6 +65,7 @@ static struct {
   { "FG_GENERAL", 0x00000080 },
   { "FG_MATH",    0x00000100 },
   { "FG_EVENT",   0x00000200 },
+  { "FG_AIRCRAFT",0x00000400 },
 
   /* Do not edit below here, last entry should be null */
   { "FG_ALL",     0xFFFFFFFF },
index 662869ad61d3772b4510c76c42c1e67afbc487f6..09943db0d6cf545d2a46169dcdb7fb7d9a10a84a 100644 (file)
@@ -44,6 +44,7 @@ typedef enum {
   FG_GENERAL = 0x00000080,
   FG_MATH    = 0x00000100,
   FG_EVENT   = 0x00000200,
+  FG_AIRCRAFT= 0x00000400,
 
   FG_ALL     = 0xFFFFFFFF
 } fgDebugClass;
index 9fe20af12d9476449d7412a65e7a5bc2a1cdd475..40391a5fb325f8758cc382dfe5ef124169c177b3 100644 (file)
@@ -86,12 +86,11 @@ void fgInitGeneral( void ) {
 void fgInitSubsystems( void ) {
     double cur_elev;
 
-    struct fgFLIGHT *f;
+    fgFLIGHT *f;
     struct fgLIGHT *l;
     struct fgTIME *t;
     struct fgVIEW *v;
 
-    f = &current_aircraft.flight;
     l = &cur_light_params;
     t = &cur_time_params;
     v = &current_view;
@@ -104,6 +103,11 @@ void fgInitSubsystems( void ) {
      * should really be read in from one or more files.
      ****************************************************************/
 
+    /* Must happen before any of the flight model or control
+     * parameters are set */
+    fgAircraftInit();
+    f = current_aircraft.flight;
+
     /* Globe Aiport, AZ */
     FG_Runway_longitude = -398391.28;
     FG_Runway_latitude = 120070.41;
@@ -251,7 +255,7 @@ void fgInitSubsystems( void ) {
                     FG_EVENT_READY, 120000 );
 
     /* Initialize the Cockpit subsystem */
-    if( fgCockpitInit( current_aircraft ) == NULL ) {
+    if( fgCockpitInit( &current_aircraft ) == NULL ) {
        fgPrintf( FG_GENERAL, FG_EXIT, "Error in Cockpit initialization!\n" );
     }
 
@@ -324,12 +328,16 @@ void fgInitSubsystems( void ) {
 
 
 /* $Log$
-/* Revision 1.39  1998/02/03 23:20:25  curt
-/* Lots of little tweaks to fix various consistency problems discovered by
-/* Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
-/* passed arguments along to the real printf().  Also incorporated HUD changes
-/* by Michele America.
+/* Revision 1.40  1998/02/07 15:29:44  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.39  1998/02/03 23:20:25  curt
+ * Lots of little tweaks to fix various consistency problems discovered by
+ * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
+ * passed arguments along to the real printf().  Also incorporated HUD changes
+ * by Michele America.
+ *
  * Revision 1.38  1998/02/02 20:53:58  curt
  * Incorporated Durk's changes.
  *
index ddee4460e1f62130636367ba0d837d6a33606796..d263862d118c03e48606c9ba54c9a28e96a5cbe9 100644 (file)
@@ -50,7 +50,7 @@ void fgViewInit(struct fgVIEW *v) {
 
 
 /* Update the view parameters */
-void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
+void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
     MAT3vec vec, forward, v0, minus_z;
     MAT3mat R, TMP, UP, LOCAL, VIEW;
     double ntmp;
@@ -69,9 +69,9 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
     v->view_pos.y = v->abs_view_pos.y - scenery.center.y;
     v->view_pos.z = v->abs_view_pos.z - scenery.center.z;
 
-    printf( "View pos = %.4f, %.4f, %.4f\n", 
+    fgPrintf( FG_VIEW, FG_DEBUG, "Absolute view pos = %.4f, %.4f, %.4f\n", 
           v->abs_view_pos.x, v->abs_view_pos.y, v->abs_view_pos.z);
-    fgPrintf( FG_VIEW, FG_DEBUG, "View pos = %.4f, %.4f, %.4f\n", 
+    fgPrintf( FG_VIEW, FG_DEBUG, "Relative view pos = %.4f, %.4f, %.4f\n", 
           v->view_pos.x, v->view_pos.y, v->view_pos.z);
 
     /* make a vector to the current view position */
@@ -184,9 +184,13 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
 
 
 /* $Log$
-/* Revision 1.12  1998/01/29 00:50:28  curt
-/* Added a view record field for absolute x, y, z position.
+/* Revision 1.13  1998/02/07 15:29:45  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.12  1998/01/29 00:50:28  curt
+ * Added a view record field for absolute x, y, z position.
+ *
  * Revision 1.11  1998/01/27 00:47:58  curt
  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
  * system and commandline/config file processing code.
index 11b0c9208df6c15f2b2ab194547213eb93efcf51..f3987b7c01cec14e149afc30cf8af9de169334c1 100644 (file)
@@ -85,16 +85,20 @@ extern struct fgVIEW current_view;
 void fgViewInit(struct fgVIEW *v);
 
 /* Update the view parameters */
-void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l);
+void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l);
 
 
 #endif /* _VIEWS_H */
 
 
 /* $Log$
-/* Revision 1.9  1998/01/29 00:50:29  curt
-/* Added a view record field for absolute x, y, z position.
+/* Revision 1.10  1998/02/07 15:29:45  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.9  1998/01/29 00:50:29  curt
+ * Added a view record field for absolute x, y, z position.
+ *
  * Revision 1.8  1998/01/27 00:47:58  curt
  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
  * system and commandline/config file processing code.
index b510ea6b6638bbcc05996e1b84f79a0efd5ec204..8837eb7c69f09d6c176a5f1ce0cc87c274aaa218 100644 (file)
@@ -76,12 +76,12 @@ void fgTileMgrLoadTile( struct fgBUCKET *p, int *index) {
 /* given the current lon/lat, fill in the array of local chunks.  If
  * the chunk isn't already in the cache, then read it from disk. */
 void fgTileMgrUpdate( void ) {
-    struct fgFLIGHT *f;
+    fgFLIGHT *f;
     struct fgBUCKET p1, p2;
     static struct fgBUCKET p_last = {-1000, 0, 0, 0};
     int i, j, dw, dh;
 
-    f = &current_aircraft.flight;
+    f = current_aircraft.flight;
 
     fgBucketFind(FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, &p1);
     dw = FG_LOCAL_X / 2;
@@ -211,9 +211,13 @@ void fgTileMgrRender( void ) {
 
 
 /* $Log$
-/* Revision 1.12  1998/02/01 03:39:55  curt
-/* Minor tweaks.
+/* Revision 1.13  1998/02/07 15:29:46  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.12  1998/02/01 03:39:55  curt
+ * Minor tweaks.
+ *
  * Revision 1.11  1998/01/31 00:43:27  curt
  * Added MetroWorks patches from Carmen Volpe.
  *
index 7e7c1598a5ad2b6bf39afcecc80967e0de058c51..33579555bea54a6a79244dc1f186b51199cc182f 100644 (file)
@@ -44,9 +44,9 @@
 
 /* reset flight params to a specific position */
 void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) {
-    struct fgFLIGHT *f;
+    fgFLIGHT *f;
 
-    f = &current_aircraft.flight;
+    f = current_aircraft.flight;
 
     /*
     f->pos_x = pos_x;
@@ -72,11 +72,11 @@ void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) {
 
 /* update position based on inputs, positions, velocities, etc. */
 void fgSlewUpdate( void ) {
-    struct fgFLIGHT *f;
-    struct fgCONTROLS *c;
+    fgFLIGHT *f;
+    fgCONTROLS *c;
 
-    f = &current_aircraft.flight;
-    c = &current_aircraft.controls;
+    f = current_aircraft.flight;
+    c = current_aircraft.controls;
 
     /* f->Psi += ( c->aileron / 8 );
     if ( f->Psi > FG_2PI ) {
@@ -93,10 +93,14 @@ void fgSlewUpdate( void ) {
 
 
 /* $Log$
-/* Revision 1.10  1998/01/27 00:47:53  curt
-/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
-/* system and commandline/config file processing code.
+/* Revision 1.11  1998/02/07 15:29:39  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.10  1998/01/27 00:47:53  curt
+ * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+ * system and commandline/config file processing code.
+ *
  * Revision 1.9  1998/01/19 19:27:06  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index da4c0bc0801ce61dbdd8fec41b0b0d267b48d277..07e5b3c83eb2f362d4ee0f6ed4d2b8f99dee8ed8 100644 (file)
@@ -250,7 +250,7 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
 
 /* Update the time dependent variables */
 
-void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
+void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t) {
     double gst_precise, gst_course;
 
     fgPrintf( FG_EVENT, FG_BULK, "Updating time\n");
@@ -311,9 +311,13 @@ void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
 
 
 /* $Log$
-/* Revision 1.33  1998/02/02 20:54:04  curt
-/* Incorporated Durk's changes.
+/* Revision 1.34  1998/02/07 15:29:47  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.33  1998/02/02 20:54:04  curt
+ * Incorporated Durk's changes.
+ *
  * Revision 1.32  1998/02/01 03:39:56  curt
  * Minor tweaks.
  *
index 82d743b6ebebb1e14bf040769ce1b5a5bb031fc4..0ac15110bae2da0ca954fd1bf6601c6b87e5f732 100644 (file)
@@ -92,17 +92,21 @@ extern struct fgLIGHT cur_light_params;
 void fgTimeInit(struct fgTIME *t);
 
 /* Update the time dependent variables */
-void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t);
+void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t);
 
 
 #endif /* _FG_TIME_H */
 
 
 /* $Log$
-/* Revision 1.15  1998/01/27 00:48:06  curt
-/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
-/* system and commandline/config file processing code.
+/* Revision 1.16  1998/02/07 15:29:47  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.15  1998/01/27 00:48:06  curt
+ * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+ * system and commandline/config file processing code.
+ *
  * Revision 1.14  1998/01/22 02:59:43  curt
  * Changed #ifdef FILE_H to #ifdef _FILE_H
  *