]> git.mxchange.org Git - flightgear.git/commitdiff
Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
authorcurt <curt>
Tue, 27 Jan 1998 00:47:41 +0000 (00:47 +0000)
committercurt <curt>
Tue, 27 Jan 1998 00:47:41 +0000 (00:47 +0000)
system and commandline/config file processing code.

36 files changed:
Aircraft/aircraft.c
Astro/moon.c
Astro/orbits.c
Astro/planets.c
Astro/sky.c
Astro/stars.c
Astro/sun.c
Cockpit/cockpit.c
Cockpit/hud.c
Controls/controls.h
FDM/flight.c
Joystick/joystick.c
Main/GLUTkey.c
Main/GLUTmain.c
Main/Makefile
Main/fg_init.c
Main/views.c
Main/views.h
Scenery/bucketutils.c
Scenery/mesh.c
Scenery/obj.h
Scenery/scenery.h
Scenery/tilecache.c
Scenery/tilecache.h
Scenery/tilemgr.c
Simulator/Makefile
Simulator/Thanks
Simulator/commondefs
Simulator/runfg
Slew/slew.c
Time/event.c
Time/fg_time.c
Time/fg_time.h
Time/sunpos.c
Time/sunpos.h
Weather/weather.c

index 54e47f539a9dc5545ced68168409eade185351ce..62673933efa020883c2c2faca6b03c4e9583f4ca 100644 (file)
@@ -27,8 +27,8 @@
 #include <stdio.h>
 
 #include <Aircraft/aircraft.h>
-#include <Include/constants.h>
-
+#include <Include/fg_constants.h>
+#include <Main/fg_debug.h>
 
 /* This is a record containing all the info for the aircraft currently
    being operated */
@@ -43,20 +43,26 @@ void fgAircraftOutputCurrent(struct fgAIRCRAFT *a) {
     f = &a->flight;
     c = &a->controls;
 
-    printf("Pos = (%.2f,%.2f,%.2f)  (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n",
-          FG_Longitude * 3600.0 * RAD_TO_DEG, 
-           FG_Latitude  * 3600.0 * RAD_TO_DEG,
-          FG_Altitude, FG_Phi, FG_Theta, FG_Psi);
-    printf("Kts = %.0f  Elev = %.2f, Aileron = %.2f, Rudder = %.2f  Power = %.2f\n", 
-          FG_V_equiv_kts, FG_Elevator, FG_Aileron, FG_Rudder, FG_Throttle[0]);
+    fgPrintf( FG_FLIGHT, FG_DEBUG,
+             "Pos = (%.2f,%.2f,%.2f)  (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n",
+             FG_Longitude * 3600.0 * RAD_TO_DEG, 
+             FG_Latitude  * 3600.0 * RAD_TO_DEG,
+             FG_Altitude, FG_Phi, FG_Theta, FG_Psi);
+    fgPrintf( FG_FLIGHT, FG_DEBUG,
+             "Kts = %.0f  Elev = %.2f, Aileron = %.2f, Rudder = %.2f  Power = %.2f\n", 
+             FG_V_equiv_kts, FG_Elevator, FG_Aileron, FG_Rudder, FG_Throttle[0]);
 }
 
 
 /* $Log$
-/* 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.
+/* 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.
+ *
  * Revision 1.13  1997/12/15 23:54:30  curt
  * Add xgl wrappers for debugging.
  * Generate terrain normals on the fly.
index 4160b8d44025da3c9eb2b187db1ac8d61c364c84..a32ccd3f53b07e77cd1581d08a1183b59bef1cff 100644 (file)
 #include <Astro/moon.h>
 
 #include <Aircraft/aircraft.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 #include <Include/general.h>
 #include <Main/views.h>
 #include <Time/fg_time.h>
+#include <Main/fg_debug.h>
 
 struct CelestialCoord moonPos;
 
@@ -261,7 +262,7 @@ void fgMoonInit( void ) {
     struct fgLIGHT *l;
     static int dl_exists = 0;
 
-    printf("Initializing the Moon\n");
+    fgPrintf( FG_ASTRO, FG_INFO, "Initializing the Moon\n");
 
     l = &cur_light_params;
 
@@ -270,8 +271,9 @@ void fgMoonInit( void ) {
     moonPos = fgCalculateMoon(pltOrbElements[1], pltOrbElements[0], 
                              cur_time_params);
 #ifdef DEBUG
-    printf("Moon found at %f (ra), %f (dec)\n", moonPos.RightAscension, 
-          moonPos.Declination);
+    fgPrintf( FG_ASTRO, FG_DEBUG, 
+             "Moon found at %f (ra), %f (dec)\n", moonPos.RightAscension, 
+             moonPos.Declination);
 #endif
 
     xMoon = 60000.0 * cos(moonPos.RightAscension) * cos(moonPos.Declination);
@@ -320,10 +322,14 @@ void fgMoonRender( void ) {
 
 
 /* $Log$
-/* Revision 1.3  1998/01/19 19:26:57  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* 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.
 /*
+ * Revision 1.3  1998/01/19 19:26:57  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
  * Revision 1.2  1998/01/19 18:40:16  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index 432dfc7dd35811df13e3242e69faee143942fa24..598ecd7861a1feef1983e7b9cc907299b8f3a82d 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <Include/general.h>
 #include <Time/fg_time.h>
-
+#include <Main/fg_debug.h>
 
 struct OrbElements pltOrbElements[9];
 
@@ -126,7 +126,7 @@ void fgSolarSystemInit(struct fgTIME t)
    int i;
    FILE *data;
 
-   printf("Initializing solar system\n");
+   fgPrintf( FG_ASTRO, FG_INFO, "Initializing solar system\n");
 
    /* build the full path name to the orbital elements database file */
    g = &general;
@@ -137,11 +137,11 @@ void fgSolarSystemInit(struct fgTIME t)
 
    if ( (data = fopen(path, "r")) == NULL )
    {
-           printf("Cannot open data file: '%s'\n", path);
+           fgPrintf( FG_ASTRO, FG_ALERT, "Cannot open data file: '%s'\n", path);
            return;
    }
    #ifdef DEBUG
-   printf("  reading datafile %s\n", path);
+   fgPrintf( FG_ASTRO, FG_INFO, "  reading datafile %s\n", path);
    #endif
 
    /* for all the objects... */
