]> git.mxchange.org Git - flightgear.git/commitdiff
Lots of little tweaks to fix various consistency problems discovered by
authorcurt <curt>
Tue, 3 Feb 1998 23:20:08 +0000 (23:20 +0000)
committercurt <curt>
Tue, 3 Feb 1998 23:20:08 +0000 (23:20 +0000)
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.

16 files changed:
Astro/orbits.c
Astro/planets.c
Cockpit/cockpit.c
Cockpit/hud.c
Cockpit/hud.h
Joystick/joystick.c
LaRCsim/ls_interface.h
LaRCsim/navion_gear.c
Main/GLUTkey.c
Main/GLUTmain.c
Main/Makefile
Main/fg_debug.c
Main/fg_init.c
Scenery/Makefile
Simulator/Thanks
Simulator/commondefs

index 452a7818ac1ec6f261471583b0c97edd8192af2e..6c82f79a42ca2919dfa55e13ebb6720229bb0a83 100644 (file)
@@ -150,6 +150,7 @@ void fgSolarSystemInit(struct fgTIME t)
                      "Cannot open data file: '%s'\n", path);
            return;
    }
+   /* printf("  reading datafile %s\n", path); */
    fgPrintf( FG_ASTRO, FG_INFO, "  reading datafile %s\n", path);
 
    /* for all the objects... */
@@ -182,9 +183,15 @@ void fgSolarSystemUpdate(struct OrbElements *planet, struct fgTIME t)
 
 
 /* $Log$
-/* Revision 1.5  1998/02/02 20:53:22  curt
-/* To version 0.29
+/* Revision 1.6  1998/02/03 23:20:11  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/02/02 20:53:22  curt
+ * To version 0.29
+ *
  * Revision 1.4  1998/01/27 00:47:47  curt
  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
  * system and commandline/config file processing code.
index f33e5e9c9da24d64dd0003a63712b0bc124bc3e8..90dea620aef4ae88dcb73e0b7566fda6a850a004 100644 (file)
@@ -118,7 +118,7 @@ struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
        Nr = 2.9585076 + 6.6672E-7*actTime;
        
        B = asin ( sin (result.Declination) * cos(ir) - cos(result.Declination) * sin (ir) * sin (result.RightAscension - Nr));
-       ring_magn = -2.6 * sin (abs(B)) + 1.2 * pow(sin(B),2);
+       ring_magn = -2.6 * sin (fabs(B)) + 1.2 * pow(sin(B),2);
        result.magnitude = -9.0 + 5*log10( r*R ) + 0.044 * FV + ring_magn;
        break;
       case 7: /* Uranus */
@@ -204,9 +204,15 @@ void fgPlanetsRender( void ) {
 
 
 /* $Log$
-/* Revision 1.4  1998/02/02 20:53:23  curt
-/* To version 0.29
+/* Revision 1.5  1998/02/03 23:20:12  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.4  1998/02/02 20:53:23  curt
+ * To version 0.29
+ *
  * Revision 1.3  1998/01/27 00:47:47  curt
  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
  * system and commandline/config file processing code.
index c3502d6b650449801bdb6986dbf217c3f9c17ba7..8a22819cb006788a66ffa96ebd4c4e875d2be88a 100644 (file)
@@ -57,7 +57,7 @@ struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft )
        if( cockpit == NULL )
                return( NULL );
                
-       cockpit->code = 1234;
+       cockpit->code = 1;      /* It will be aircraft dependent */
        cockpit->status = 0;
        
        /* If aircraft has HUD */
@@ -94,9 +94,15 @@ void fgCockpitUpdate( void )
 
 
 /* $Log$
-/* Revision 1.8  1998/01/31 00:43:03  curt
-/* Added MetroWorks patches from Carmen Volpe.
+/* 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.
+ *
  * Revision 1.7  1998/01/27 00:47:51  curt
  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
  * system and commandline/config file processing code.
index 5425d21b2ac29a3229029707d0e470295197876c..dce3cb5730046423b72cc8c732ce6c1f4114fdb6 100644 (file)
  **************************************************************************/
  
 
+#ifdef WIN32
+#  include <windows.h>
+#endif
+
 #include <GL/glut.h>
 #include <stdlib.h>
+#include <string.h>
+
 #ifndef WIN32
 #  include <values.h>  /* for MAXINT */
 #endif /* not WIN32 */
-#include "hud.h"
 
-#include <Include/fg_constants.h>
+#include "hud.h"
 
 #include <Aircraft/aircraft.h>
-/* #include <Scenery/mesh.h> */
-#include <Scenery/scenery.h>
+#include <Include/fg_constants.h>
+#include <Main/fg_debug.h>
+#include <Math/fg_random.h>
 #include <Math/mat3.h>
 #include <Math/polar.h>
+#include <Scenery/scenery.h>
 #include <Time/fg_timer.h>
-#include <Math/fg_random.h>
 #include <Weather/weather.h>
 
 // #define DEBUG
@@ -335,7 +341,7 @@ static void drawladder( struct HUD_ladder ladder )
                                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);
