]> git.mxchange.org Git - flightgear.git/commitdiff
Minor tweaks.
authorcurt <curt>
Mon, 9 Feb 1998 15:07:47 +0000 (15:07 +0000)
committercurt <curt>
Mon, 9 Feb 1998 15:07:47 +0000 (15:07 +0000)
Astro/stars.c
Cockpit/hud.c
Main/GLUTmain.c
Main/fg_init.c
Main/views.c
Scenery/bucketutils.c
Scenery/obj.c
Simulator/commondefs
Time/fg_time.c
Time/sunpos.c
Weather/weather.c

index dcc85156f0e6c833e0d800d22f60ac27e7bbcd35..8b23ffdcc838fe3c13e55ddd239acc0903befa32 100644 (file)
@@ -215,13 +215,13 @@ void fgStarsInit( void ) {
 
 /* Draw the Stars */
 void fgStarsRender( void ) {
-    struct fgFLIGHT *f;
+    fgFLIGHT *f;
     struct fgVIEW *v;
     struct fgLIGHT *l;
     struct fgTIME *t;
     int i;
 
-    f = &current_aircraft.flight;
+    f = current_aircraft.flight;
     l = &cur_light_params;
     t = &cur_time_params;
     v = &current_view;
@@ -253,9 +253,12 @@ void fgStarsRender( void ) {
 
 
 /* $Log$
-/* Revision 1.6  1998/02/02 20:53:23  curt
-/* To version 0.29
+/* Revision 1.7  1998/02/09 15:07:48  curt
+/* Minor tweaks.
 /*
+ * Revision 1.6  1998/02/02 20:53:23  curt
+ * To version 0.29
+ *
  * Revision 1.5  1998/01/27 18:35:53  curt
  * Minor tweaks.
  *
index 590fda67ca5f25d3805034810aa89de899e41726..5c6cab76a16c94710d6d5f06b21287264654c183 100644 (file)
@@ -758,6 +758,8 @@ Hptr fgHUDInit( fgAIRCRAFT *current_aircraft )
 {
   Hptr hud;
 
+  fgPrintf( FG_COCKPIT, FG_INFO, "Initializing HUD\n" );
+
   hud = (Hptr)calloc(sizeof( HUD),1);
   if( hud == NULL )
     return( NULL );
@@ -787,20 +789,22 @@ Hptr fgHUDInit( fgAIRCRAFT *current_aircraft )
   return( hud );
 }
 
+
 // add_instrument
 //
 // This is a stand in for linked list code that will get replaced later
 // by some more elegant list handling code.
 
-void add_instrument( Hptr hud, HIptr pinstrument )
-{
-  if( !hud || !pinstrument ) {
-    return;
+void add_instrument( Hptr hud, HIptr pinstrument ) {
+    if( !hud || !pinstrument ) {
+       return;
     }
-  pinstrument->next = hud->instruments;
-  hud->instruments = pinstrument;
+
+    pinstrument->next = hud->instruments;
+    hud->instruments = pinstrument;
 }
 
+
 // fgHUDAddHorizon
 //
 // Constructs a HUD_horizon "object" and installs it into the hud instrument
@@ -813,36 +817,36 @@ Hptr fgHUDAddHorizon( Hptr hud,     \
                       int hole_len, \
                       double (*load_value)() )
 {
-  HUD_horizon *phorizon;
-  HUD_instr   *pinstrument;
+    HUD_horizon *phorizon;
+    HUD_instr   *pinstrument;
 
-  if( !hud ) {
-    return NULL;
+    if( !hud ) {
+       return NULL;
     }
                                        // construct the parent object
-       pinstrument = (HIptr)calloc(sizeof(HUD_instr),1);
-       if( pinstrument == NULL ) {
-               return( NULL );
+    pinstrument = (HIptr)calloc(sizeof(HUD_instr),1);
+    if( pinstrument == NULL ) {
+       return( NULL );
     }
-       pinstrument->type    = HUDhorizon;  //  ARTIFICIAL_HORIZON;
+    pinstrument->type    = HUDhorizon;  //  ARTIFICIAL_HORIZON;
 
                                       // Construct the horizon
-       phorizon = (HUD_horizon *) calloc( sizeof(HUD_horizon),1);
-       if( phorizon == NULL )   {
-               return( NULL );
+    phorizon = (HUD_horizon *) calloc( sizeof(HUD_horizon),1);
+    if( phorizon == NULL )   {
+       return( NULL );
     }
 
-  phorizon->x_pos      = x_pos;
-  phorizon->y_pos      = y_pos;
-  phorizon->scr_width  = length;
-  phorizon->scr_hole   = hole_len;
-  phorizon->load_value = load_value;
-                                      //  Install the horizon in the parent.
-  pinstrument->instr   = phorizon;
+    phorizon->x_pos      = x_pos;
+    phorizon->y_pos      = y_pos;
+    phorizon->scr_width  = length;
+    phorizon->scr_hole   = hole_len;
+    phorizon->load_value = load_value;
+    //  Install the horizon in the parent.
+    pinstrument->instr   = phorizon;
                                       //  Install the instrument into hud.
-  add_instrument( hud, pinstrument);
+    add_instrument( hud, pinstrument);
 
-  return( hud );
+    return( hud );
 }
 
 // fgHUDAddScale
@@ -1045,73 +1049,78 @@ Hptr fgHUDAddNumDisp( Hptr hud,           \
 // all C++.
 //
 
-void fgUpdateHUD( Hptr hud )
-{
-       HIptr phud_instr;
+void fgUpdateHUD( Hptr hud ) {
+    HIptr phud_instr;
 
-       glMatrixMode(GL_PROJECTION);
-       glPushMatrix();
+    glMatrixMode(GL_PROJECTION);
+    glPushMatrix();
 
-       glLoadIdentity();
-       gluOrtho2D(0, 640, 0, 480);
-       glMatrixMode(GL_MODELVIEW);
-       glPushMatrix();
-       glLoadIdentity();
+    glLoadIdentity();
+    gluOrtho2D(0, 640, 0, 480);
+    glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+    glLoadIdentity();
 
-       glColor3f(1.0, 1.0, 1.0);
-       glIndexi(7);
+    glColor3f(1.0, 1.0, 1.0);
+    glIndexi(7);
 
-       glDisable(GL_DEPTH_TEST);
-       glDisable(GL_LIGHTING);
+    glDisable(GL_DEPTH_TEST);
+    glDisable(GL_LIGHTING);
 
-       glLineWidth(1);
-       glColor3f (0.1, 0.9, 0.1);
+    glLineWidth(1);
+    glColor3f (0.1, 0.9, 0.1);
 
-  fgPrintf( FG_COCKPIT, FG_DEBUG,
-            "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 );
 
-  phud_instr = hud->instruments;
-  while( phud_instr )  {
-    switch (phud_instr->type){
-                 case HUDhorizon:                  // ARTIFICIAL HORIZON
-        drawhorizon( (pHUDhorizon)phud_instr );
-         break;
+    phud_instr = hud->instruments;
+    while( phud_instr ) {
+       /* printf("Drawing Instrument %d\n", phud_instr->type); */
 
-       case HUDscale:                  // Need to simplify this call.
-        drawscale (  (pHUDscale)  phud_instr  );
-        break;
+       switch (phud_instr->type){
+       case HUDhorizon:   // ARTIFICIAL HORIZON
+           drawhorizon( (pHUDhorizon)phud_instr->instr );
+           break;
+           
+       case HUDscale:     // Need to simplify this call.
+           drawscale (  (pHUDscale)  phud_instr->instr  );
+           break;
 
-      case HUDlabel:
-        drawlabel (  (pHUDlabel)  phud_instr  );
-        break;
+       case HUDlabel:
+           drawlabel (  (pHUDlabel)  phud_instr->instr  );
+           break;
 
-       case HUDladder:
-               drawladder(  (pHUDladder) phud_instr  );
-        break;
+       case HUDladder:
+           drawladder(  (pHUDladder) phud_instr->instr  );
+           break;
 
-      case HUDcontrols:
-        drawControlSurfaces( (pHUDControlSurface) phud_instr );
-      default:; // Ignore anything you don't know about.
-      }
-       phud_instr = phud_instr->next;
-    }
+       case HUDcontrols:
+           drawControlSurfaces( (pHUDControlSurface) phud_instr->instr );
+           
+       default:; // Ignore anything you don't know about.
+       }
 
-       glEnable(GL_DEPTH_TEST);
-       glEnable(GL_LIGHTING);
-       glMatrixMode(GL_PROJECTION);
-       glPopMatrix();
-       glMatrixMode(GL_MODELVIEW);
-       glPopMatrix();
+       phud_instr = phud_instr->next;
+    }
 