@@ -174,9 +174,13 @@ void fgSolarSystemUpdate(struct OrbElements *planet, struct fgTIME t)
 
 
 /* $Log$
-/* Revision 1.3  1998/01/22 02:59:27  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* 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.
 /*
+ * Revision 1.3  1998/01/22 02:59:27  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
  * Revision 1.2  1998/01/19 19:26:58  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index 71d254f60a45709c16344f4e69575bf97c94e08c..6c3af2fc20d6a88569f623aa077be3c004a121b3 100644 (file)
@@ -27,7 +27,7 @@
 #include <Astro/orbits.h>
 #include <Astro/planets.h>
 #include <Astro/sun.h>
-
+#include <Main/fg_debug.h>
 
 struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
                                         struct OrbElements theSun,
@@ -118,25 +118,31 @@ struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
        result.magnitude = -6.90 + 5*log10 (r*R) + 0.001 *FV;
        break;
       default:
-       printf("index %d out of range !!!!\n", idx);
+       fgPrintf( FG_ASTRO, FG_ALERT, "index %d out of range !!!!\n", idx);
       }
-    printf("    Planet found at %f (ra), %f (dec)\n", 
-          result.RightAscension, result.Declination);
-    printf("      Geocentric dist     %f\n"
-           "      Heliocentric dist   %f\n"
-          "      Distance to the sun %f\n"
-          "      Phase angle         %f\n"
-          "      Brightness          %f\n", R, r, s, FV, result.magnitude);
+    fgPrintf( FG_ASTRO, FG_DEBUG,
+             "    Planet found at %f (ra), %f (dec)\n", 
+             result.RightAscension, result.Declination);
+    fgPrintf( FG_ASTRO, FG_DEBUG,
+             "      Geocentric dist     %f\n"
+             "      Heliocentric dist   %f\n"
+             "      Distance to the sun %f\n"
+             "      Phase angle         %f\n"
+             "      Brightness          %f\n", R, r, s, FV, result.magnitude);
     return result;
 }
 
 
 
 /* $Log$
-/* Revision 1.2  1998/01/19 19:26:59  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* 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.
 /*
+ * Revision 1.2  1998/01/19 19:26:59  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
  * Revision 1.1  1998/01/07 03:16:18  curt
  * Moved from .../Src/Scenery/ to .../Src/Astro/
  *
index fd450831a2d23f3a3843f9eeee5bfdb092e435b5..15cdf77594db03e02ee7bf7228e939689074d2a2 100644 (file)
@@ -45,7 +45,7 @@
 
 #include <Aircraft/aircraft.h>
 #include <Flight/flight.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 #include <Main/views.h>
 #include <Math/fg_random.h>
 
@@ -353,10 +353,14 @@ void fgSkyRender( void ) {
 
 
 /* $Log$
-/* 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.
+/* 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.
+ *
  * Revision 1.3  1998/01/19 19:26:59  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index eda5b77312d7051dadc9eb34649c9644ad89a0fb..937d0d9e5fe526498d517b10fc21f731c34a99d0 100644 (file)
 #include <Astro/planets.h>
 #include <Astro/stars.h>
 
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 #include <Include/general.h>
 #include <Aircraft/aircraft.h>
 #include <Main/views.h>
 #include <Time/fg_time.h>
-
+#include <Main/fg_debug.h>
 
 #define EpochStart           (631065600)
 #define DaysSinceEpoch(secs) (((secs)-EpochStart)*(1.0/(24*3600)))
@@ -68,7 +68,7 @@ void fgStarsInit( void ) {
     double ra_save1, decl_save1;
     int count, i, j, max_stars;
 
-    printf("Initializing stars\n");
+    fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n");
 
     g = &general;
 
@@ -81,10 +81,10 @@ void fgStarsInit( void ) {
     max_stars = FG_MAX_STARS;
 
     for ( i = 0; i < FG_STAR_LEVELS; i++ ) {
-       printf("  Loading %d Stars: %s\n", max_stars, path);
+       fgPrintf( FG_ASTRO, FG_INFO, "  Loading %d Stars: %s\n", max_stars, path);
 
        if ( (fd = fopen(path, "r")) == NULL ) {
-           printf("Cannot open star file: '%s'\n", path);
+           fgPrintf( FG_ASTRO, FG_ALERT, "Cannot open star file: '%s'\n", path);
            return;
        }
        
@@ -276,10 +276,14 @@ void fgStarsRender( void ) {
 
 
 /* $Log$
-/* Revision 1.3  1998/01/19 19:26:59  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.4  1998/01/27 00:47:49  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.3  1998/01/19 19:26:59  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
  * Revision 1.2  1998/01/19 18:40:18  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index ecb891f9e26ea2ba16ca11095542a3d318ca8687..b1a10585ad59278fc2431ae6d50a92a6c215bb2a 100644 (file)
@@ -29,6 +29,7 @@
 #include <Main/views.h>
 #include <Astro/orbits.h>
 #include <Astro/sun.h>
+#include <Main/fg_debug.h>
 
 GLint sun_obj;
 
@@ -97,13 +98,14 @@ struct CelestialCoord fgCalculateSun(struct OrbElements params, struct fgTIME t)
 void fgSunInit( void ) {
     static int dl_exists = 0;
 
-    printf("  Initializing the Sun\n");
+    fgPrintf( FG_ASTRO, FG_INFO, "  Initializing the Sun\n");
 
     fgSolarSystemUpdate(&(pltOrbElements[0]), cur_time_params);
     sunPos = fgCalculateSun(pltOrbElements[0], cur_time_params);
 #ifdef DEBUG
-    printf("Sun found at %f (ra), %f (dec)\n", sunPos.RightAscension, 
-          sunPos.Declination);
+    fgPrintf( FG_ASTRO, FG_INFO, 
+             "Sun found at %f (ra), %f (dec)\n", 
+             sunPos.RightAscension, sunPos.Declination);
 #endif
 
     xSun = 60000.0 * cos(sunPos.RightAscension) * cos(sunPos.Declination);
@@ -155,9 +157,10 @@ void fgSunRender( void ) {
     amb[2] = 0.00 + ((ambient * 6.66) - 1.6);
     amb[3] = 0.00;
 #ifdef DEBUG
-    printf("Color of the sun: %f, %f, %f\n"
-          "Ambient value   : %f\n"
-          "Sun Angle       : %f\n" , amb[0], amb[1], amb[2], ambient, t->sun_angle);
+    fgPrintf( FG_ASTRO, FG_INFO, 
+             "Color of the sun: %f, %f, %f\n"
+             "Ambient value   : %f\n"
+             "Sun Angle       : %f\n" , amb[0], amb[1], amb[2], ambient, t->sun_angle);
 #endif
     diff[0] = 0.0;
     diff[1] = 0.0;
@@ -190,10 +193,14 @@ void fgSunRender( void ) {
 
 
 /* $Log$
-/* Revision 1.3  1998/01/19 19:27:00  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.4  1998/01/27 00:47:50  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.3  1998/01/19 19:27:00  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
  * Revision 1.2  1998/01/19 18:40:18  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index 5b0eaf54757ba20b7a1acade76a4b3debcbaa286..164c33f995171ff3dc6f5619e7ec251f89e72397 100644 (file)
@@ -29,7 +29,7 @@
 #include <stdlib.h>
 #include <Cockpit/cockpit.h>
 
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 
 #include <Aircraft/aircraft.h>
 #include <Scenery/mesh.h>
@@ -40,6 +40,8 @@
 #include <Math/fg_random.h>
 #include <Weather/weather.h>
 
+#include <Main/fg_debug.h>
+
 // #define DEBUG
 
 /* This is a structure that contains all data related to cockpit/panel/hud system */
@@ -50,7 +52,7 @@ struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft )
        struct fgCOCKPIT *cockpit;
        Hptr hud;
        
-       printf("Initializing cockpit subsystem\n");
+       fgPrintf( FG_COCKPIT, FG_INFO, "Initializing cockpit subsystem\n");
 
        cockpit = (struct fgCOCKPIT *)calloc(sizeof(struct fgCOCKPIT),1);
        if( cockpit == NULL )
@@ -68,8 +70,8 @@ struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft )
        
        aircraft_cockpit = cockpit;
        
-       printf("  Code %d  Status %d\n", cockpit->hud->code, 
-              cockpit->hud->status );
+       fgPrintf( FG_COCKPIT, FG_INFO,
+                 "  Code %d  Status %d\n", cockpit->hud->code, cockpit->hud->status );
                
        return( cockpit );
 }