+                                       (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)+\
@@ -416,6 +422,110 @@ static void drawhorizon( struct HUD_horizon horizon )
        }       
 }
 
+/*
+
+       Draws a representation of the control surfaces in their current state
+               anywhere in the HUD
+       
+       Needs: struct HUD_control_surfaces
+
+*/
+static void drawcontrolsurfaces( struct 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;
+       
+       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;
+       
+       /* 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 );
+       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) );
+       }
+       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) );
+       }
+       
+       /* 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 );
+       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 );
+       }
+       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 );
+       }
+       
+       /* 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 );
+       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 );
+       }
+       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 );
+       }
+       
+       
+       /* 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) );
+       
+       
+       /* 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 );
+       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) );
+       }
+       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) );
+       }
+       
+}
+
 /*
 
        Draws a label anywhere in the HUD
@@ -439,12 +549,10 @@ static void drawlabel( struct HUD_label label )
 
        sprintf( string, buffer, (*label.load_value)() );
 
-#ifdef DEBUG   
        fgPrintf( FG_COCKPIT, FG_DEBUG,  buffer );
        fgPrintf( FG_COCKPIT, FG_DEBUG,  "\n" );
        fgPrintf( FG_COCKPIT, FG_DEBUG, string );
        fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
-#endif
 
        lenstr = strlen( string );
        if( label.justify == LEFT_JUST )
@@ -498,7 +606,7 @@ double get_heading( void )
        struct fgFLIGHT *f;
               
        f = &current_aircraft.flight;
-       return( FG_Psi*RAD_TO_DEG ); 
+       return( FG_Psi*RAD_TO_DEG );
 }
 
 double get_altitude( void )
@@ -510,7 +618,7 @@ double get_altitude( void )
        /* rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
                                           FG_Latitude  * RAD_TO_ARCSEC); */
                                                    
-       return( FG_Altitude * FEET_TO_METER /* - rough_elev */ );
+       return( FG_Altitude * FEET_TO_METER /* -rough_elev */ );
 }
 
 void add_instrument( Hptr hud, HIptr instrument )
@@ -529,7 +637,7 @@ Hptr fgHUDInit( struct fgAIRCRAFT current_aircraft, int color )
        if( hud == NULL )
                return( NULL );
                
-       hud->code = 123;
+       hud->code = 1;          /* It will be aircraft dependent */
        hud->status = 0;
        
        // For now lets just hardcode a hud here .
@@ -543,6 +651,7 @@ Hptr fgHUDInit( struct fgAIRCRAFT current_aircraft, int color )
        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 );
 }
@@ -704,6 +813,38 @@ Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_heig
        return( hud );
 }
 
