]> git.mxchange.org Git - flightgear.git/commitdiff
Clear color buffer if drawing wireframe.
authorcurt <curt>
Mon, 13 Jul 1998 15:32:37 +0000 (15:32 +0000)
committercurt <curt>
Mon, 13 Jul 1998 15:32:37 +0000 (15:32 +0000)
When specifying and airport, start elevation at -1000 and let the system
position you at ground level.

Main/GLUTmain.cxx
Main/fg_init.cxx

index d4db7439a81b3965bc09b82a7ca2ec23808094f0..ecfa2b718b9a777a9e86b4a6c81c2d4c43e31ca0 100644 (file)
@@ -300,7 +300,8 @@ static void fgRenderFrame( void ) {
     GLfloat black[4] = { 0.0, 0.0, 0.0, 1.0 };
     GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
     GLfloat terrain_color[4] = { 0.54, 0.44, 0.29, 1.0 };
-       
+    GLbitfield clear_mask;
+
     f = current_aircraft.flight;
     l = &cur_light_params;
     o = &current_options;
@@ -327,14 +328,18 @@ static void fgRenderFrame( void ) {
        // update view volume parameters
        fgUpdateViewParams();
 
+       clear_mask = GL_DEPTH_BUFFER_BIT;
+       if ( o->wireframe ) {
+           clear_mask |= GL_COLOR_BUFFER_BIT;
+       }
        if ( o->skyblend ) {
            glClearColor(black[0], black[1], black[2], black[3]);
-           xglClear( GL_DEPTH_BUFFER_BIT );
        } else {
            glClearColor(l->sky_color[0], l->sky_color[1], 
                         l->sky_color[2], l->sky_color[3]);
-           xglClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
+           clear_mask |= GL_COLOR_BUFFER_BIT;
        }
+       xglClear( clear_mask );
 
        // Tell GL we are switching to model view parameters
        xglMatrixMode(GL_MODELVIEW);
@@ -520,11 +525,11 @@ static void fgMainLoop( void ) {
 
     if ( scenery.cur_elev > -9990 ) {
        if ( FG_Altitude * FEET_TO_METER < 
-            (scenery.cur_elev + 3.758099 * FEET_TO_METER - 1.0) ) {
+            (scenery.cur_elev + 3.758099 * FEET_TO_METER - 3.0) ) {
            // now set aircraft altitude above ground
            printf("Current Altitude = %.2f < %.2f forcing to %.2f\n", 
                   FG_Altitude * FEET_TO_METER,
-                  scenery.cur_elev + 3.758099 * FEET_TO_METER - 1.0,
+                  scenery.cur_elev + 3.758099 * FEET_TO_METER - 3.0,
                   scenery.cur_elev + 3.758099 * FEET_TO_METER);
            fgFlightModelSetAltitude( FG_LARCSIM, f, 
                                      scenery.cur_elev + 
@@ -898,6 +903,11 @@ int main( int argc, char **argv ) {
 
 
 // $Log$
+// Revision 1.34  1998/07/13 15:32:37  curt
+// Clear color buffer if drawing wireframe.
+// When specifying and airport, start elevation at -1000 and let the system
+// position you at ground level.
+//
 // Revision 1.33  1998/07/12 03:14:42  curt
 // Added ground collision detection.
 // Did some serious horsing around to be able to "hug" the ground properly
index 6c291cca1b3a1a0766f1ecaecf6fed977b69bf44..cb5bb223695a8dcb704469e76b01172d16b5761d 100644 (file)
@@ -154,7 +154,7 @@ int fgInitPosition( void ) {
        } else {
            FG_Longitude = ( a.longitude ) * DEG_TO_RAD;
            FG_Latitude  = ( a.latitude ) * DEG_TO_RAD;
-           FG_Runway_altitude = ( a.elevation );
+           FG_Runway_altitude = ( -1000 /* a.elevation */ );
            FG_Altitude = FG_Runway_altitude + 3.758099;
        }
     }
@@ -395,6 +395,11 @@ int fgInitSubsystems( void ) {
 
 
 // $Log$
+// Revision 1.24  1998/07/13 15:32:39  curt
+// Clear color buffer if drawing wireframe.
+// When specifying and airport, start elevation at -1000 and let the system
+// position you at ground level.
+//
 // Revision 1.23  1998/07/12 03:14:43  curt
 // Added ground collision detection.
 // Did some serious horsing around to be able to "hug" the ground properly