@@ -77,12 +79,15 @@ struct fgCOCKPIT *fgCockpitInit( struct fgAIRCRAFT cur_aircraft )
 struct fgCOCKPIT *fgCockpitAddHUD( struct fgCOCKPIT *cockpit, struct HUD *hud )
 {
        cockpit->hud = hud;
+       return(cockpit);
 }
 
 void fgCockpitUpdate( void )
 {
 
-       printf( "Cockpit: code %d   status %d\n", aircraft_cockpit->code, aircraft_cockpit->status );
+       fgPrintf( FG_COCKPIT, FG_INFO,
+                 "Cockpit: code %d   status %d\n", 
+                 aircraft_cockpit->code, aircraft_cockpit->status );
        if( aircraft_cockpit->hud != NULL )                     // That is, if the aircraft has a HUD,
                fgUpdateHUD( aircraft_cockpit->hud );   // then draw it.
                 
@@ -90,10 +95,14 @@ void fgCockpitUpdate( void )
 
 
 /* $Log$
-/* Revision 1.6  1998/01/19 19:27:01  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* 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.
 /*
+ * Revision 1.6  1998/01/19 19:27:01  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:19  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index 0733aed6c27408111bc8dcdfcf2ece39c4c71fcd..c602600f27e9366850a36ee9a90db81b7bbaddde 100644 (file)
 #endif /* not WIN32 */
 #include "hud.h"
 
-#include "../Include/constants.h"
+#include <Include/fg_constants.h>
 
-#include "../Aircraft/aircraft.h"
-#include "../Scenery/mesh.h"
-#include "../Scenery/scenery.h"
-#include "../Math/mat3.h"
-#include "../Math/polar.h"
-#include "../Time/fg_timer.h"
-#include "../Math/fg_random.h"
-#include "../Weather/weather.h"
+#include <Aircraft/aircraft.h>
+#include <Scenery/mesh.h>
+#include <Scenery/scenery.h>
+#include <Math/mat3.h>
+#include <Math/polar.h>
+#include <Time/fg_timer.h>
+#include <Math/fg_random.h>
+#include <Weather/weather.h>
 
 // #define DEBUG
 
@@ -441,10 +441,10 @@ static void drawlabel( struct HUD_label label )
        sprintf( string, buffer, (*label.load_value)() );
 
 #ifdef DEBUG   
-       printf( buffer );
-       printf( "\n" );
-       printf( string );
-       printf( "\n" );
+       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 );
@@ -505,13 +505,13 @@ double get_heading( void )
 double get_altitude( void )
 {
        struct fgFLIGHT *f;
-       double rough_elev;
+       /* double rough_elev; */
               
        f = &current_aircraft.flight;
-       rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
-                                          FG_Latitude  * RAD_TO_ARCSEC);
+       /* 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 )
@@ -749,14 +749,17 @@ void fgUpdateHUD( Hptr hud )
        glColor3f (0.1, 0.9, 0.1);
                       
 #ifdef DEBUG    
-    printf( "HUD Code %d  Status %d\n", hud->code, hud->status ); 
+    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
-               printf("Instr Type %d   SubType %d  Orient %d\n", hud_instr->type, hud_instr->sub_type, hud_instr->orientation );
+               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 )
                {
@@ -799,10 +802,14 @@ void fgUpdateHUD( Hptr hud )
 
 
 /* $Log$
-/* Revision 1.7  1998/01/19 18:40:20  curt
-/* Tons of little changes to clean up the code and to remove fatal errors
-/* when building with the c++ compiler.
+/* 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.
 /*
+ * Revision 1.7  1998/01/19 18:40:20  curt
+ * Tons of little changes to clean up the code and to remove fatal errors
+ * when building with the c++ compiler.
+ *
  * Revision 1.6  1997/12/15 23:54:34  curt
  * Add xgl wrappers for debugging.
  * Generate terrain normals on the fly.
index 333c59913559d96a20a4160780c86b519f2a1518..d5045815aecd7ee4b0a847e0637fb3339e24cab0 100644 (file)
@@ -28,7 +28,7 @@
 #define _CONTROLS_H
 
 
-#include "../Include/limits.h"
+#include "../Include/fg_limits.h"
 
 
 /* Define a structure containing the control parameters */