+Hptr fgHUDAddControlSurfaces( Hptr hud, int x_pos, int y_pos, double (*load_value)() )
+{
+       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 )
+               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;
+
+       return( hud );
+}
+
 /*
 Hptr fgHUDAddMovingHorizon( Hptr hud, int x_pos, int y_pos, int length, int hole_len, \
                                                int color )
@@ -747,19 +888,15 @@ void fgUpdateHUD( Hptr hud )
        glLineWidth(1);
        glColor3f (0.1, 0.9, 0.1);
                       
-#ifdef DEBUG    
     fgPrintf( FG_COCKPIT, FG_DEBUG,  "HUD Code %d  Status %d\n", 
              hud->code, hud->status ); 
-#endif
     hud_instr = hud->instruments;
        while( hud_instr != NULL )
        {
                instr_data = hud_instr->instr;
-#ifdef DEBUG
                fgPrintf( FG_COCKPIT, FG_DEBUG, 
                          "Instr Type %d   SubType %d  Orient %d\n", 
                          hud_instr->type, hud_instr->sub_type, hud_instr->orientation );
-#endif
                if( hud_instr->type == ARTIFICIAL_HORIZON )
                {
                        drawhorizon( instr_data.horizon );
@@ -775,6 +912,10 @@ void fgUpdateHUD( Hptr hud )
                                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 );
@@ -801,9 +942,15 @@ void fgUpdateHUD( Hptr hud )
 
 
 /* $Log$
-/* Revision 1.9  1998/01/31 00:43:04  curt
-/* Added MetroWorks patches from Carmen Volpe.
+/* 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.
+ *
  * Revision 1.8  1998/01/27 00:47:51  curt
  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
  * system and commandline/config file processing code.
index 012ab584231f69b82651f8fcc3c7737ed8579776..0e34464d898cec39ba1c675e485829b28d67b4bb 100644 (file)
@@ -38,6 +38,7 @@
 #define SCALE                          2
 #define LADDER                         3
 #define LABEL                          4
+#define CONTROL_SURFACES               5
 
 /* Scale constants */
 #define HORIZONTAL                     1
@@ -162,6 +163,13 @@ struct HUD_horizon {
        double (*load_value)( void );
 };
 
+struct HUD_control_surfaces {
+       int type;
+       int x_pos;
+       int y_pos;
+       double (*load_value)();
+};
+
 #define LABEL_COUNTER  1
 #define LABEL_WARNING  2
 
@@ -185,6 +193,7 @@ union HUD_instr_data {
        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;
@@ -216,7 +225,7 @@ Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int jus
 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, \
@@ -233,9 +242,15 @@ void fgUpdateHUD2( struct HUD *hud );
 
 
 /* $Log$
-/* Revision 1.6  1998/01/22 02:59:30  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* 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
+ *
  * Revision 1.5  1998/01/19 19:27:01  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index caf08337c405dfc52d37f280ee40931535b3b695..0bc02ab4df031f978b47532c6a56ad848f76c96d 100644 (file)
@@ -96,8 +96,9 @@ int fgJoystickInit( int joy_num ) {
                if( js.y < joy_y_dead_min )
                        joy_y_dead_min = js.y;
                
-               // printf( "Xmin %d Xmax %d Ymin %d Ymax %d", joy_x_dead_min, joy_x_dead_max, \
-               //              joy_y_dead_min, joy_y_dead_max );
+               /* printf( "Xmin %d Xmax %d Ymin %d Ymax %d", 
+                          joy_x_dead_min, joy_x_dead_max,
+                          joy_y_dead_min, joy_y_dead_max ); */
        }
        status = read(joystick_fd, &js, JS_RETURN);
        if (status != JS_RETURN) {
@@ -206,6 +207,8 @@ int fgJoystickInit( int joy_num ) {
        // printf("Joystick calibration: X_ctr = %d, Y_ctr = %d\n", joy_x_ctr, joy_y_ctr );
        
        return( joystick_fd );
+#else
+       return( 0 );
 #endif
 }
 
@@ -247,16 +250,22 @@ int fgJoystickRead( double *joy_x, double *joy_y, int *joy_b1, int *joy_b2 )
        *joy_b1 = js.buttons & 1;
        *joy_b2 = js.buttons & 2;
 
-       return( 0 );
 #endif
+       return( 0 );
 }
 
 
 /* $Log$
-/* Revision 1.3  1998/01/27 00:47:54  curt
-/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
-/* system and commandline/config file processing code.
+/* Revision 1.4  1998/02/03 23:20:20  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.3  1998/01/27 00:47:54  curt
+ * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+ * system and commandline/config file processing code.
+ *
  * Revision 1.2  1997/12/30 20:47:40  curt
  * Integrated new event manager with subsystem initializations.
  *
index 8550431c49819fde90c2f25dc0615e4700fe85cb..59b2a831396ce41a0b2fc73d54b782d847d66458 100644 (file)
@@ -29,6 +29,7 @@
 
 
 #include <Flight/flight.h>
+#include "ls_types.h"
 
 
 /* reset flight params to a specific position */ 