+    glEnable(GL_DEPTH_TEST);
+    glEnable(GL_LIGHTING);
+    glMatrixMode(GL_PROJECTION);
+    glPopMatrix();
+    glMatrixMode(GL_MODELVIEW);
+    glPopMatrix();
 }
 
 
 /* $Log$
-/* Revision 1.11  1998/02/07 15:29:34  curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.12  1998/02/09 15:07:48  curt
+/* Minor tweaks.
 /*
+ * Revision 1.11  1998/02/07 15:29:34  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
  * Revision 1.10  1998/02/03 23:20:14  curt
  * Lots of little tweaks to fix various consistency problems discovered by
  * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
index a5ac4bc61358c1337ac6f4dd1aa7372f27fddf01..772028794ff33b73d8abf9ede4944d432c4f009e 100644 (file)
@@ -286,7 +286,7 @@ static void fgRenderFrame( void ) {
     xglPopMatrix();
 
     /* draw scenery */
-    xglShadeModel( GL_SMOOTH ); 
+    xglShadeModel( GL_FLAT /* GL_SMOOTH */ ); 
     xglEnable( GL_DEPTH_TEST );
     xglEnable( GL_FOG );
     xglFogfv (GL_FOG_COLOR, l->fog_color);
@@ -647,10 +647,13 @@ int main( int argc, char *argv[] ) {
 #endif
 
 /* $Log$
-/* Revision 1.57  1998/02/07 15:29:40  curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.58  1998/02/09 15:07:49  curt
+/* Minor tweaks.
 /*
+ * Revision 1.57  1998/02/07 15:29:40  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
  * Revision 1.56  1998/02/03 23:20:23  curt
  * Lots of little tweaks to fix various consistency problems discovered by
  * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
index 40391a5fb325f8758cc382dfe5ef124169c177b3..282e7e88f9edef938eb07e7c8b6863025162a620 100644 (file)
@@ -175,10 +175,10 @@ void fgInitSubsystems( void ) {
     /* 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;
+    /* 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; */
@@ -328,10 +328,13 @@ void fgInitSubsystems( void ) {
 
 
 /* $Log$
-/* Revision 1.40  1998/02/07 15:29:44  curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.41  1998/02/09 15:07:50  curt
+/* Minor tweaks.
 /*
+ * Revision 1.40  1998/02/07 15:29:44  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
  * Revision 1.39  1998/02/03 23:20:25  curt
  * Lots of little tweaks to fix various consistency problems discovered by
  * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
index d263862d118c03e48606c9ba54c9a28e96a5cbe9..f8a8e10570b103ed2e244d049495a1a719b487e8 100644 (file)
@@ -136,7 +136,7 @@ void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
     /* printf("    Alt Up = (%.4f, %.4f, %.4f)\n", 
        alt_up.x, alt_up.y, alt_up.z); */
 
-    /* Derive the VIEW matrix */
+    /* Calculate the VIEW matrix */
     MAT3mult(VIEW, LOCAL, UP);
     /* printf("VIEW matrix\n"); */
     /* MAT3print(VIEW, stdout); */
@@ -184,10 +184,13 @@ void fgViewUpdate(fgFLIGHT *f, struct fgVIEW *v, struct fgLIGHT *l) {
 
 
 /* $Log$
-/* Revision 1.13  1998/02/07 15:29:45  curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.14  1998/02/09 15:07:50  curt
+/* Minor tweaks.
 /*
+ * Revision 1.13  1998/02/07 15:29:45  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
  * Revision 1.12  1998/01/29 00:50:28  curt
  * Added a view record field for absolute x, y, z position.
  *
index e3bb6e1f4697546cd8964305a788edd4ebee62a0..a1c96fc0339f338eec0836aa4d60e0f3d827e8e8 100644 (file)
@@ -197,8 +197,8 @@ void fgBucketFind(double lon, double lat, struct fgBUCKET *p) {
     }
     /* printf("  p->lat = %d\n", p->lat); */
 
-    p->x = (lon - p->lon) * 8;
-    p->y = (lat - p->lat) * 8;
+    p->x = (int)((lon - p->lon) * 8);
+    p->y = (int)((lat - p->lat) * 8);
     /* printf( "Bucket = lon,lat = %d,%d  x,y index = %d,%d\n", 
            p->lon, p->lat, p->x, p->y); */
 }
@@ -266,9 +266,12 @@ int main() {
 
 
 /* $Log$
-/* Revision 1.5  1998/01/29 00:51:38  curt
-/* First pass at tile cache, dynamic tile loading and tile unloading now works.
+/* Revision 1.6  1998/02/09 15:07:51  curt
+/* Minor tweaks.
 /*
+ * Revision 1.5  1998/01/29 00:51:38  curt
+ * First pass at tile cache, dynamic tile loading and tile unloading now works.
+ *
  * Revision 1.4  1998/01/27 03:26:41  curt
  * Playing with new fgPrintf command.
  *
index 90a8b7968a25c95389a0b35a06670cd6591af238..b7e5c83bc37b8a01179752ce4829f52580ff80a5 100644 (file)
@@ -42,8 +42,8 @@
 
 #define MAXNODES 100000
 
-double nodes[MAXNODES][3];
-double normals[MAXNODES][3];
+static double nodes[MAXNODES][3];
+static double normals[MAXNODES][3];
 
 
 /* given three points defining a triangle, calculate the normal */
@@ -71,7 +71,7 @@ GLint fgObjLoad(char *path, struct fgCartesianPoint *ref, double *radius) {
     GLint tile;
     FILE *f;
     int first, ncount, vncount, n1, n2, n3, n4;
-    static int use_vertex_norms = 1;
+    static int use_vertex_norms = 0;
     int winding;
     int last1, last2, odd;
 
@@ -354,9 +354,12 @@ GLint fgObjLoad(char *path, struct fgCartesianPoint *ref, double *radius) {
 
 
 /* $Log$
-/* Revision 1.22  1998/02/01 03:39:54  curt
+/* Revision 1.23  1998/02/09 15:07:52  curt
 /* Minor tweaks.
 /*
+ * Revision 1.22  1998/02/01 03:39:54  curt
+ * Minor tweaks.
+ *
  * Revision 1.21  1998/01/31 00:43:25  curt
  * Added MetroWorks patches from Carmen Volpe.
  *
index d1f700d77da92f53fb56111543399e9d69cde81b..e1ea85b177f5afc6ab6e6633b4a14b35190aab5a 100644 (file)
@@ -5,7 +5,7 @@
 #---------------------------------------------------------------------------
 
 FG_VERSION_MAJOR = 0
-FG_VERSION_MINOR = 31
+FG_VERSION_MINOR = 32
 FG_VERSION = $(FG_VERSION_MAJOR).$(FG_VERSION_MINOR)
 
 
@@ -13,8 +13,8 @@ FG_VERSION = $(FG_VERSION_MAJOR).$(FG_VERSION_MINOR)
 # Choose your weapons
 #---------------------------------------------------------------------------
 
-CC = gcc
-CXX = gcc
+CC = g++
+CXX = g++
 LD = ld
 AR = ar
 RANLIB = ranlib
index 07e5b3c83eb2f362d4ee0f6ed4d2b8f99dee8ed8..1429d6c333f851b4d0ca8a5001deb4430617b6ff 100644 (file)
@@ -98,7 +98,7 @@ double cal_mjd (int mn, double dy, int yr) {
        c = (long)(365.25*y) - 694025L;
     }
     
-    d = 30.6001*(m+1);
+    d = (int)(30.6001*(m+1));
 
     mjd = b + c + d + dy - 0.5;
 
@@ -311,10 +311,13 @@ void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t) {
 
 
 /* $Log$
-/* Revision 1.34  1998/02/07 15:29:47  curt
-/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
-/* <chotchkiss@namg.us.anritsu.com>
+/* Revision 1.35  1998/02/09 15:07:52  curt
+/* Minor tweaks.
 /*
+ * Revision 1.34  1998/02/07 15:29:47  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
  * Revision 1.33  1998/02/02 20:54:04  curt
  * Incorporated Durk's changes.
  *
index 3f4c4e5cde8325fa4cae41170073508d089e5e21..60f7e86317e046b1f9b1389ba4bf0c2ef591fd02 100644 (file)
@@ -190,8 +190,8 @@ static double julian_date(int y, int m, int d) {
 
     A = y / 100;
     B = 2 - A + (A / 4);
-    C = 365.25 * y;
-    D = 30.6001 * (m + 1);
+    C = (int)(365.25 * y);
+    D = (int)(30.6001 * (m + 1));
 
     JD = B + C + D + d + 1720994.5;
 
@@ -373,10 +373,13 @@ void fgUpdateSunPos( void ) {
 
 
 /* $Log$
-/* 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.25  1998/02/09 15:07:53  curt
+/* Minor tweaks.
 /*
+ * 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.
index da044f1e956318973400ac745d36fb99b71d4cac..7b075480e76ca3f40cd5e46f5f8ab1433bb34cfa 100644 (file)
@@ -56,10 +56,10 @@ void fgWeatherUpdate( void ) {
     /* temporarily remove the code of this do-nothing routine */
 
 #ifdef FG_WEATHER_UPDATE
-    struct fgFLIGHT *f;
+    fgFLIGHT *f;
     struct fgWEATHER *w;
 
-    f = &current_aircraft.flight;
+    f = current_aircraft.flight;
     w = &current_weather;
 
     /* Add some random turbulence */
@@ -71,10 +71,13 @@ void fgWeatherUpdate( void ) {
 
 
 /* $Log$
-/* 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.14  1998/02/09 15:07:54  curt
+/* Minor tweaks.
 /*
+ * 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.