@@ -80,9 +80,13 @@ void fgThrottleSet(int engine, double pos);
 
 
 /* $Log$
-/* Revision 1.9  1998/01/22 02:59:31  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* 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
+ *
  * Revision 1.8  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 71eb5caefe0c875fd323a2e8db6b3304a9be349c..c2100063699ca592cc991599b6289cac597c038d 100644 (file)
 #include <stdio.h>
 #include <Flight/flight.h>
 #include <Flight/LaRCsim/ls_interface.h>
-
+#include <Main/fg_debug.h>
 
 /* Initialize the flight model parameters */
 int fgFlightModelInit(int model, struct fgFLIGHT *f, double dt) {
     int result;
 
-    printf("Initializing flight model\n");
+    fgPrintf(FG_FLIGHT,FG_INFO,"Initializing flight model\n");
 
     if ( model == FG_LARCSIM ) {
        fgFlight_2_LaRCsim(f);  /* translate FG to LaRCsim structure */
        fgLaRCsimInit(dt);
-       printf("FG pos = %.2f\n", FG_Latitude);
+       fgPrintf(FG_FLIGHT,FG_INFO,"FG pos = %.2f\n", FG_Latitude);
        fgLaRCsim_2_Flight(f);  /* translate LaRCsim back to FG structure */
     } else {
-       printf("Unimplemented flight model == %d\n", model);
+       fgPrintf(FG_FLIGHT,FG_WARN,"Unimplemented flight model == %d\n", model);
     }
 
     result = 1;
@@ -58,7 +58,7 @@ int fgFlightModelUpdate(int model, struct fgFLIGHT *f, int multiloop) {
        fgLaRCsimUpdate(multiloop);
        fgLaRCsim_2_Flight(f);  /* translate LaRCsim back to FG structure */
     } else {
-       printf("Unimplemented flight model == %d\n", model);
+       fgPrintf(FG_FLIGHT,FG_WARN,"Unimplemented flight model == %d\n", model);
     }
 
     result = 1;
@@ -68,10 +68,14 @@ int fgFlightModelUpdate(int model, struct fgFLIGHT *f, int multiloop) {
 
 
 /* $Log$
-/* 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.
+/* 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.
+ *
  * Revision 1.7  1998/01/19 18:40:23  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index fa63bbef863abeaff781a329ae299af968cc20d9..caf08337c405dfc52d37f280ee40931535b3b695 100644 (file)
@@ -33,6 +33,8 @@
 
 #endif
 
+#include <Main/fg_debug.h>
+
 static joy_x_min=0, joy_x_ctr=0, joy_x_max=0;
 static joy_y_min=0, joy_y_ctr=0, joy_y_max=0;
 static joy_x_dead_min=1000, joy_x_dead_max=-1000;
@@ -42,7 +44,8 @@ static joy_y_dead_min=1000, joy_y_dead_max=-1000;
 static int joystick_fd;
 
 int fgJoystickInit( int joy_num ) {
-    printf("Initializing joystick\n");
+
+    fgPrintf( FG_INPUT, FG_INFO, "Initializing joystick\n");
 
 #ifdef HAVE_JOYSTICK
        int status;
@@ -69,7 +72,8 @@ int fgJoystickInit( int joy_num ) {
                return( 1 );
        }
        
-       printf( "\nMove joystick around dead spot and press any joystick button.\n" );
+       fgPrintf( FG_INPUT,FG_ALERT,
+                 "\nMove joystick around dead spot and press any joystick button.\n" );
        status = read(joystick_fd, &js, JS_RETURN);
        if (status != JS_RETURN) {
                perror("js");
@@ -101,12 +105,17 @@ int fgJoystickInit( int joy_num ) {
                return( 1 );
        }
        
-       printf("\nJoystick calibration: X_dead_min = %d, X_dead_max = %d\n", joy_x_dead_min, joy_x_dead_max );
-       printf("                      Y_dead_min = %d, Y_dead_max = %d\n", joy_y_dead_min, joy_y_dead_max );
+       fgPrintf( FG_INPUT, FG_DEBUG, 
+                 "\nJoystick calibration: X_dead_min = %d, X_dead_max = %d\n", 
+                 joy_x_dead_min, joy_x_dead_max );
+       fgPrintf( FG_INPUT, FG_DEBUG,
+                 "                      Y_dead_min = %d, Y_dead_max = %d\n", 
+                 joy_y_dead_min, joy_y_dead_max );
        
        sleep( 1 );
        
-       printf( "\nCenter joystick and press any joystick button.\n" );
+       fgPrintf( FG_INPUT, FG_DEBUG,
+                 "\nCenter joystick and press any joystick button.\n" );
        status = read(joystick_fd, &js, JS_RETURN);
        if (status != JS_RETURN) {
                perror("js");
@@ -129,11 +138,14 @@ int fgJoystickInit( int joy_num ) {
        joy_x_ctr = js.x;
        joy_y_ctr = js.y;
        
-       printf("Joystick calibration: X_ctr = %d, Y_ctr = %d\n", joy_x_ctr, joy_y_ctr );
+       fgPrintf( FG_INPUT, FG_DEBUG,
+                 "Joystick calibration: X_ctr = %d, Y_ctr = %d\n", 
+                 joy_x_ctr, joy_y_ctr );
        
        sleep( 1 );
        
-       printf( "\nMove joystick to upper left and press any joystick button.\n" );
+       fgPrintf( FG_INPUT, FG_DEBUG,
+                 "\nMove joystick to upper left and press any joystick button.\n" );
        status = read(joystick_fd, &js, JS_RETURN);
        if (status != JS_RETURN) {
                perror("js");
@@ -155,11 +167,14 @@ int fgJoystickInit( int joy_num ) {
        }
        joy_x_min = js.x;
        joy_y_min = js.y;
-       printf("Joystick calibration: X_min = %d, Y_min = %d\n", joy_x_min, joy_y_min );
+               fgPrintf( FG_INPUT, FG_DEBUG,
+                 "Joystick calibration: X_min = %d, Y_min = %d\n", 
+                 joy_x_min, joy_y_min );
        
        sleep( 1 );
        
-       printf( "\nMove joystick to lower right and press any joystick button.\n" );
+       fgPrintf( FG_INPUT, FG_DEBUG,
+                 "\nMove joystick to lower right and press any joystick button.\n" );
        status = read(joystick_fd, &js, JS_RETURN);
        if (status != JS_RETURN) {
                perror("js");
@@ -182,7 +197,9 @@ int fgJoystickInit( int joy_num ) {
        joy_x_max = js.x;
        joy_y_max = js.y;
        
-       printf("Joystick calibration: X_max = %d, Y_max = %d\n", joy_x_max, joy_y_max );
+       fgPrintf( FG_INPUT, FG_DEBUG,
+                 "Joystick calibration: X_max = %d, Y_max = %d\n", 
+                 joy_x_max, joy_y_max );
        
        // joy_x_ctr = (joy_x_max-joy_x_min)/2;
        // joy_y_ctr = (joy_y_max-joy_y_min)/2;
@@ -236,9 +253,13 @@ int fgJoystickRead( double *joy_x, double *joy_y, int *joy_b1, int *joy_b2 )
 
 
 /* $Log$
-/* Revision 1.2  1997/12/30 20:47:40  curt
-/* Integrated new event manager with subsystem initializations.
+/* 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.
+ *
  * Revision 1.1  1997/08/29 18:06:54  curt
  * Initial revision.
  *
index 568e5b4f660c6167a7975e3fcac59838446fabee..0a3a5a700b6440db8b4f804c1620d0b2900ce082 100644 (file)
 #include <stdio.h>
 
 #include <Main/GLUTkey.h>
+#include <Main/fg_debug.h>
 #include <Main/views.h>
 
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 
 #include <Aircraft/aircraft.h>
 #include <Weather/weather.h>
@@ -57,10 +58,10 @@ void GLUTkey(unsigned char k, int x, int y) {
     v = &current_view;
     w = &current_weather;
 
-    printf("Key hit = %d", k);
+    fgPrintf( FG_INPUT, FG_DEBUG, "Key hit = %d", k);
 
     if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) {
-       printf(" SHIFTED\n");
+       fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
        switch (k) {
        case 49: /* numeric keypad 1 */
            v->goal_view_offset = FG_PI * 0.75;
@@ -101,11 +102,11 @@ void GLUTkey(unsigned char k, int x, int y) {
        case 90: /* Z key */
            w->visibility /= 1.10;
            xglFogf(GL_FOG_END, w->visibility);
-           printf("Fog density = %.4f\n", w->visibility);
+           fgPrintf( FG_INPUT, FG_DEBUG, "Fog density = %.4f\n", w->visibility);
            return;
        }
     } else {
-       printf("\n");
+       fgPrintf( FG_INPUT, FG_DEBUG, "\n");
        switch (k) {
        case 50: /* numeric keypad 2 */
            fgElevMove(-0.05);
@@ -151,7 +152,7 @@ void GLUTkey(unsigned char k, int x, int y) {
        case 122: /* z key */
            w->visibility *= 1.10;
            xglFogf(GL_FOG_END, w->visibility);
-           printf("Fog density = %.4f\n", w->visibility);
+           fgPrintf( FG_INPUT, FG_DEBUG, "Fog density = %.4f\n", w->visibility);
            return;
        case 27: /* ESC */
            exit(0);
@@ -169,10 +170,10 @@ void GLUTspecialkey(int k, int x, int y) {
     c = &current_aircraft.controls;
     v = &current_view;
 
-    printf("Special key hit = %d", k);
+    fgPrintf( FG_INPUT, FG_DEBUG, "Special key hit = %d", k);
 
     if ( GLUT_ACTIVE_SHIFT && glutGetModifiers() ) {
-       printf(" SHIFTED\n");
+       fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
        switch (k) {
        case GLUT_KEY_END: /* numeric keypad 1 */
            v->goal_view_offset = FG_PI * 0.75;
@@ -200,7 +201,7 @@ void GLUTspecialkey(int k, int x, int y) {
            return;
        }
     } else {
-       printf("\n");
+        fgPrintf( FG_INPUT, FG_DEBUG, "\n");
        switch (k) {
        case GLUT_KEY_UP:
            fgElevMove(0.05);
@@ -243,10 +244,14 @@ void GLUTspecialkey(int k, int x, int y) {
 
 
 /* $Log$
-/* 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.
+/* 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.
+ *
  * Revision 1.25  1998/01/05 18:44:34  curt
  * Add an option to advance/decrease time from keyboard.
  *
index ade24b84367ae6bcfb67c26beb98748f06b53a32..d2a5b33cd798e0c82ca862bc64c8de01c3c7620d 100644 (file)
 
 #include <Main/GLUTkey.h>
 #include <Main/fg_init.h>
+#include <Main/fg_debug.h>
 #include <Main/views.h>
 
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 #include <Include/general.h>
 
 #include <Aircraft/aircraft.h>
@@ -464,8 +465,8 @@ static void fgMainLoop( void ) {
     struct fgFLIGHT *f;
     struct fgTIME *t;
 
-    printf("Running Main Loop\n");
-    printf("======= ==== ====\n");
+    fgPrintf( FG_ALL, FG_DEBUG, "Running Main Loop\n");
+    fgPrintf( FG_ALL, FG_DEBUG, "======= ==== ====\n");
 
     a = &current_aircraft;
     f = &a->flight;
@@ -483,15 +484,15 @@ static void fgMainLoop( void ) {
 
     /* Calculate model iterations needed */
     elapsed = fgGetTimeInterval();
-    printf("Time interval is = %d, previous remainder is = %d\n", elapsed
-          remainder);
-    printf("--> Frame rate is = %.2f\n", 1000.0 / (float)elapsed);
+    fgPrintf( FG_ALL, FG_BULK, "Time interval is = %d, previous remainder is = %d\n"
+             elapsed, remainder);
+    fgPrintf( FG_ALL, FG_BULK, "--> Frame rate is = %.2f\n", 1000.0 / (float)elapsed);
     elapsed += remainder;
 
     multi_loop = ((float)elapsed * 0.001) * DEFAULT_MODEL_HZ;
     remainder = elapsed - ((multi_loop*1000) / DEFAULT_MODEL_HZ);
-    printf("Model iterations needed = %d, new remainder = %d\n", multi_loop
-          remainder);
+    fgPrintf( FG_ALL, FG_BULK, "Model iterations needed = %d, new remainder = %d\n"
+             multi_loop, remainder);
 
     /* Run flight model */
     if ( ! use_signals ) {
@@ -513,7 +514,7 @@ static void fgMainLoop( void ) {
 
        /* now set aircraft altitude above ground */
        FG_Altitude = cur_elev * METER_TO_FEET + 3.758099;
-       printf("<*> resetting altitude to %.0f meters\n", 
+       fgPrintf( FG_ALL, FG_BULK, "<*> resetting altitude to %.0f meters\n", 
               FG_Altitude * FEET_TO_METER);
     }
 
@@ -528,7 +529,7 @@ static void fgMainLoop( void ) {
     /* redraw display */
     fgRenderFrame();
 
-    printf("\n");
+    fgPrintf( FG_ALL, FG_DEBUG, "\n");
 }
 
 
@@ -635,9 +636,13 @@ int main( int argc, char *argv[] ) {
 
 
 /* $Log$
-/* Revision 1.51  1998/01/26 15:57:05  curt
-/* Tweaks for dynamic scenery development.
+/* Revision 1.52  1998/01/27 00:47:56  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.51  1998/01/26 15:57:05  curt
+ * Tweaks for dynamic scenery development.
+ *
  * Revision 1.50  1998/01/19 19:27:07  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index eac454f7f3fbf53ea5a590c0702d1502ea3de681..798053af8f933d42811e7ec8f5adcab549e8db4f 100644 (file)
@@ -25,7 +25,7 @@
 
 TARGET = fg-$(FG_VERSION)
 
-CFILES = fg_init.c views.c $(INTERFACE_FILES)
+CFILES = fg_init.c fg_debug.c views.c $(INTERFACE_FILES)
 
 FGLIBS = -lAircraft -lAstro -lCockpit -lControls -lFlight \
        -lJoystick -lLaRCsim -lSlew -lScenery -lTime -lWeather -lMath \
@@ -51,6 +51,10 @@ include $(COMMONRULES)
 
 #---------------------------------------------------------------------------
 # $Log$
+# 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.
+#
 # Revision 1.44  1998/01/22 22:04:00  curt
 # Tweaked extention stuff.
 #
index 9b95510bb4e3f2ed9cccd97eb4e3ca02cdaf9e77..d89e25ad4823794fe0db74e982a091f5e93b48e4 100644 (file)
@@ -30,7 +30,7 @@
 #include <Main/fg_init.h>
 #include <Main/views.h>
 
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 #include <Include/general.h>
 
 #include <Aircraft/aircraft.h>
@@ -48,7 +48,7 @@
 #include <Time/fg_time.h>
 #include <Time/sunpos.h>
 #include <Weather/weather.h>
-
+#include <Main/fg_debug.h>
 
 extern int show_hud;             /* HUD state */
 extern int displayInstruments;
@@ -61,8 +61,10 @@ void fgInitGeneral( void ) {
 
     g = &general;
 
-    printf("General Initialization\n");
-    printf("======= ==============\n");
+    fgInitDebug();
+
+    fgPrintf( FG_GENERAL, FG_INFO, "General Initialization\n" );
+    fgPrintf( FG_GENERAL, FG_INFO, "======= ==============\n" );
 
     /* seed the random number generater */
     fg_srandom();
@@ -70,12 +72,10 @@ void fgInitGeneral( void ) {
     /* determine the fg root path */
     if ( (g->root_dir = getenv("FG_ROOT")) == NULL ) {
        /* environment variable not defined */
-       printf("FG_ROOT needs to be defined!  See the documentation.\n");
-       exit(0);
+       fgPrintf(FG_GENERAL, FG_EXIT, "FG_ROOT needs to be defined!  "
+                                 "See the documentation.\n");
     } 
-    printf("FG_ROOT = %s\n", g->root_dir);
-
-    printf("\n");
+    fgPrintf( FG_GENERAL, FG_INFO, "FG_ROOT = %s\n\n", g->root_dir);
 }
 
 
@@ -96,8 +96,8 @@ void fgInitSubsystems( void ) {
     t = &cur_time_params;
     v = &current_view;
 
-    printf("Initialize Subsystems\n");
-    printf("========== ==========\n");
+    fgPrintf( FG_GENERAL, FG_INFO, "Initialize Subsystems\n");
+    fgPrintf( FG_GENERAL, FG_INFO, "========== ==========\n");
 
     /****************************************************************
      * The following section sets up the flight model EOM parameters and 
@@ -115,7 +115,7 @@ void fgInitSubsystems( void ) {
     FG_Latitude  = (  120070.41 / 3600.0 ) * DEG_TO_RAD;
     FG_Runway_altitude = (3234.5 + 300);
     FG_Altitude = FG_Runway_altitude + 3.758099;
-    
+
     /* Initial Position at (SEZ) SEDONA airport */
     /* FG_Longitude = (-111.7884614 + 0.02) * DEG_TO_RAD; */
     /* FG_Latitude  = (  34.8486289 - 0.04) * DEG_TO_RAD; */
@@ -143,7 +143,7 @@ void fgInitSubsystems( void ) {
 
     /* Initial Posisition near where I used to live in Globe, AZ */
     /* FG_Longitude = ( -398757.6 / 3600.0 ) * DEG_TO_RAD; */
-    /* FG_Latitude  = (  120160.0 / 3600.0 ) * DEG_TO_RAD; */
+    /* FG_Latitude  = (  120160.0 / 3600.0 ) * DEG_TO_RAD;  */
     /* FG_Runway_altitude = 5000.0; */
     /* FG_Altitude = FG_Runway_altitude + 3.758099; */
 
@@ -156,11 +156,12 @@ void fgInitSubsystems( void ) {
     /* FG_Longitude = ( 88128.00 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Latitude  = ( 93312.00 / 3600.0 ) * DEG_TO_RAD; */
 
-     printf("Initial position is: (%.4f, %.4f, %.2f)\n", 
-          FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, 
-          FG_Altitude * FEET_TO_METER);
+    fgPrintf( FG_GENERAL, FG_INFO, 
+             "Initial position is: (%.4f, %.4f, %.2f)\n", 
+             FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, 
+             FG_Altitude * FEET_TO_METER);
 
-      /* Initial Velocity */
+    /* Initial Velocity */
     FG_V_north = 0.0 /*  7.287719E+00 */;
     FG_V_east  = 0.0 /*  1.521770E+03 */;
     FG_V_down  = 0.0 /* -1.265722E-05 */;
@@ -227,8 +228,7 @@ void fgInitSubsystems( void ) {
 
     /* Initialize the Cockpit subsystem */
     if( fgCockpitInit( current_aircraft ) == NULL ) {
-       printf( "Error in Cockpit initialization!\n" );
-       exit( 1 );
+       fgPrintf( FG_GENERAL, FG_EXIT, "Error in Cockpit initialization!\n" );
     }
 
     /* Initialize the orbital elements of sun, moon and mayor planets */
@@ -259,7 +259,8 @@ void fgInitSubsystems( void ) {
      * eventually */
     cur_elev = mesh_altitude(FG_Longitude * RAD_TO_DEG * 3600.0, 
                             FG_Latitude  * RAD_TO_DEG * 3600.0);
-    printf("True ground elevation is %.2f meters here.\n", cur_elev);
+    fgPrintf( FG_GENERAL, FG_INFO, "True ground elevation is %.2f meters here.\n",
+             cur_elev);
     if ( cur_elev > -9990.0 ) {
        FG_Runway_altitude = cur_elev * METER_TO_FEET;
     }
@@ -267,7 +268,8 @@ void fgInitSubsystems( void ) {
     if ( FG_Altitude < FG_Runway_altitude ) {
        FG_Altitude = FG_Runway_altitude + 3.758099;
     }
-    printf("Updated position (after elevation adj): (%.4f, %.4f, %.2f)\n", 
+    fgPrintf(FG_GENERAL, FG_INFO,
+          "Updated position (after elevation adj): (%.4f, %.4f, %.2f)\n", 
           FG_Latitude * RAD_TO_DEG, FG_Longitude * RAD_TO_DEG, 
           FG_Altitude * FEET_TO_METER);
     /* end of thing that I just stuck in that I should probably move */
@@ -288,14 +290,18 @@ void fgInitSubsystems( void ) {
     /* One more try here to get the sky synced up */
     fgSkyColorsInit();
 
-    printf("\n");
+    fgPrintf(FG_GENERAL, FG_INFO,"\n");
 }
 
 
 /* $Log$
-/* Revision 1.34  1998/01/22 02:59:37  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.35  1998/01/27 00:47:57  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.34  1998/01/22 02:59:37  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
  * Revision 1.33  1998/01/21 21:11:34  curt
  * Misc. tweaks.
  *
index 4f6470a2f6f362cbc763e1381b96106ac9fd6d4e..1d8fd35199d936e65cd76fd8bf66c2c32e7b4596 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <Main/views.h>
 
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 
 #include <Flight/flight.h>
 #include <Math/mat3.h>
@@ -34,7 +34,7 @@
 #include <Math/vector.h>
 #include <Scenery/scenery.h>
 #include <Time/fg_time.h>
-
+#include <Main/fg_debug.h>
 
 /* This is a record containing current view parameters */
 struct fgVIEW current_view;
@@ -42,7 +42,7 @@ struct fgVIEW current_view;
 
 /* Initialize a view structure */
 void fgViewInit(struct fgVIEW *v) {
-    printf("Initializing View parameters\n");
+    fgPrintf( FG_VIEW, FG_INFO, "Initializing View parameters\n");
 
     v->view_offset = 0.0;
     v->goal_view_offset = 0.0;
@@ -69,7 +69,7 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
     v->view_pos.y -= scenery.center.y;
     v->view_pos.z -= scenery.center.z;
 
-    printf("View pos = %.4f, %.4f, %.4f\n", 
+    fgPrintf( FG_VIEW, FG_DEBUG, "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 */
@@ -182,10 +182,14 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
 
 
 /* $Log$
-/* Revision 1.10  1998/01/19 19:27:09  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* 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.
 /*
+ * Revision 1.10  1998/01/19 19:27:09  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
  * Revision 1.9  1998/01/13 00:23:09  curt
  * Initial changes to support loading and management of scenery tiles.  Note,
  * there's still a fair amount of work left to be done.
index 04dde790196dcd06e1ff75a332558dfa10cba061..a7b4bdfb9b9078e032d76d0c70ecc771ee8d17cc 100644 (file)
@@ -28,7 +28,7 @@
 #define _VIEWS_H
 
 
-#include <Include/types.h>
+#include <Include/fg_types.h>
 #include <Flight/flight.h>
 #include <Math/mat3.h>
 #include <Time/fg_time.h>
@@ -89,9 +89,13 @@ void fgViewUpdate(struct fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l);
 
 
 /* $Log$
-/* Revision 1.7  1998/01/22 02:59:38  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* 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.
 /*
+ * Revision 1.7  1998/01/22 02:59:38  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
  * Revision 1.6  1998/01/19 19:27:10  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index 219318b35acaebe6184deefe7850f28ac070bc29..af03c934829a7f9294b4a1f02fd62d29df55ae62 100644 (file)
@@ -28,7 +28,7 @@
 #include <stdio.h>
 
 #include <Scenery/bucketutils.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 
 
 /* Generate the unique scenery tile index containing the specified
@@ -266,9 +266,13 @@ int main() {
 
 
 /* $Log$
-/* Revision 1.2  1998/01/24 00:03:28  curt
-/* Initial revision.
+/* Revision 1.3  1998/01/27 00:48:01  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.2  1998/01/24 00:03:28  curt
+ * Initial revision.
+ *
  * Revision 1.1  1998/01/23 20:06:51  curt
  * tileutils.* renamed to bucketutils.*
  *
index 77cae1e24b36374f134f8a2c8b0e6f4c2234e272..7fb3198539d556cfe50cf170fc024681b1110515 100644 (file)
@@ -38,8 +38,8 @@
 
 #include <GL/glut.h>
 
-#include <Include/constants.h>
-#include <Include/types.h>
+#include <Include/fg_constants.h>
+#include <Include/fg_types.h>
 #include <Math/fg_geodesy.h>
 #include <Math/fg_random.h>
 #include <Math/mat3.h>
@@ -396,10 +396,14 @@ GLint mesh_to_OpenGL(struct MESH *m) {
 
 
 /* $Log$
-/* Revision 1.27  1998/01/19 19:27:15  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.28  1998/01/27 00:48:02  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.27  1998/01/19 19:27:15  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
  * Revision 1.26  1998/01/19 18:40:36  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index 7c10cd749836cbe519c7f2f1784350e153eb64fa..622d46b8b26b93f0b9126565c330036de4522a2d 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <GL/glut.h>
 
-#include <Include/types.h>
+#include <Include/fg_types.h>
 
 
 /* Load a .obj file and generate the GL call list */
@@ -45,9 +45,13 @@ GLint fgObjLoad(char *file, struct fgCartesianPoint *ref);
 
 
 /* $Log$
-/* Revision 1.4  1998/01/22 02:59:41  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.5  1998/01/27 00:48:03  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.4  1998/01/22 02:59:41  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
  * Revision 1.3  1998/01/19 19:27:17  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index 3ff1ab729489ccbfce15e4c176dbaa6713cba37e..8ea40ae5d0227a9be8f872cd0d19659d7bfdeddf 100644 (file)
@@ -28,7 +28,7 @@
 #define _SCENERY_H
 
 
-#include <Include/types.h>
+#include <Include/fg_types.h>
 
 
 /* Define a structure containing global scenery parameters */
@@ -63,9 +63,13 @@ void fgSceneryRender( void );
 
 
 /* $Log$
-/* Revision 1.15  1998/01/22 02:59:41  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* Revision 1.16  1998/01/27 00:48:03  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.15  1998/01/22 02:59:41  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
  * Revision 1.14  1998/01/19 19:27:17  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index 166e564233eea99b1b347c711318291a0ca0472e..e85e71149a98468f2f25d270bf1f795c6c455bb3 100644 (file)
@@ -1,5 +1,5 @@
 /**************************************************************************
- * tilecache.c -- routines to hancle scenery tile caching
+ * tilecache.c -- routines to handle scenery tile caching
  *
  * Written by Curtis Olson, started January 1998.
  *
@@ -112,9 +112,13 @@ void fgTileCacheEntryFree( in index ) {
 
 
 /* $Log$
-/* Revision 1.2  1998/01/26 15:55:24  curt
-/* Progressing on building dynamic scenery system.
+/* Revision 1.3  1998/01/27 00:48:03  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.2  1998/01/26 15:55:24  curt
+ * Progressing on building dynamic scenery system.
+ *
  * Revision 1.1  1998/01/24 00:03:29  curt
  * Initial revision.
  *
index 47f201c656af133e94b0e491502036d83f36d177..2e46bda9c773d259a6682c1825eb990781d5dc16 100644 (file)
@@ -1,5 +1,5 @@
 /**************************************************************************
- * tilecache.h -- routines to hancle scenery tile caching
+ * tilecache.h -- routines to handle scenery tile caching
  *
  * Written by Curtis Olson, started January 1998.
  *
@@ -36,7 +36,7 @@
 #include <XGL/xgl.h>
 
 #include <Scenery/bucketutils.h>
-#include <Include/types.h>
+#include <Include/fg_types.h>
 
 
 #define FG_TILE_CACHE_SIZE 100   /* Must be > FG_LOCAL_X_Y */
@@ -48,6 +48,7 @@ struct fgTILE {
     GLint display_list;
     struct fgCartesianPoint local_ref;
     int used;
+    int priority;
 };
 
 /* tile cache */
@@ -72,9 +73,13 @@ void fgTileCacheEntryInfo( int index, GLint *display_list,
 
 
 /* $Log$
-/* Revision 1.1  1998/01/24 00:03:29  curt
-/* Initial revision.
+/* Revision 1.2  1998/01/27 00:48:04  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.1  1998/01/24 00:03:29  curt
+ * Initial revision.
+ *
  */
 
 
index cc26d66ee7207fc0986069094a0cc490ba93f37d..6cef1bbb8d727df67964ff496774a038ed16d13c 100644 (file)
@@ -37,8 +37,8 @@
 #include <Scenery/tilecache.h>
 
 #include <Aircraft/aircraft.h>
-#include <Include/constants.h>
-#include <Include/types.h>
+#include <Include/fg_constants.h>
+#include <Include/fg_types.h>
 
 
 #define FG_LOCAL_X           3   /* should be odd */
@@ -120,7 +120,8 @@ void fgTileMgrUpdate( void ) {
            AT ULTRA HIGH SPEEDS THIS ASSUMPTION MAY NOT BE VALID IF
            THE AIRCRAFT CAN SKIP A TILE IN A SINGLE ITERATION. */
 
-       if ( (p1.lon > p_last.lon) || (p1.x > p_last.x) ) {
+       if ( (p1.lon > p_last.lon) || 
+            ( (p1.lon == p_last.lon) && (p1.x > p_last.x) ) ) {
            for ( j = 0; j < FG_LOCAL_Y; j++ ) {
                /* scrolling East */
                for ( i = 0; i < FG_LOCAL_X - 1; i++ ) {
@@ -130,7 +131,8 @@ void fgTileMgrUpdate( void ) {
                fgBucketOffset(&p_last, &p2, dw + 1, j - dh);
                fgTileMgrLoadTile(&p2, &tiles[(j*FG_LOCAL_Y) + FG_LOCAL_X - 1]);
            }
-       } else if ( (p1.lon < p_last.lon) || (p1.x < p_last.x) ) {
+       } else if ( (p1.lon < p_last.lon) || 
+                   ( (p1.lon == p_last.lon) && (p1.x < p_last.x) ) ) {
            for ( j = 0; j < FG_LOCAL_Y; j++ ) {
                /* scrolling West */
                for ( i = FG_LOCAL_X - 1; i > 0; i-- ) {
@@ -142,7 +144,8 @@ void fgTileMgrUpdate( void ) {
            }
        }
 
-       if ( (p1.lat > p_last.lat) || (p1.y > p_last.y) ) {
+       if ( (p1.lat > p_last.lat) || 
+            ( (p1.lat == p_last.lat) && (p1.y > p_last.y) ) ) {
            for ( i = 0; i < FG_LOCAL_X; i++ ) {
                /* scrolling North */
                for ( j = 0; j < FG_LOCAL_Y - 1; j++ ) {
@@ -154,7 +157,8 @@ void fgTileMgrUpdate( void ) {
                fgTileMgrLoadTile(&p2, 
                    &tiles[((FG_LOCAL_Y-1)*FG_LOCAL_Y) + i]);
            }
-       } else if ( (p1.lat < p_last.lat) || (p1.y < p_last.y) ) {
+       } else if ( (p1.lat < p_last.lat) || 
+                   ( (p1.lat == p_last.lat) && (p1.y < p_last.y) ) ) {
            for ( i = 0; i < FG_LOCAL_X; i++ ) {
                /* scrolling South */
                for ( j = FG_LOCAL_Y - 1; j > 0; j-- ) {
@@ -208,9 +212,13 @@ void fgTileMgrRender( void ) {
 
 
 /* $Log$
-/* Revision 1.7  1998/01/26 15:55:25  curt
-/* Progressing on building dynamic scenery system.
+/* Revision 1.8  1998/01/27 00:48:04  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.7  1998/01/26 15:55:25  curt
+ * Progressing on building dynamic scenery system.
+ *
  * Revision 1.6  1998/01/24 00:03:30  curt
  * Initial revision.
  *
index 0a67706f69ff4000e51249fc43729bc7b33e0614..0067d2ea98338718e2503c3b02f90eddb952371f 100644 (file)
@@ -23,6 +23,7 @@
 # (Log is kept at end of this file)
 #---------------------------------------------------------------------------
 
+
 include $(FG_ROOT_SRC)/commondefs
 
 SUBSUBDIRS = Flight/LaRCsim Flight/Slew
@@ -101,6 +102,10 @@ bin-zip:
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.39  1998/01/27 00:47:41  curt
+# Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+# system and commandline/config file processing code.
+#
 # Revision 1.38  1998/01/22 22:03:22  curt
 # Tweaks.
 #
index 44c7aef131b11f07aa5cff2d49a5294e4151644f..27d10536843329366b7165a2b34c5517501e860b 100644 (file)
@@ -14,6 +14,16 @@ Steve Baker <sbaker@link.com>
   of the more sophisticated features of Flight Gear.
 
 
+Paul Bleisch <bleisch@chromatic.com>
+  Paul redid the "debug" system so that it would be much more
+  flexible, so it could be easily disabled for production system, and
+  so that messages for certain subsystems could be selectively
+  enabled.
+
+  Also contributed a first stab at a config file/command line parsing
+  system.
+
+
 Gene Buckle <geneb@nwlink.com>
   Gene has done a lot of work getting FG to compile with the MSVC++
   compiler.  Also, he has pushed, proded, and bugged me endlessly to
index 4c12b72ed385f8932200c4d4c93efe619dbb3935..db8657b530703a75b6e62d55d817b769e4341967 100644 (file)
@@ -5,7 +5,7 @@
 #---------------------------------------------------------------------------
 
 FG_VERSION_MAJOR = 0
-FG_VERSION_MINOR = 26
+FG_VERSION_MINOR = 27
 FG_VERSION = $(FG_VERSION_MAJOR).$(FG_VERSION_MINOR)
 
 
index 1d42f66a8d7898133265b7caaa0ed4e9c27179f2..535824febefa382a0e1585b3de3f1911f8c597dc 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
 
 #---------------------------------------------------------------------------
 # runfg -- front end for setting up the FG_ROOT env variable and launching 
@@ -59,6 +59,10 @@ exec($path);
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.2  1998/01/27 00:47:43  curt
+# Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+# system and commandline/config file processing code.
+#
 # Revision 1.1  1997/10/28 18:47:27  curt
 # Initial revision.
 #
index 3a4e28eea79e077590a9be599c7585f1a1dd36e7..7e7c1598a5ad2b6bf39afcecc80967e0de058c51 100644 (file)
@@ -30,7 +30,7 @@
 #include <Flight/flight.h>
 #include <Aircraft/aircraft.h>
 #include <Controls/controls.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 
 
 #ifndef M_PI                                    
@@ -93,10 +93,14 @@ void fgSlewUpdate( void ) {
 
 
 /* $Log$
-/* 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.
+/* 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.
+ *
  * Revision 1.8  1998/01/19 18:40:30  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index a179f7142284d6b846e9c855b6fe5911a5e0cff1..ca362dfb3a4b39b1caf19ea2d532515c30e5bd9d 100644 (file)
@@ -124,15 +124,16 @@ void addq(int ptr) {
 int popq( void ) {
     int ptr;
 
-    if ( !emptyq() ) {
+    if ( emptyq() ) {
+       printf("PANIC:  RUN QUEUE IS EMPTY!!!\n");
+       ptr = 0;
+    } else {
        ptr = queue[queue_front];
        /* printf("Popped position %d = %d\n", queue_front, ptr); */
        queue_front = (queue_front + 1) % MAX_RUN_QUEUE;
-       return(ptr);
-    } else {
-       printf("PANIC:  RUN QUEUE IS EMPTY!!!\n");
-       exit(0);
     }
+
+    return(ptr);
 }
 
 
@@ -338,10 +339,14 @@ void fgEventProcess( void ) {
 
 
 /* $Log$
-/* Revision 1.7  1998/01/19 19:27:19  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.8  1998/01/27 00:48:05  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.7  1998/01/19 19:27:19  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
  * Revision 1.6  1998/01/19 18:40:39  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index c520a16b693c4a4fd5ee3cc5c73a9cdbbff32437..d6a8d3560a3a0c7b550865371e4ef2e6bc492e21 100644 (file)
 #endif /* USE_FTIME */
 
 #include <Time/fg_time.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 #include <Flight/flight.h>
 
 
 #define DEGHR(x)        ((x)/15.)
 #define RADHR(x)        DEGHR(x*RAD_TO_DEG)
 
+#include <Main/fg_debug.h>
 
 struct fgTIME cur_time_params;
 struct fgLIGHT cur_light_params;
@@ -52,7 +53,7 @@ struct fgLIGHT cur_light_params;
 /* Initialize the time dependent variables */
 
 void fgTimeInit(struct fgTIME *t) {
-    printf("Initializing Time\n");
+    fgPrintf( FG_EVENT, FG_INFO, "Initializing Time\n");
 
     t->gst_diff = -9999.0;
     t->warp = (0) * 3600;
@@ -123,7 +124,7 @@ double utc_gst (double mjd) {
     x /= 3600.0;
     gst = (1.0/SIDRATE)*hr + x;
 
-    printf("  gst => %.4f\n", gst);
+   fgPrintf( FG_EVENT, FG_DEBUG, "  gst => %.4f\n", gst);
 
     return(gst);
 }
@@ -189,8 +190,8 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
     start = mktime(&mt);
 
     /* printf("start1 = %ld\n", start);
-    printf("start2 = %s", ctime(&start));
-    printf("start3 = %ld\n", start); */
+   fgPrintf( FG_EVENT, FG_DEBUG, "start2 = %s", ctime(&start));
+   fgPrintf( FG_EVENT, FG_DEBUG, "start3 = %ld\n", start); */
 
     daylight = mt.tm_isdst;
 
@@ -202,7 +203,7 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
     if ( daylight > 0 ) {
        daylight = 1;
     } else if ( daylight < 0 ) {
-       printf("OOOPS, big time problem in fg_time.c, no daylight savings info.\n");
+       fgPrintf( FG_EVENT, FG_WARN, "OOOPS, big time problem in fg_time.c, no daylight savings info.\n");
     }
 
     offset = -(timezone / 3600 - daylight);
@@ -243,19 +244,21 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
 void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
     double gst_precise, gst_course;
 
-    printf("Updating time\n");
+    fgPrintf( FG_EVENT, FG_BULK, "Updating time\n");
 
     /* get current Unix calendar time (in seconds) */
     t->warp += t->warp_delta;
     t->cur_time = time(NULL) + t->warp;
-    printf("  Current Unix calendar time = %ld  warp = %ld  delta = %ld\n", 
-          t->cur_time, t->warp, t->warp_delta);
+    fgPrintf( FG_EVENT, FG_BULK, 
+             "  Current Unix calendar time = %ld  warp = %ld  delta = %ld\n", 
+             t->cur_time, t->warp, t->warp_delta);
 
     /* get GMT break down for current time */
     t->gmt = gmtime(&t->cur_time);
-    printf("  Current GMT = %d/%d/%2d %d:%02d:%02d\n", 
-           t->gmt->tm_mon+1, t->gmt->tm_mday, t->gmt->tm_year,
-           t->gmt->tm_hour, t->gmt->tm_min, t->gmt->tm_sec);
+    fgPrintf( FG_EVENT, FG_BULK, 
+             "  Current GMT = %d/%d/%2d %d:%02d:%02d\n", 
+             t->gmt->tm_mon+1, t->gmt->tm_mday, t->gmt->tm_year,
+             t->gmt->tm_hour, t->gmt->tm_min, t->gmt->tm_sec);
 
     /* calculate modified Julian date */
     t->mjd = cal_mjd ((int)(t->gmt->tm_mon+1), (double)t->gmt->tm_mday, 
@@ -267,7 +270,7 @@ void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
 
     /* convert "back" to Julian date + partial day (as a fraction of one) */
     t->jd = t->mjd + MJD0;
-    printf("  Current Julian Date = %.5f\n", t->jd);
+    fgPrintf( FG_EVENT, FG_BULK, "  Current Julian Date = %.5f\n", t->jd);
 
     /* printf("  Current Longitude = %.3f\n", FG_Longitude * RAD_TO_DEG); */
 
@@ -275,14 +278,14 @@ void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
     if ( t->gst_diff < -100.0 ) {
        /* first time through do the expensive calculation & cheap
            calculation to get the difference. */
-       printf("  First time, doing precise gst\n");
-       t->gst = gst_precise = sidereal_precise(t->mjd, 0.00);
-       gst_course = sidereal_course(t->gmt, t->cur_time, 0.00);
-       t->gst_diff = gst_precise - gst_course;
-
-       t->lst = 
-           sidereal_course(t->gmt, t->cur_time, -(FG_Longitude * RAD_TO_DEG))
-           + t->gst_diff;
+      fgPrintf( FG_EVENT, FG_INFO, "  First time, doing precise gst\n");
+      t->gst = gst_precise = sidereal_precise(t->mjd, 0.00);
+      gst_course = sidereal_course(t->gmt, t->cur_time, 0.00);
+      t->gst_diff = gst_precise - gst_course;
+
+      t->lst = 
+       sidereal_course(t->gmt, t->cur_time, -(FG_Longitude * RAD_TO_DEG))
+       + t->gst_diff;
     } else {
        /* course + difference should drift off very slowly */
        t->gst = 
@@ -299,9 +302,13 @@ void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t) {
 
 
 /* $Log$
-/* Revision 1.30  1998/01/21 21:11:35  curt
-/* Misc. tweaks.
+/* Revision 1.31  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.30  1998/01/21 21:11:35  curt
+ * Misc. tweaks.
+ *
  * Revision 1.29  1998/01/19 19:27:20  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index 6e39cdb39f467adb392cc5cbfd56038b7e3368bd..82d743b6ebebb1e14bf040769ce1b5a5bb031fc4 100644 (file)
@@ -35,7 +35,7 @@
 #include <GL/glut.h>
 #include <time.h>
 
-#include <Include/types.h>
+#include <Include/fg_types.h>
 #include <Flight/flight.h>
 
 
@@ -99,9 +99,13 @@ void fgTimeUpdate(struct fgFLIGHT *f, struct fgTIME *t);
 
 
 /* $Log$
-/* Revision 1.14  1998/01/22 02:59:43  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
+/* 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
+ *
  * Revision 1.13  1998/01/19 19:27:20  curt
  * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
  * This should simplify things tremendously.
index 00dbb21e932b488337e423816312e28f73102e86..3f4c4e5cde8325fa4cae41170073508d089e5e21 100644 (file)
@@ -45,7 +45,7 @@
 
 #include <Time/sunpos.h>
 #include <Time/fg_time.h>
-#include <Include/constants.h>
+#include <Include/fg_constants.h>
 #include <Main/views.h>
 #include <Math/fg_geodesy.h>
 #include <Math/mat3.h>
@@ -373,10 +373,14 @@ void fgUpdateSunPos( void ) {
 
 
 /* $Log$
-/* Revision 1.23  1998/01/19 19:27:21  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.24  1998/01/27 00:48:07  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.23  1998/01/19 19:27:21  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
  * Revision 1.22  1998/01/19 18:40:40  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.
index 2c16b06e8fe2af137a04f126d75bb26c0d20fa57..ff9a0bb48ea50171a12d623b07daf81509a02550 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <time.h>
 
-#include <Include/types.h>
+#include <Include/fg_types.h>
 
 /* update the cur_time_params structure with the current sun position */
 void fgUpdateSunPos( void );
index 0eed946e198947a17ee57381aabd5dc7b944daf7..da044f1e956318973400ac745d36fb99b71d4cac 100644 (file)
@@ -24,6 +24,8 @@
  **************************************************************************/
 
 
+#include <stdio.h>
+
 #include <Weather/weather.h>
 #include <Aircraft/aircraft.h>
 #include <Math/fg_random.h>
@@ -50,6 +52,10 @@ void fgWeatherInit( void ) {
 
 /* Update the weather parameters for the current position */
 void fgWeatherUpdate( void ) {
+
+    /* temporarily remove the code of this do-nothing routine */
+
+#ifdef FG_WEATHER_UPDATE
     struct fgFLIGHT *f;
     struct fgWEATHER *w;
 
@@ -60,14 +66,19 @@ void fgWeatherUpdate( void ) {
     /* FG_U_gust = fg_random() * 1.0 - 0.5;
     FG_V_gust = fg_random() * 1.0 - 0.5;
     FG_W_gust = fg_random() * 1.0 - 0.5; */
+#endif FG_WEATHER_UPDATE
 }
 
 
 /* $Log$
-/* Revision 1.12  1998/01/19 19:27:22  curt
-/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
-/* This should simplify things tremendously.
+/* Revision 1.13  1998/01/27 00:48:08  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.12  1998/01/19 19:27:22  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
  * Revision 1.11  1998/01/19 18:40:41  curt
  * Tons of little changes to clean up the code and to remove fatal errors
  * when building with the c++ compiler.