@@ -43,15 +44,23 @@ int fgFlight_2_LaRCsim (struct fgFLIGHT *f);
 /* Convert from the LaRCsim generic_ struct to the fgFLIGHT struct */
 int fgLaRCsim_2_Flight (struct fgFLIGHT *f);
 
+void ls_loop( SCALAR dt, int initialize );
+
 
 #endif /* _LS_INTERFACE_H */
 
 
 /* $Log$
-/* 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.
+/* 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.
+ *
  * Revision 1.4  1998/01/19 18:40:27  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index a527159596d5ef01bba534911c5e1a679aaf5a7a..412eb828ff6b691fd901ac3ebc8f9b177bbb7726 100644 (file)
 
 $Header$
 $Log$
+Revision 1.3  1998/02/03 23:20:18  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.2  1998/01/19 18:40:29  curt
 Tons of little changes to clean up the code and to remove fatal errors
 when building with the c++ compiler.
@@ -72,42 +78,42 @@ Initial Flight Gear revision.
 #include "ls_cockpit.h"
 
 
-sub3( DATA v1[],  DATA v2[], DATA result[] )
+void sub3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[0] - v2[0];
     result[1] = v1[1] - v2[1];
     result[2] = v1[2] - v2[2];
 }
 
-add3( DATA v1[],  DATA v2[], DATA result[] )
+void add3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[0] + v2[0];
     result[1] = v1[1] + v2[1];
     result[2] = v1[2] + v2[2];
 }
 
-cross3( DATA v1[],  DATA v2[], DATA result[] )
+void cross3( DATA v1[],  DATA v2[], DATA result[] )
 {
     result[0] = v1[1]*v2[2] - v1[2]*v2[1];
     result[1] = v1[2]*v2[0] - v1[0]*v2[2];
     result[2] = v1[0]*v2[1] - v1[1]*v2[0];
 }
 
-multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
+void multtrans3x3by3( DATA m[][3], DATA v[], DATA result[] )
 {
     result[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2];
     result[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2];
     result[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2];
 }
 
-mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
+void mult3x3by3( DATA m[][3], DATA v[], DATA result[] )
 {
     result[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];
     result[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];
     result[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2];
 }
 
-clear3( DATA v[] )
+void clear3( DATA v[] )
 {
     v[0] = 0.; v[1] = 0.; v[2] = 0.;
 }
index 0a3a5a700b6440db8b4f804c1620d0b2900ce082..20b08bc1cb8c068d00f77e1a9a1ce0012d98abc3 100644 (file)
@@ -31,6 +31,7 @@
 #include <GL/glut.h>
 #include <XGL/xgl.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #include <Main/GLUTkey.h>
 #include <Main/fg_debug.h>
@@ -244,10 +245,16 @@ void GLUTspecialkey(int k, int x, int y) {
 
 
 /* $Log$
-/* 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.
+/* 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.
+ *
  * Revision 1.26  1998/01/19 19:27:07  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index 1fdb289d037ac35eaacf37e62828b170e08c680d..b99166cd6ff7efcafc74bb088eae3943e539b49c 100644 (file)
@@ -639,10 +639,23 @@ int main( int argc, char *argv[] ) {
 }
 
 
+#ifdef __SUNPRO_CC
+    extern "C" {
+       void __eprintf( void ) {
+       }
+    }
+#endif
+
 /* $Log$
-/* Revision 1.55  1998/02/02 20:53:58  curt
-/* Incorporated Durk's changes.
+/* 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.
+ *
  * Revision 1.54  1998/01/31 00:43:10  curt
  * Added MetroWorks patches from Carmen Volpe.
  *
index 798053af8f933d42811e7ec8f5adcab549e8db4f..a7d779b6473a809519d9dec5dff27051511abeed 100644 (file)
@@ -45,12 +45,19 @@ include $(FG_ROOT_SRC)/commondefs
 
 $(TARGET)$(EXT): $(OBJECTS) $(FG_ROOT_LIB)/stamp_libs
        $(CC) -o $(TARGET)$(EXT) $(OBJECTS) $(LDFLAGS) $(LDLIBS)
+       $(RM) fg$(FG_VERSION_MAJOR)$(EXT)
        $(LN) $(TARGET)$(EXT) fg$(FG_VERSION_MAJOR)$(EXT)
 
 include $(COMMONRULES)
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.46  1998/02/03 23:20:24  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.45  1998/01/27 00:47:57  curt
 # Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
 # system and commandline/config file processing code.
index 7cc80b7231a0376fca7a9e6d88d411964f820fd4..73022fae09b1c0de3922fedfba8b920afed84ad3 100644 (file)
  * (Log is kept at end of this file)
  **************************************************************************/
 
+#include <string.h>
 #include <Main/fg_debug.h>
-#include <varargs.h>
 #include <stdio.h>
+#include <stdarg.h>
 #include <stdlib.h>
-#include <strings.h> /* probably not portable */
 
 static int fg_DebugSem = 1;
 static fgDebugClass fg_DebugClass = FG_ALL;
@@ -191,6 +191,7 @@ fgDebugCallback fgRegisterDebugCallback( fgDebugCallback callback )
 int fgPrintf( fgDebugClass dbg_class, fgDebugPriority prio, char *fmt, ... )
 {
   char szOut[1024+1];
+  va_list ap;
   int ret = 0;
 
   FG_GRABDEBUGSEM;
@@ -199,7 +200,11 @@ int fgPrintf( fgDebugClass dbg_class, fgDebugPriority prio, char *fmt, ... )
     FG_RELEASEDEBUGSEM;
     return 0;
   } 
-  ret = vsprintf( szOut, fmt, (&fmt+1));
+
+  /* ret = vsprintf( szOut, fmt, (&fmt+1)); (but it didn't work, thus ... */
+  va_start (ap, fmt);
+  ret = vsprintf( szOut, fmt, ap);
+  va_end (ap);
 
   if( fg_DebugCallback!=NULL && fg_DebugCallback(dbg_class, prio, szOut) ) {
     FG_RELEASEDEBUGSEM;
index c4d8740d4ae125b618b42073ca09ce042c2d6093..9fe20af12d9476449d7412a65e7a5bc2a1cdd475 100644 (file)
@@ -153,7 +153,7 @@ void fgInitSubsystems( void ) {
     /* FG_Altitude = FG_Runway_altitude + 3.758099; */
     
     /* Initial Position north of the city of Globe */
-    /* FGto do the install_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD; */
+    /* FG_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Latitude  = (  120625.64 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Longitude = ( -397867.44 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Latitude  = (  119548.21 / 3600.0 ) * DEG_TO_RAD; */
@@ -170,6 +170,12 @@ void fgInitSubsystems( void ) {
     /* FG_Latitude  = (  45.15 ) * DEG_TO_RAD; */
     /* FG_Altitude = FG_Runway_altitude + 3.758099; */
 
+    /* Initial Position: Somewhere near the Grand Canyon */
+    FG_Longitude = ( -112.5 ) * DEG_TO_RAD;
+    FG_Latitude  = (  36.5 ) * DEG_TO_RAD;
+    FG_Runway_altitude = 5000.0;
+    FG_Altitude = FG_Runway_altitude + 3.758099;
+
     /* A random test position */
     /* FG_Longitude = ( 88128.00 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Latitude  = ( 93312.00 / 3600.0 ) * DEG_TO_RAD; */
@@ -318,9 +324,15 @@ void fgInitSubsystems( void ) {
 
 
 /* $Log$
-/* Revision 1.38  1998/02/02 20:53:58  curt
-/* Incorporated Durk's changes.
+/* 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.
+ *
  * Revision 1.37  1998/02/01 03:39:54  curt
  * Minor tweaks.
  *
index 034cf545d43b5045c71e17a068d09f3b03c8e114..1e2eb9174237d2e3f52adad16ae77557a2236f2c 100644 (file)
@@ -27,7 +27,7 @@
 ARLIBRARY = libScenery.a
 TARGETS = $(ARLIBRARY)
 
-CFILES =  bucketutils.c common.c obj.c scenery.c texload.c tilecache.c tilemgr.c
+CFILES =  bucketutils.c obj.c scenery.c texload.c tilecache.c tilemgr.c
 CXXFILES = 
 
 LDIRT = $(FG_ROOT_LIB)/$(ARLIBRARY)
index 245bde7cb10c8e1de8117533f4ae16c271b7c7b3..360f600579204c931f300a97cf5250cd13198c0a 100644 (file)
@@ -7,6 +7,10 @@ possible only by the help and hard work of others.  I want to properly
 credit everyone who has contributed to this project.
 
 
+Michele America <nomimarketing@mail.telepac.pt>
+  Contributed the HUD code.
+
+
 Steve Baker <sbaker@link.com>
   Steve has provided an immense amount of coaching and tutelage, both
   on the subjects of flight simulation and OpenGL.  It has been his
@@ -64,6 +68,12 @@ U.S. Geological Survey - http://edcwww.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html
   Provided geographic data used by this project
 
 
+Durk Talsma <pn_talsma@macmail.psy.uva.nl>
+  Accurate Sun, Moon, and Planets.  Sun changes color based on
+  position in sky.  Moon has correct phase and blends well into the
+  sky.  Planets are correctly positioned and have proper magnitude.
+
+
 Carmelo Volpe <carmelo.volpe@csb.ki.se>
   Porting Flight Gear to the Metro Works development environment (PC/Mac)
 
index 9e8b7f6df22d62eaa4d8b97b611321a29dd94b02..d1f700d77da92f53fb56111543399e9d69cde81b 100644 (file)
@@ -5,7 +5,7 @@
 #---------------------------------------------------------------------------
 
 FG_VERSION_MAJOR = 0
-FG_VERSION_MINOR = 29
+FG_VERSION_MINOR = 31
 FG_VERSION = $(FG_VERSION_MAJOR).$(FG_VERSION_MINOR)
 
 
@@ -43,7 +43,7 @@ TAR = tar
 #
 #---------------------------------------------------------------------------
 
-GLOBAL_CFLAGS = -Wall -DVERSION=\"$(FG_VERSION)\"
+GLOBAL_CFLAGS = -g -Wall -DVERSION=\"$(FG_VERSION)\"
 
 
 #---------------------------------------------------------------------------